Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: stevesteve on December 17, 2018, 04:34:38 PM

Title: Double-click detection?[SOLVED]
Post by: stevesteve on December 17, 2018, 04:34:38 PM
Double-click detection problem. Jean outlined a way to do this in 2012, but I still can’t figure out what actions to use to store the mouse pick and the time associated with the mouse pick(s) to compare to trigger a double-click event. It would be amazing if someone had a small working sample where I can see and learn how to do this. Thanks.
Title: Re: Double-click detection?
Post by: Thore on December 17, 2018, 05:07:43 PM
Check Ecosystem first.

Probably not ideal, but working example. First state, listens to mousclick, goes to a new state, which has a wait action on top that goes to Finished event. Underneath the wait action, it also listens for a mouse click (which would be the double click). The wait timer must be extremely short, and when run out, it’ll go back to the first state. Thus, only if you click twice, fast, it’ll register.

What happens is that you reach the second state only on mouseclick, but it stays in that state only super-briefly, so only in that brief moment you can click again, i.e. double click to proceed.
Title: Re: Double-click detection?
Post by: Fat Pug Studio on December 18, 2018, 09:14:46 AM
Yeah, it's quite simple, you don't need an action for that, only two states.
Title: Re: Double-click detection?
Post by: stevesteve on December 18, 2018, 10:34:43 AM
Amazing elegant solution Thore! Thanks!!
Title: Re: Double-click detection?
Post by: jeanfabre on December 19, 2018, 12:34:19 AM
Hi,

 I do think that it is the technic that I used back then.

Bye,

 Jean