<?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[Problem: gleichzeitiges drücken von zwei Tasten (VK_UP und VK_RIGHT)]]></title><description><![CDATA[<p>Hallo,<br />
ich arbeite gerade an einem Mausemulator für Laptops. Wer mit dem Touchpad nicht klar kommt kann damit den Cursor einfach per Tastatur steuern. Ich kann den Cursor schon horizontal und vertikal bewegen jedoch nicht diagonal.</p>
<pre><code class="language-cpp">int static CPosX = 50;
	 int static CPosY = 50;
	 int static Empf = 10;
</code></pre>
<p>CPosX und CPosY geben die Cursorposition an.</p>
<pre><code class="language-cpp">case WM_KEYDOWN:
		 switch(wParam)
		 {
		 case VK_LEFT:
			 if(CPosX!=0)
			 CPosX=CPosX-Empf;

			 break;
		 case VK_RIGHT:
			 if(CPosX!=1280)
			 CPosX=CPosX+Empf;

			 break;
		 case VK_DOWN:
			 if(CPosY!=1024)
			 CPosY=CPosY+Empf;

			 break;
		 case VK_UP:
			 if(CPosY!=0)
			 CPosY=CPosY-Empf;
			 break;

		 case VK_UP &amp;&amp; VK_RIGHT: //Hier ist das Problem
			 CPosY=CPosY-Empf;
			 CPosX=CPosX+Empf;

				break;
		 	  }
		 SetCursorPos(CPosX,CPosY);
		 return 0;
</code></pre>
<p>So jetzt bewegt sich der Cursor, nur halt nicht diagonal.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/123384/problem-gleichzeitiges-drücken-von-zwei-tasten-vk_up-und-vk_right</link><generator>RSS for Node</generator><lastBuildDate>Mon, 06 Jul 2026 20:04:24 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/123384.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 16 Oct 2005 10:29:08 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Problem: gleichzeitiges drücken von zwei Tasten (VK_UP und VK_RIGHT) on Sun, 16 Oct 2005 10:29:08 GMT]]></title><description><![CDATA[<p>Hallo,<br />
ich arbeite gerade an einem Mausemulator für Laptops. Wer mit dem Touchpad nicht klar kommt kann damit den Cursor einfach per Tastatur steuern. Ich kann den Cursor schon horizontal und vertikal bewegen jedoch nicht diagonal.</p>
<pre><code class="language-cpp">int static CPosX = 50;
	 int static CPosY = 50;
	 int static Empf = 10;
</code></pre>
<p>CPosX und CPosY geben die Cursorposition an.</p>
<pre><code class="language-cpp">case WM_KEYDOWN:
		 switch(wParam)
		 {
		 case VK_LEFT:
			 if(CPosX!=0)
			 CPosX=CPosX-Empf;

			 break;
		 case VK_RIGHT:
			 if(CPosX!=1280)
			 CPosX=CPosX+Empf;

			 break;
		 case VK_DOWN:
			 if(CPosY!=1024)
			 CPosY=CPosY+Empf;

			 break;
		 case VK_UP:
			 if(CPosY!=0)
			 CPosY=CPosY-Empf;
			 break;

		 case VK_UP &amp;&amp; VK_RIGHT: //Hier ist das Problem
			 CPosY=CPosY-Empf;
			 CPosX=CPosX+Empf;

				break;
		 	  }
		 SetCursorPos(CPosX,CPosY);
		 return 0;
</code></pre>
<p>So jetzt bewegt sich der Cursor, nur halt nicht diagonal.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/893336</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/893336</guid><dc:creator><![CDATA[Leon++]]></dc:creator><pubDate>Sun, 16 Oct 2005 10:29:08 GMT</pubDate></item><item><title><![CDATA[Reply to Problem: gleichzeitiges drücken von zwei Tasten (VK_UP und VK_RIGHT) on Sun, 16 Oct 2005 10:37:07 GMT]]></title><description><![CDATA[<p>GetKeyState oder GetAsncKeyState gibts da noch</p>
]]></description><link>https://www.c-plusplus.net/forum/post/893342</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/893342</guid><dc:creator><![CDATA[Maxi]]></dc:creator><pubDate>Sun, 16 Oct 2005 10:37:07 GMT</pubDate></item><item><title><![CDATA[Reply to Problem: gleichzeitiges drücken von zwei Tasten (VK_UP und VK_RIGHT) on Sun, 16 Oct 2005 11:13:23 GMT]]></title><description><![CDATA[<p>kannst du mir da ein beispiel geben. der petzold erklärts so blöd.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/893364</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/893364</guid><dc:creator><![CDATA[Leon++]]></dc:creator><pubDate>Sun, 16 Oct 2005 11:13:23 GMT</pubDate></item><item><title><![CDATA[Reply to Problem: gleichzeitiges drücken von zwei Tasten (VK_UP und VK_RIGHT) on Sun, 16 Oct 2005 11:26:33 GMT]]></title><description><![CDATA[<p>guck in die msdn oder psdk</p>
<p>if(GetKeyState(VK_DOWN) &amp; 0x1000000000000000) -&gt; Taste gedürckt</p>
<p>mit asnckeystate ists genauso</p>
]]></description><link>https://www.c-plusplus.net/forum/post/893372</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/893372</guid><dc:creator><![CDATA[Maxi]]></dc:creator><pubDate>Sun, 16 Oct 2005 11:26:33 GMT</pubDate></item><item><title><![CDATA[Reply to Problem: gleichzeitiges drücken von zwei Tasten (VK_UP und VK_RIGHT) on Sun, 16 Oct 2005 11:40:24 GMT]]></title><description><![CDATA[<p>was hat 0x1000000000000000 zu bedeuten</p>
]]></description><link>https://www.c-plusplus.net/forum/post/893383</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/893383</guid><dc:creator><![CDATA[Leon++++]]></dc:creator><pubDate>Sun, 16 Oct 2005 11:40:24 GMT</pubDate></item><item><title><![CDATA[Reply to Problem: gleichzeitiges drücken von zwei Tasten (VK_UP und VK_RIGHT) on Sun, 16 Oct 2005 11:42:25 GMT]]></title><description><![CDATA[<p>Leon++++ schrieb:</p>
<blockquote>
<p>was hat 0x1000000000000000 zu bedeuten</p>
</blockquote>
<blockquote>
<p>If the high-order bit is 1, the key is down; otherwise, it is up.</p>
</blockquote>
]]></description><link>https://www.c-plusplus.net/forum/post/893385</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/893385</guid><dc:creator><![CDATA[flenders]]></dc:creator><pubDate>Sun, 16 Oct 2005 11:42:25 GMT</pubDate></item><item><title><![CDATA[Reply to Problem: gleichzeitiges drücken von zwei Tasten (VK_UP und VK_RIGHT) on Sun, 16 Oct 2005 12:16:55 GMT]]></title><description><![CDATA[<p>So mein Mausemulator funktioniert jetzt. wie kann ich verhindern dass der Cursor den Bildschirm verlässt?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/893399</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/893399</guid><dc:creator><![CDATA[Leon++]]></dc:creator><pubDate>Sun, 16 Oct 2005 12:16:55 GMT</pubDate></item><item><title><![CDATA[Reply to Problem: gleichzeitiges drücken von zwei Tasten (VK_UP und VK_RIGHT) on Sun, 16 Oct 2005 14:23:48 GMT]]></title><description><![CDATA[<p>is nich schwer...<br />
überleg dir einfach die grenzen in der sich der cursor bewegen darf...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/893477</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/893477</guid><dc:creator><![CDATA[Maxi]]></dc:creator><pubDate>Sun, 16 Oct 2005 14:23:48 GMT</pubDate></item></channel></rss>