WiringProject/Wiring — pull request #22 by cyborgsimon (2012-09-23 13:28:49+00:00)
Title: Multi click/press event handling for buttons/keypads

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