<?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[Kann man in Windows nicht mehr als 3 gedrückte Tasten erkennen?]]></title><description><![CDATA[<p>Ich habe diesen</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/154586/kann-man-in-windows-nicht-mehr-als-3-gedrückte-tasten-erkennen</link><generator>RSS for Node</generator><lastBuildDate>Thu, 23 Jul 2026 15:50:46 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/154586.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 28 Jul 2006 12:42:31 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Kann man in Windows nicht mehr als 3 gedrückte Tasten erkennen? on Fri, 28 Jul 2006 12:42:31 GMT]]></title><description><![CDATA[<p>Ich habe diesen</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1106138</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1106138</guid><dc:creator><![CDATA[Paula]]></dc:creator><pubDate>Fri, 28 Jul 2006 12:42:31 GMT</pubDate></item><item><title><![CDATA[Reply to Kann man in Windows nicht mehr als 3 gedrückte Tasten erkennen? on Fri, 28 Jul 2006 12:43:33 GMT]]></title><description><![CDATA[<p>ich habe diesen source von loggys tutorial:</p>
<pre><code>#include &lt;windows.h&gt;

LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
                   PSTR szCmdLine, int iCmdShow)
{
   MSG          msg;
   HWND         hWnd;
   WNDCLASS     wc;

   char szAppName[] = &quot;Tastaturabfragen&quot;;

   wc.cbClsExtra         = 0;
   wc.cbWndExtra         = 0;
   wc.hbrBackground      = (HBRUSH) GetStockObject(WHITE_BRUSH);
   wc.hCursor            = LoadCursor(NULL, IDC_ARROW);
   wc.hIcon              = LoadIcon(NULL, IDI_APPLICATION);
   wc.hInstance          = hInstance;
   wc.lpfnWndProc        = WndProc;
   wc.lpszClassName      = szAppName;
   wc.lpszMenuName       = NULL;
   wc.style              = CS_HREDRAW | CS_VREDRAW;

   RegisterClass(&amp;wc);

   hWnd = CreateWindow( szAppName,
                        szAppName,
                        WS_OVERLAPPEDWINDOW,
                        CW_USEDEFAULT,
                        CW_USEDEFAULT,
                        CW_USEDEFAULT,
                        CW_USEDEFAULT,
                        NULL,
                        NULL,
                        hInstance,
                        NULL);

   ShowWindow(hWnd, iCmdShow);
   UpdateWindow(hWnd);

   while (GetMessage(&amp;msg, NULL, 0, 0))
   {
      TranslateMessage(&amp;msg);
      DispatchMessage(&amp;msg);
   }
   return msg.wParam;
}

LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) {
   static RECT   rect;
   static bool   ArrowKeys[4];

   switch (message)
   {

   case WM_SIZE:
      {
         rect.right  = LOWORD(lParam);
         rect.bottom = HIWORD(lParam);
         return 0;
      }

   case WM_KEYDOWN:
      {
         switch (wParam)
         {
         case VK_LEFT:
            ArrowKeys[0] = true;
            break;

         case VK_UP:
            ArrowKeys[1] = true;
            break;

         case VK_RIGHT:
            ArrowKeys[2] = true;
            break;

         case VK_DOWN:
            ArrowKeys[3] = true;
            break;

         default:
            return 0;
         }
         InvalidateRect(hWnd, NULL, FALSE);
         return 0;
      }

      case WM_KEYUP:
      {
         switch (wParam)
         {
         case VK_LEFT:
            ArrowKeys[0] = false;
            break;

         case VK_UP:
            ArrowKeys[1] = false;
            break;

         case VK_RIGHT:
            ArrowKeys[2] = false;
            break;

         case VK_DOWN:
            ArrowKeys[3] = false;
            break;

         default:
            return 0;
         }
         InvalidateRect(hWnd, NULL, FALSE);
         return 0;
      }

   case WM_PAINT:
      {
         PAINTSTRUCT  ps;
         HDC          hDC;
			SIZE         size;
         char szKeyStatus[40];
         int  iKeyLength;

         hDC = BeginPaint(hWnd, &amp;ps);
         for (int i = 0; i &lt; 4; i++)
         {
            iKeyLength = wsprintf(szKeyStatus, &quot;Status Taste %i: %i&quot;,
                                  i, ArrowKeys[i]);
				GetTextExtentPoint32(hDC, szKeyStatus, iKeyLength, &amp;size);
            TextOut(hDC, rect.right / 2 - size.cx / 2, rect.bottom / 2 -
                    2 * size.cy + i * size.cy, szKeyStatus, iKeyLength);
         }
         EndPaint(hWnd, &amp;ps);

         return 0;
      }
   case WM_DESTROY:
      {
         PostQuitMessage(0);
         return 0;
      }
   }
   return DefWindowProc(hWnd, message, wParam, lParam);
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1106140</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1106140</guid><dc:creator><![CDATA[Paula]]></dc:creator><pubDate>Fri, 28 Jul 2006 12:43:33 GMT</pubDate></item><item><title><![CDATA[Reply to Kann man in Windows nicht mehr als 3 gedrückte Tasten erkennen? on Fri, 28 Jul 2006 12:51:50 GMT]]></title><description><![CDATA[<p>Win-Version?</p>
<p>MfG SideWinder</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1106144</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1106144</guid><dc:creator><![CDATA[SideWinder]]></dc:creator><pubDate>Fri, 28 Jul 2006 12:51:50 GMT</pubDate></item><item><title><![CDATA[Reply to Kann man in Windows nicht mehr als 3 gedrückte Tasten erkennen? on Fri, 28 Jul 2006 12:54:26 GMT]]></title><description><![CDATA[<p>WinXP</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1106147</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1106147</guid><dc:creator><![CDATA[Paula]]></dc:creator><pubDate>Fri, 28 Jul 2006 12:54:26 GMT</pubDate></item><item><title><![CDATA[Reply to Kann man in Windows nicht mehr als 3 gedrückte Tasten erkennen? on Fri, 28 Jul 2006 13:08:30 GMT]]></title><description><![CDATA[<p>Tastatur?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1106166</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1106166</guid><dc:creator><![CDATA[;D]]></dc:creator><pubDate>Fri, 28 Jul 2006 13:08:30 GMT</pubDate></item><item><title><![CDATA[Reply to Kann man in Windows nicht mehr als 3 gedrückte Tasten erkennen? on Fri, 28 Jul 2006 13:10:15 GMT]]></title><description><![CDATA[<p>Das runde Ding? Har Har Har</p>
<p>Also bei Euch erkennt er mehr als 3 Tasten?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1106169</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1106169</guid><dc:creator><![CDATA[Paula]]></dc:creator><pubDate>Fri, 28 Jul 2006 13:10:15 GMT</pubDate></item><item><title><![CDATA[Reply to Kann man in Windows nicht mehr als 3 gedrückte Tasten erkennen? on Mon, 31 Jul 2006 07:23:41 GMT]]></title><description><![CDATA[<p>Paula schrieb:</p>
<blockquote>
<p>Also bei Euch erkennt er mehr als 3 Tasten?</p>
</blockquote>
<p>nein auf gar keinen fall die restlichen ca. 100tasten sind nur zur zierde und für andere betriebssysteme gedacht <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f921.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--clown_face"
      title=":clown:"
      alt="🤡"
    /><br />
loggy hat bestimmt die parameter von wm_keydown bzw. virtual keycodes erwähnt dann schlage sie doch in der msdn nach.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1107481</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1107481</guid><dc:creator><![CDATA[miller_m]]></dc:creator><pubDate>Mon, 31 Jul 2006 07:23:41 GMT</pubDate></item><item><title><![CDATA[Reply to Kann man in Windows nicht mehr als 3 gedrückte Tasten erkennen? on Mon, 31 Jul 2006 08:40:15 GMT]]></title><description><![CDATA[<p>Hallo Miller_M,</p>
<p>könntest Du es mir etwas genauer erklären?<br />
Hier sind die Parameter von <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/userinput/keyboardinput/keyboardinputreference/keyboardinputmessages/wm_keydown.asp" rel="nofollow">wm_keydown</a><br />
Was sollen diese mir weiterhelfen?</p>
<p>Ich glaube ich habe mein Problem nicht deutlich genug gemacht. In dem Beispiel von Loggy geht es darum anzuzeigen wenn die vier Pfeiltasten gedrückt werden.</p>
<p>In der Nachrichtenfunktion steht es so:</p>
<pre><code>switch (message) {
case WM_KEYDOWN: {

	switch (wParam) {
	case VK_LEFT:
		ArrowKeys[0] = true;
		break;
	case VK_UP:
		ArrowKeys[1] = true;
		break;

	case VK_RIGHT:
		ArrowKeys[2] = true;
		break;

	case VK_DOWN:
		ArrowKeys[3] = true;
		break;
...
</code></pre>
<p>Jedes mal wenn eine Taste gedrückt wird, wird eine WM_KEYDOWN Message ausgelößt. Egal wieviele Tasten ich bereits gedrückt halte. Korrekt? Oder gibt es da Windows Einschränkungen?<br />
Danach überprüft das zweite Switch Statement ob im wParam Parameter VK_LEFT steht. lParam wird gar nicht abgefragt.</p>
<p>Warum wird die vierte Pfeiltaste nicht registriert?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1107548</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1107548</guid><dc:creator><![CDATA[Paula]]></dc:creator><pubDate>Mon, 31 Jul 2006 08:40:15 GMT</pubDate></item><item><title><![CDATA[Reply to Kann man in Windows nicht mehr als 3 gedrückte Tasten erkennen? on Mon, 31 Jul 2006 10:13:10 GMT]]></title><description><![CDATA[<p>Es liegt an der Tastatur, nicht an Windows.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1107605</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1107605</guid><dc:creator><![CDATA[ß]]></dc:creator><pubDate>Mon, 31 Jul 2006 10:13:10 GMT</pubDate></item><item><title><![CDATA[Reply to Kann man in Windows nicht mehr als 3 gedrückte Tasten erkennen? on Mon, 31 Jul 2006 11:11:28 GMT]]></title><description><![CDATA[<p>miller_m schrieb:</p>
<blockquote>
<p>Paula schrieb:</p>
<blockquote>
<p>Also bei Euch erkennt er mehr als 3 Tasten?</p>
</blockquote>
<p>nein auf gar keinen fall die restlichen ca. 100tasten sind nur zur zierde und für andere betriebssysteme gedacht <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f921.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--clown_face"
      title=":clown:"
      alt="🤡"
    /><br />
loggy hat bestimmt die parameter von wm_keydown bzw. virtual keycodes erwähnt dann schlage sie doch in der msdn nach.</p>
</blockquote>
<p>Gleichzeitig <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f4a1.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--light_bulb"
      title=":bulb:"
      alt="💡"
    /></p>
<p>MfG SideWinder</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1107661</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1107661</guid><dc:creator><![CDATA[SideWinder]]></dc:creator><pubDate>Mon, 31 Jul 2006 11:11:28 GMT</pubDate></item><item><title><![CDATA[Reply to Kann man in Windows nicht mehr als 3 gedrückte Tasten erkennen? on Mon, 31 Jul 2006 11:12:42 GMT]]></title><description><![CDATA[<p>Ach so. Danke <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1107662</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1107662</guid><dc:creator><![CDATA[Paula]]></dc:creator><pubDate>Mon, 31 Jul 2006 11:12:42 GMT</pubDate></item></channel></rss>