Thread: Midi <-> OSC
View Single Post
Old 11-16-2017, 10:27 PM   #68
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 8,625
Default

Quote:
Originally Posted by fundorin View Post
Is it possible to use timers for detecting momentary and toggle presses of the single button? Couldn't find anything realted in the manual.
The "@timer" event service routine is called 100 times a second. Here you can count time.

set a counter to a timeout constant to start the timer and do

Code:
@timer
counter ? (
  counter -= 1;
  !counter ? (
    //do some action 
  );
);
I used such for detecting long vs short button pressing in JSFX. Here instead of @timer, @block is to be used.

-Michael
mschnell is offline   Reply With Quote