Hi,
The best way would be to only fire an event if you had a keydown AND keyUp, so watch the key down state move to a state that watch the keyup and then fire an event, and come back to the state that watch the key down. This way you can not have any race conditions on new fsm also listening to keys.
bye,
Jean