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.

Newcomers DBPro Corner / Prevent holding down the mouse button

Author
Message
LeeTC
18
Years of Service
User Offline
Joined: 20th Oct 2006
Location:
Posted: 19th Mar 2007 01:26
Hola once more.

Got a big set of loops and if's going on, but I only want the end product of them to happen when the player left clicks only once (rather than them being able to hold down the mouse button).

I thought this would have been as easy as setting a holddown flag, and when holddown = 1, don't execute certain code, and when mouseclick() = 0, holddown = 0, and executing certain code is allowed.

Here's that concept in practice in my code:



But no luck. The player can still hold down the left mouse button and achieve what I only want them to be able to do when there's only a single click. Tried playing about with the placement of the holddown if but I'm apparently getting nowhere.

Help is, as always is, appreciated in advance.
LeeTC
18
Years of Service
User Offline
Joined: 20th Oct 2006
Location:
Posted: 19th Mar 2007 12:52
Got around the problem by using the holddown concept around the function in the do loop rather than inside the function. Just for examples sake if anyone else gets stuck with this:

Login to post a reply

Server time is: 2024-11-25 21:34:32
Your offset time is: 2024-11-25 21:34:32