playMaker

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

stevesteve

  • Playmaker Newbie
  • *
  • Posts: 2
    • View Profile
Double-click detection?[SOLVED]
« on: December 17, 2018, 02: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 18, 2018, 10:34:30 PM by jeanfabre »

Thore

  • Sr. Member
  • ****
  • Posts: 344
    • View Profile
Re: Double-click detection?
« Reply #1 on: December 17, 2018, 03: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, 03:10:00 PM by Thore »

krmko

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

stevesteve

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

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14703
  • Official Playmaker Support
    • View Profile
Re: Double-click detection?
« Reply #4 on: December 18, 2018, 10:34:19 PM »
Hi,

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

Bye,

 Jean