playMaker

Author Topic: Double-click detection?[SOLVED]  (Read 1615 times)

stevesteve

  • Playmaker Newbie
  • *
  • Posts: 2
Double-click detection?[SOLVED]
« 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.
« Last Edit: December 19, 2018, 12:34:30 AM by jeanfabre »

Thore

  • Sr. Member
  • ****
  • Posts: 480
Re: Double-click detection?
« Reply #1 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.
« Last Edit: December 17, 2018, 05:10:00 PM by Thore »

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Re: Double-click detection?
« Reply #2 on: December 18, 2018, 09:14:46 AM »
Yeah, it's quite simple, you don't need an action for that, only two states.
Available for Playmaker work

stevesteve

  • Playmaker Newbie
  • *
  • Posts: 2
Re: Double-click detection?
« Reply #3 on: December 18, 2018, 10:34:43 AM »
Amazing elegant solution Thore! Thanks!!

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Double-click detection?
« Reply #4 on: December 19, 2018, 12:34:19 AM »
Hi,

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

Bye,

 Jean