Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Detecting mouse button clicks

Author
Message
F4SHAD0
13
Years of Service
User Offline
Joined: 28th Jan 2011
Location: Behind You
Posted: 28th Jan 2011 20:43
I know that DGDK detects the first mouse button by default, but what about the second, or even third mouse button (that being the middle mouse). In ArmA, middle mouse click is almost essential to gameplay because it is pretty much your action/use button. So I was wondering, is there a way to detect second mouse, and third mouse (middle mouse) button clicks.
Hassan
15
Years of Service
User Offline
Joined: 4th May 2009
Location: <script> alert(1); </script>
Posted: 28th Jan 2011 21:19
dbMouseClick ( ) returns the currently clicked button, so

if ( dbMouseClick ( ) == 1 ) checks whether button 1 is down
if ( dbMouseClick ( ) == 2 ) checks for button 2, etc.

but i'm not really sure what happens if two or more buttons are down at once

Bran flakes91093
15
Years of Service
User Offline
Joined: 13th Sep 2008
Location: Crazy Land
Posted: 28th Jan 2011 23:38
Quote: "but i'm not really sure what happens if two or more buttons are down at once"


The values are added up:

LMB = 1
RMB = 2
LMB + RMB = 3
MMB = 4
LMB + MMB = 5

“C++ : Where friends have access to your private members.”
-Gavin Russell Baker
F4SHAD0
13
Years of Service
User Offline
Joined: 28th Jan 2011
Location: Behind You
Posted: 29th Jan 2011 22:36
Hey, thanks a lot guys. I thought it was just the first button that was detected. Now I stand corrected. My appreciations.

Login to post a reply

Server time is: 2024-06-28 00:50:33
Your offset time is: 2024-06-28 00:50:33