Description
Expected Behavior
The when button pressed
hat should trigger each time you press an EV3 button.
Actual Behavior
The hat often misses presses. It is easiest to see if you press the button quickly several times a row, with a stack like this:
For example, if I press the button quickly three times in a row, the pop sound will often play only once or twice.
Also, individual presses (especially brief presses, in which you press and then release quickly) are sometimes missed.
I would guess this is related to the fact that we are detecting presses by polling the button state, so if the press and release both happen between two polling events, we miss them completely. There is 150ms between polling requests currently (and every 3 seconds, there is 300ms between them, because of the device list request), which is enough time to both press and release a button. Not sure if we can make this interval shorter, though.