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.

Code Snippets / [DBP] Separate mouse buttons from mouseclick(). Possibly DBC too.

Author
Message
Mr Tank
21
Years of Service
User Offline
Joined: 25th Nov 2002
Location: United Kingdom
Posted: 29th Feb 2008 21:17 Edited at: 29th Feb 2008 21:17
This way is more elegant than what i used to use. If you aren't careful with using mouseclick(), if more than one button is pressed simultaneously, it won't detect it. This works because the mouse buttons each contribute a single bit to mouseclick()



SUPER BADASS SPACESHIP X: WEBSITE
FORUM TOPIC
AndrewT
17
Years of Service
User Offline
Joined: 11th Feb 2007
Location: MI, USA
Posted: 29th Feb 2008 21:50 Edited at: 29th Feb 2008 21:53
Another cool way to do it is by defining three constants at the top of your code:



Then, when you call mouseClick( ), check it against the buttons you want to check for. For instance, if I wanted to check if both the middle buttons and left button were pressed, I would use:



Very handy if you don't wanna remember any numbers.
Irojo
15
Years of Service
User Offline
Joined: 21st May 2008
Location: Eating toast.
Posted: 15th Jun 2008 19:40
This doesn't work for DBC.

F34R MY M4SS1V3 N00B1N3SS!

Login to post a reply

Server time is: 2024-05-05 05:30:49
Your offset time is: 2024-05-05 05:30:49