<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Testenbelegung]]></title><description><![CDATA[<p>Hi,</p>
<p>Ich habe da mal ein Frage.</p>
<p>Wie stell ich es an das bei tastendruck eine Aktion ausgeführt wird. Das ganze soll aber so sein, egal wo sich der fokus sich befindet soll das ausgeführt werden.</p>
<p>ein kleines beispiel. wenn ich 'a' drücke soll der mir eine meldung bringen.</p>
<p>Normalerweise würd ich das mit KeyPress machen. Das problem besteht im moment darin, wenn ich das in Form1KeyPress rein schreibe und Form 1 ist leer, dann führt der die aktion aus, sobalt ich aber z.B. einen Button in die form setzte macht der das nicht mehr.</p>
<p>Ok, ich könnte das dann ja auch noch in Button1KeyPress rein schreiben, die buttons die ich habe, haben aber kein OnKeyPress.</p>
<p>Danke schonmal</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/148238/testenbelegung</link><generator>RSS for Node</generator><lastBuildDate>Thu, 06 Aug 2026 15:59:22 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/148238.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 24 May 2006 15:24:46 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Testenbelegung on Wed, 24 May 2006 15:24:46 GMT]]></title><description><![CDATA[<p>Hi,</p>
<p>Ich habe da mal ein Frage.</p>
<p>Wie stell ich es an das bei tastendruck eine Aktion ausgeführt wird. Das ganze soll aber so sein, egal wo sich der fokus sich befindet soll das ausgeführt werden.</p>
<p>ein kleines beispiel. wenn ich 'a' drücke soll der mir eine meldung bringen.</p>
<p>Normalerweise würd ich das mit KeyPress machen. Das problem besteht im moment darin, wenn ich das in Form1KeyPress rein schreibe und Form 1 ist leer, dann führt der die aktion aus, sobalt ich aber z.B. einen Button in die form setzte macht der das nicht mehr.</p>
<p>Ok, ich könnte das dann ja auch noch in Button1KeyPress rein schreiben, die buttons die ich habe, haben aber kein OnKeyPress.</p>
<p>Danke schonmal</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1064366</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1064366</guid><dc:creator><![CDATA[JBOpael]]></dc:creator><pubDate>Wed, 24 May 2006 15:24:46 GMT</pubDate></item><item><title><![CDATA[Reply to Testenbelegung on Wed, 24 May 2006 15:33:19 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>nimm <em>TForm::OnKeyPress</em> und setzt <em>TForm::KeyPreview</em> auf true.</p>
<p>/Edit : Du kannst auch eine <em>TActionList</em> einbinden und dort eine Aktion mit gewünschten Hotkey definieren.</p>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1064371</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1064371</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Wed, 24 May 2006 15:33:19 GMT</pubDate></item><item><title><![CDATA[Reply to Testenbelegung on Wed, 24 May 2006 15:33:16 GMT]]></title><description><![CDATA[<p>Danke,</p>
<p>funzt.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1064375</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1064375</guid><dc:creator><![CDATA[JBOpael]]></dc:creator><pubDate>Wed, 24 May 2006 15:33:16 GMT</pubDate></item><item><title><![CDATA[Reply to Testenbelegung on Wed, 24 May 2006 16:07:03 GMT]]></title><description><![CDATA[<p>Kleine Frage hab ich noch.</p>
<p>Wie kann ich bei der Tastenbelgung noch die STRG taste mit einbinden??</p>
<pre><code class="language-cpp">if( Key= STRG + 'a' )
</code></pre>
<p>geht nicht.</p>
<p>Ich kann in der hilfe nichts passendes dazu finden.</p>
<p>Danke nochmal.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1064399</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1064399</guid><dc:creator><![CDATA[JBOpael]]></dc:creator><pubDate>Wed, 24 May 2006 16:07:03 GMT</pubDate></item><item><title><![CDATA[Reply to Testenbelegung on Wed, 24 May 2006 16:10:27 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>das geht mit dem OnKeyDown-Event besser</p>
<pre><code class="language-cpp">void __fastcall TForm::OnKeyDown(TObject* Sender(TObject* Sender, Word &amp;Key,    
  TShiftState Shift)
{
  if ((Shift.Contains(ssShift) &amp;&amp; (Key == 'a'))
  {
  }
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1064402</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1064402</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Wed, 24 May 2006 16:10:27 GMT</pubDate></item><item><title><![CDATA[Reply to Testenbelegung on Wed, 24 May 2006 16:24:48 GMT]]></title><description><![CDATA[<p>Da hab ich jetzt aber wieder das problem das der nicht darauf reagiert, so wie bei KeyPress.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1064413</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1064413</guid><dc:creator><![CDATA[JBOpael]]></dc:creator><pubDate>Wed, 24 May 2006 16:24:48 GMT</pubDate></item><item><title><![CDATA[Reply to Testenbelegung on Wed, 24 May 2006 16:41:25 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>akari schrieb:</p>
<blockquote>
<p>und setzt <em>TForm::KeyPreview</em> auf true.</p>
</blockquote>
<p>übrigens ist die Abfrage natürlich so Unsinn... <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f644.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_rolling_eyes"
      title=":rolling_eyes:"
      alt="🙄"
    /></p>
<pre><code class="language-cpp">void __fastcall TForm::OnKeyDown(TObject* Sender(TObject* Sender, Word &amp;Key,    
  TShiftState Shift)
{
  if (Shift.Contains(ssShift) &amp;&amp; (Key == 'A'))
  {
  }
}
</code></pre>
<p>Und das geht auch mit Focus auf innere Controls, habs extra getestet.</p>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1064422</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1064422</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Wed, 24 May 2006 16:41:25 GMT</pubDate></item><item><title><![CDATA[Reply to Testenbelegung on Wed, 24 May 2006 16:43:34 GMT]]></title><description><![CDATA[<p>Du kannst es aber auch mit einer ActionList Komponente machen.<br />
Wenn du eine neue Action erstellst, kann man bei shortcut einstellen, wenn diese aktion aktiviert wird.</p>
<pre><code class="language-cpp">Action1-&gt;Shortcut-&gt;......Strg+a, Strg+b, usw....;
</code></pre>
<p>Dann kannst du ganz einfach dein Programm das bei deinem Keypress ausgeführt werden soll in die Action kopieren.</p>
<p>MFG<br />
Seal_Reaver</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1064424</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1064424</guid><dc:creator><![CDATA[Seal_Reaver]]></dc:creator><pubDate>Wed, 24 May 2006 16:43:34 GMT</pubDate></item><item><title><![CDATA[Reply to Testenbelegung on Wed, 24 May 2006 17:12:52 GMT]]></title><description><![CDATA[<p><strong>@ akari</strong></p>
<p>Es funktioniert, so wie du das geschrieben hast, aber ich wollte nicht die Shift taste sondern die STRG taste.</p>
<p>Die shift taste kann ich auch mit Key Press abfragen</p>
<pre><code class="language-cpp">if(Key='A')
</code></pre>
<p>geht auch.</p>
<p><strong><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/12061">@Seal_Reaver</a></strong></p>
<p>Danke. Aber lieber wär mir ne Methode über KeyDown KeyUp oder KeyPress.<br />
Das würden zu viele Aktionen werden.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1064442</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1064442</guid><dc:creator><![CDATA[JBOpael]]></dc:creator><pubDate>Wed, 24 May 2006 17:12:52 GMT</pubDate></item><item><title><![CDATA[Reply to Testenbelegung on Wed, 24 May 2006 17:24:43 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">void __fastcall TForm::OnKeyDown(TObject* Sender(TObject* Sender, Word &amp;Key,     
  TShiftState Shift) 
{ 
  if (Shift.Contains(ssCtrl) &amp;&amp; (Key == 'A')) 
  { 
  } 
}
</code></pre>
<p>so funzt das. Ist zwar nicht das gelbe vom ei aber damit lässt sich was anfangen. mich stört ein bischen das ich ein großes A nehmen muss aber damit lässt sich leben.</p>
<p>Vielen Dank für eure Hilfe.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1064451</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1064451</guid><dc:creator><![CDATA[JBOpael]]></dc:creator><pubDate>Wed, 24 May 2006 17:24:43 GMT</pubDate></item><item><title><![CDATA[Reply to Testenbelegung on Wed, 24 May 2006 17:37:33 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>klar muß es ein großes A sein... wenn gleichzeitig Shift gedrückt sein soll.<br />
Übrigens werden alle Hotkeys eh immer mit großen Buchstaben geschrieben, also nur konsequent. Wenn du dann mehrere komplexere Hotkeys haben willst, solltest du aber wirklich mit TActionList arbeiten.</p>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1064460</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1064460</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Wed, 24 May 2006 17:37:33 GMT</pubDate></item></channel></rss>