Add missing state reset on event emission

When eimitting an event, we also have to reset the state.
Merge pull request #574 from neithernut/fix-hotkeys-reset_when_emitting_event

Add missing state reset on event emission