Announcement

Collapse
No announcement yet.

Long Press Event?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Long Press Event?

    How can you detect and run an event on the long press of a button?

    For example, holding the left click button for 2 seconds to bring up a context menu or something...

    Any ideas?

    #2
    On Press -> start timer.
    If timer >= 2 -> do stuff.
    On Release -> stop timer.
    | Savior | USQLite | FSM | Object Pool | Sound Occlusion | Property Transfer | Magic Nodes | MORE |

    Comment


      #3
      How about a 2 seconds timer that starts when the left-click is pressed. When time elapses simply execute the event and bring up a context menu in this case.
      When left-click is released stop and clear the timer so if it is held for less than 2 seconds nothing will happen.

      EDIT. Always late ;D

      Comment


        #4
        Also you could try something like this:
        Create a new bool variable and call it Interrupted .
        - On left click pressed event Set Interrupted to false -> retriggerable delay (2 sec) -> and create branch with Interrupted -> on false -- do stuff
        - On released left click Set Interrupted to true.

        Comment

        Working...
        X