Use a global timer variable to track times.

Start of frame messages are received every millisecond. It's a way to
implement a precise 1ms timer.
Don't lock mcu on error.
New key press logic.

Most code should depend on the current state of the key.
The previous release and press events are still there but they should
not be used anymore because those event can be missed.