Mouse - Clearing clicks

I have a game menu and the conditions for selecting something on the menu are:

Target position always = Mouse.X() and Mouse.Y()


Target < 35 from game item.
Left mouse button is pressed


Goto scene.

But if you press the left button and then move to within 35 of a menu item, it selects. Can you clear the left mouse click, so you have to click within x time? At the moment, if you click the left mouse button, the next item on the menu you go near will be selected.


You can use a variable with the value 0 while the left mouse button of the mouse is not clicked, and with the value 1 while the left mouse button is clicked. And verify it in order to wait while the player has not released the left mouse button.



Just do somethin like this :

[code]If Mouse Click
If variable ClickState = 0

ClickState = 1[/code]

[code]If NOT Mouse Click
If variable ClickState = 1

ClickState = 2[/code]

[code]If variable ClickState = 2

ClickState = 0[/code]

[code]If Mouse is on the Button
If variable ClickState = 2


Found a nice timers solution that seemed to do the job:

If left mouse button do action
If mousetimer > 0.5s

if left mouse button is pressed reset timer mousetimer.

Works a charm. Thanks to everyone who posted help to me though :slight_smile:

Works for mouse action so far…, but howto with the keyboard event? i don’t get it :frowning:

I don’t understand what is your problem. There are keyboard related conditions available and you can combine them with timers if necessary.