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 / [GDK] Quick snippet: dbMouseDblClick() - Catching Mouse Double Click

Author
Message
Drowneath
14
Years of Service
User Offline
Joined: 22nd Jun 2009
Location: In your eyes
Posted: 27th Sep 2009 20:09 Edited at: 27th Sep 2009 20:42
First, add these variables to the global scope of your program:


Second, add these functions to your program:


Third, add the UpdateDblClick() function in your game loop.


Then enjoy the dbMouseDblClick() function!

Example program:



Simple, wasn't it?

[note: actually there's no such function as "mouse dbl click" in the DarkBASIC language. well, just a name]

if(asleep) sheep++;
Talairina
18
Years of Service
User Offline
Joined: 9th Jan 2006
Location: United Kingdom
Posted: 8th Nov 2009 00:52
Could this be adapted to read a double tap of any key and not just a mouse click? Say to check if a player has doubled tapped 'w' as an example.

I do like the idea of been able to detect double clicks of the mouse but would this just check the LMB or any mouse related button? Great code either way =)

Login to post a reply

Server time is: 2024-05-05 03:45:08
Your offset time is: 2024-05-05 03:45:08