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 / Function for detecting mouse release instead of mouse click?

Author
Message
jontepd
15
Years of Service
User Offline
Joined: 24th Feb 2009
Location: Sweden
Posted: 31st May 2009 18:44
I know how to use the function dbMouseClick, which is a function that detects whenever you press a mouse button. However, my program gets messed up if you hold down the mouse button so i was trying to find a function to detect the release of a mouse key instead of the press of a mouse key. Does such a function exist?
ScapeSta
15
Years of Service
User Offline
Joined: 28th May 2009
Location:
Posted: 31st May 2009 19:26
I'm new to this software but wouldn't it work if you do

?

If you find out could you post it on this because I need a mouse release thing to.

"A job well done is a well done job."
Bran flakes91093
16
Years of Service
User Offline
Joined: 13th Sep 2008
Location: Crazy Land
Posted: 31st May 2009 21:09 Edited at: 1st Jun 2009 00:25
You need to make your own function that remembers if the mouse has been pressed/held etc. and then do logic to find out if it has been just released or just pressed.

Here's a sample of what you want. Please note that these may be primitive; there may be room for improvement.



In case you don't know what 'static' means, it keeps the variable from being initialized/declared a second time and remembers it's value (the value never gets erased even when it's out of scope).

Edit: Tested and fixed problems.

#ifdef _DEBUG
FixBugs(All);
#endif

Login to post a reply

Server time is: 2024-11-05 23:09:35
Your offset time is: 2024-11-05 23:09:35