<?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[ALLE Mousebuttons abfangen...]]></title><description><![CDATA[<p>Hi, ich hab nen MouseHook und fange mit dem MouseWheel Actions ab, also wenn am Rädchen gedreht wird.<br />
Ich möchte aber gerne, dass ich informiert werde, wenn egal welcher Mouseknopf gedrückt wird. z.B. auch wenn MouseWheel gedrückt wurde (also bei meiner Maus kann man das Rad reindrücken).<br />
Ich werd aus der MS Doku irgendwie nicht schlau, kann mir jemand helfen?</p>
<p>hier mal mein Hook:</p>
<pre><code>LRESULT CALLBACK MouseProc(int nCode,WPARAM wParam,LPARAM lParam){
        JNIEnv * env;
        MSLLHOOKSTRUCT * m = (MSLLHOOKSTRUCT*)lParam;

        if(nCode &lt; 0)	return CallNextHookEx(NULL, nCode, wParam, lParam);

        if (jvm-&gt;AttachCurrentThread((void **)&amp;env, NULL) &gt;= 0) {

                if(nCode == HC_ACTION){

                        switch (wParam){

                        case WM_MOUSEWHEEL:                    	
                                env-&gt;CallVoidMethod(hookObj, processKeyID, (int)m-&gt;mouseData, false);
                                break;
                            case WM_MBUTTONDOWN:
                              env-&gt;CallVoidMethod(hookObj, processKeyID, (int)m-&gt;mouseData, false);  
                              break;
                        default:
                                break;
                        }
                }
        }
        return CallNextHookEx(NULL, nCode, wParam, lParam);
}
</code></pre>
<p>einfach das Java gedöhns überlesen...<br />
z.B. &quot;case WM_MBUTTONDOWN:&quot; fängt bei mir ne komische Seitenmaustaste ab. Also am besten wäre so etwas wie, er gibt mir direkt zurück, welche Maustaste gedrückt wurde und ich muss nicht jede Maustaste abfangen. Da ja jeder ne andere Maus hat wäre das eh nicht sinnvoll, manche haben ja 5 oder mehr Tasten, manche nur 2 <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>
<p>Gibts vielleicht ne Funktion, so in der Art &quot;GetMouseButton(wparam,lprarm)&quot;?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/199417/alle-mousebuttons-abfangen</link><generator>RSS for Node</generator><lastBuildDate>Tue, 28 Apr 2026 19:37:27 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/199417.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 02 Dec 2007 20:46:09 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to ALLE Mousebuttons abfangen... on Sun, 02 Dec 2007 20:47:14 GMT]]></title><description><![CDATA[<p>Hi, ich hab nen MouseHook und fange mit dem MouseWheel Actions ab, also wenn am Rädchen gedreht wird.<br />
Ich möchte aber gerne, dass ich informiert werde, wenn egal welcher Mouseknopf gedrückt wird. z.B. auch wenn MouseWheel gedrückt wurde (also bei meiner Maus kann man das Rad reindrücken).<br />
Ich werd aus der MS Doku irgendwie nicht schlau, kann mir jemand helfen?</p>
<p>hier mal mein Hook:</p>
<pre><code>LRESULT CALLBACK MouseProc(int nCode,WPARAM wParam,LPARAM lParam){
        JNIEnv * env;
        MSLLHOOKSTRUCT * m = (MSLLHOOKSTRUCT*)lParam;

        if(nCode &lt; 0)	return CallNextHookEx(NULL, nCode, wParam, lParam);

        if (jvm-&gt;AttachCurrentThread((void **)&amp;env, NULL) &gt;= 0) {

                if(nCode == HC_ACTION){

                        switch (wParam){

                        case WM_MOUSEWHEEL:                    	
                                env-&gt;CallVoidMethod(hookObj, processKeyID, (int)m-&gt;mouseData, false);
                                break;
                            case WM_MBUTTONDOWN:
                              env-&gt;CallVoidMethod(hookObj, processKeyID, (int)m-&gt;mouseData, false);  
                              break;
                        default:
                                break;
                        }
                }
        }
        return CallNextHookEx(NULL, nCode, wParam, lParam);
}
</code></pre>
<p>einfach das Java gedöhns überlesen...<br />
z.B. &quot;case WM_MBUTTONDOWN:&quot; fängt bei mir ne komische Seitenmaustaste ab. Also am besten wäre so etwas wie, er gibt mir direkt zurück, welche Maustaste gedrückt wurde und ich muss nicht jede Maustaste abfangen. Da ja jeder ne andere Maus hat wäre das eh nicht sinnvoll, manche haben ja 5 oder mehr Tasten, manche nur 2 <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>
<p>Gibts vielleicht ne Funktion, so in der Art &quot;GetMouseButton(wparam,lprarm)&quot;?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1413976</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1413976</guid><dc:creator><![CDATA[Lumpeh]]></dc:creator><pubDate>Sun, 02 Dec 2007 20:47:14 GMT</pubDate></item><item><title><![CDATA[Reply to ALLE Mousebuttons abfangen... on Mon, 03 Dec 2007 19:58:44 GMT]]></title><description><![CDATA[<p>vielleicht ein kleiner hinweis? bin mit C bzw. winapi Programmierung eher unerfahren, komme aus Java <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1414444</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1414444</guid><dc:creator><![CDATA[Lumpeh]]></dc:creator><pubDate>Mon, 03 Dec 2007 19:58:44 GMT</pubDate></item><item><title><![CDATA[Reply to ALLE Mousebuttons abfangen... on Mon, 03 Dec 2007 21:13:09 GMT]]></title><description><![CDATA[<p>Weis halt niemand? :-&gt; Warte bis morgen. Ich habe keine Ahnung von was du sprichst!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1414482</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1414482</guid><dc:creator><![CDATA[C-Chris]]></dc:creator><pubDate>Mon, 03 Dec 2007 21:13:09 GMT</pubDate></item><item><title><![CDATA[Reply to ALLE Mousebuttons abfangen... on Tue, 04 Dec 2007 07:09:22 GMT]]></title><description><![CDATA[<p>Jeder Mausbutton hat eine eigne Nachrichtengruppe WM_LBUTTON..., WM_RBUTTON..., WM_MBUTTON...</p>
<p>Schon mal versucht die MSDN zu lesen?<br />
Spätestens über die Suche nach WM_MBUTTONDOWN wärst Du auf die anderen Nachricten gekommen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1414552</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1414552</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Tue, 04 Dec 2007 07:09:22 GMT</pubDate></item><item><title><![CDATA[Reply to ALLE Mousebuttons abfangen... on Tue, 04 Dec 2007 13:53:05 GMT]]></title><description><![CDATA[<p>ja hab ich gelesen, wurd aber (wie gesagt) nicht schlau draus weil viele Mäuse eben mehr als nur L/R/M Buttons haben und ich wollte wissen, ob es was gibt, wie ich ALLE Buttons herausfinden kann...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1414785</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1414785</guid><dc:creator><![CDATA[Lumpeh]]></dc:creator><pubDate>Tue, 04 Dec 2007 13:53:05 GMT</pubDate></item><item><title><![CDATA[Reply to ALLE Mousebuttons abfangen... on Tue, 04 Dec 2007 14:00:04 GMT]]></title><description><![CDATA[<p>Was kommt denn sonst noch dazu? WM_MOUSEWEEL, und das war's.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1414790</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1414790</guid><dc:creator><![CDATA[Elektronix]]></dc:creator><pubDate>Tue, 04 Dec 2007 14:00:04 GMT</pubDate></item><item><title><![CDATA[Reply to ALLE Mousebuttons abfangen... on Tue, 04 Dec 2007 17:06:14 GMT]]></title><description><![CDATA[<p>Alles andere was an Buttons existiert ist rein von den entsprechenden Treibern implementiert. Dafür gibt es keine offiziellen Nachrichten.</p>
<p>D.h. auch die entsprechenden Aktionen sind herstellerspezifisch.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1414911</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1414911</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Tue, 04 Dec 2007 17:06:14 GMT</pubDate></item></channel></rss>