Merge pull request #19 from leaflabs/build-improvements

Build system improvements
added button multi click event handling support
added keypad multi press event handling support
Merge pull request #22 from cyborgsimon/master

Multi click/press event handling for buttons/keypads
Update framework/libraries/Button/Button.h

add @contrib for https://github.com/cyborgsimon for his multipress api
Update framework/libraries/Button/Button.h

removed old SVN $Id: line
Add debounce time check to button library

Fixes issue #15
Merge pull request #1 from cyborgsimon/#15-button-debounce-time

Add debounce time check to button library
Merge pull request #23 from cyborgsimon/master

Add debounce time check to button library
replaced MULTIPRESS event with the getPressCount method

MULTIPRESS may break projects using the PRESSED event since MULTIPRESS
is triggered instead of PRESSED
use getPressCount() to find out how often (multi press) the key was
pressed, when the PRESSED event is triggered
updated the example
updated keywords.txt
replaced multiClickHandler trigger with the getClickCount method

The multiClickHandler may break projects using the clickHandler since
the multiClickHandler
is triggered instead of the clickHandler.
Use getClickCount() within the clickHandler trigger to find out how
often the key (multi click) was clicked.

350ms is used as default multiClickEventThreshold
updated the example
updated keywords.txt
Merge pull request #24 from cyborgsimon/multi-click

Replace MULTIPRESS event with getPressCount method to be backwards compatible
Merge pull request #25 from cyborgsimon/button-multi-click

Replace multiClickHandler trigger with the getClickCount method to be backwards compatible
do not trigger click event if hold event was triggered before

otherwhise hold and click event are triggered both
Merge pull request #26 from cyborgsimon/master

do not trigger button click event if hold event was triggered before
add use(item) and select(item)
Changed framework/libraries/Button

changed isPressed() to scan(), as I found using the isPressed() method awkward in terms of readability, in event mode.

added property sets:
- setDebounceDelay (changed from setDebounceTime)
- setHoldRepeat (to set repeat calls to the Hold event)

added property gets:
- getPin (to identify the button in handlers)
- getHoldRepeatCount (to get the number of times the hold event has been called during the current hold)

changed the size of some of the reporting members
- times, since they could be longer than 65 seconds
- numberOfPresses, since you could conceivably have more than 65K presses on a single button.

I cleaned up the debounce logic.

I changed the multi click functionality - and IMO the logical way to do it.  See below.

The onClick handler isn't called unless the multi click threshold has expired, and it will only fire ONCE for multi clicks.  So, if the multi click threshold is 0, then ALL clicks events are fired, but if it is > 0, then only a single click event is fired if more than one click fits within the threshold.  What this means is that if you get a "double click", then you only get a single click event, and it is identified as a "double click" - you could theoretically have a octuple click - eek! :)

Finally, the main reason for the changes - I needed Hold event repeats!  So now it's done. Now, if the button is held longer than the initial hold threshold + hold repeat, a second Hold event will be fired. If held longer, it will continue to call the Hold event, according to the holdEventRepeatTime interval.  There is a reporting member (getHoldRepeatCount) to get the number of times the hold event has been called.

Signed-off-by: Brett Hagman (bhagman-ws1) <bhagman@roguerobotics.com>
Adding the MLAB fork of Arduino into Wiring project
deleting the programmers selection (not tested)
can't inline methods from outside .h

We had a reference error if WSPI::setBitOrder was called from the sketch. This is the fix, thanks to Carlos Mario Rodriguez Perdomo for discovering the bug.