WiringProject / Wiring

Wiring Framework
http://wiring.org.co/
Other
217 stars 168 forks source link

Multi click/press event handling for buttons/keypads #22

Closed cyborgsimon closed 11 years ago

cyborgsimon commented 11 years ago

Hi,

I added multi click event handling for buttons.

example: button.clickHandler(handleButtonClickEvents); button.multiClickHandler(handleButtonMultiClickEvents, 300);

If the button is clicked twice in 300ms the multiClickHandler is triggered instead of the clickHandler for the second click.

In addition I added multi press event handling for keypads.

example: void keypadEvent(KeypadEvent key){ switch (keypad.getState()){ case PRESSED: break; case MULTIPRESS: break; } } If a key is pressed twice within 300 ms (default value) the MULTIPRESS state is returned instead of PRESSED for the second click.

Regards Simon