The keypress should be recognized when the key is released, and returns to "buttonsUp" -- provided it has passed the debounce period (nominally 29ms in the posted code, but a lower value might work too), For a quick keypress, this should appear to be instant, since the timer2 ISR is firing every 1msec. You could probably also trigger it, after passing the LongPress threshold, and not wait for buttonsUp.
The one difference i can think of, is that an extra variable, buttonGood, is now required. It wasn't needed before, because PCINT_vect was detecting pin changes on that port.
|