Closed for Company Meetings: Between September 18 (5pm PDT) and September 22 (12pm PDT), Support and Sales requests will be delayed. Only time-sensitive issues will be addressed during that time. Thanks for your patience.
Send a bang when the button is pressed down, then another when the button is un-pressed/stops being pressed down. Use clocker to get the time spent in between. (one bang starts, the other stops). If you're doing it with serial, this is easy - just send 'a' for button-down, and 'b' for button-up. Assuming you're using an arduino for your device, look into the bounce (http://playground.arduino.cc/code/bounce) library - it has some nice edge-detection functions specifically for this kind of purpose.
Alternatively, use [cpuclock]. Compare the most recent value of the output of cpuclock to the previous value of cpuclock, and use that value for your logic. If it's above some amount of time, ignore it.
Alternate strategy (and this is a fairly standard technique):
When button gets a mouse down, trigger a [del 2000] object. If you get a mouse up (before the 2 sec are up), send a 'stop' message to the [del] object and toggle between modes two and three. If the [del] object fires, handle mode one (and ignore the next mouse up).
If you still want to handle mouse tracking (ie, you're handling a mouse up outside the button differently from a mouse up inside the button), then proceed as above, but use the delay to trigger a gate to handle the two different options. You will need to set that gate to a "default" position on the initial mouse down.
If you like to handle mouse tracking ( you're handling a mouse up outside the button differently from a mouse up inside the button), then check the post above. You will have to set that gate to a "default" position on the initial mouse down. Armbånd