Double Key Press Activation State Machine Thingy!

Quickly pressing 's' on your keyboard twice will trigger the active state function. Pressing 'esc' will trigger the reset function once in the active state. I built it in such a way that it ignores all keys except for 's' and 'esc'. It also ignores keyboard activity if the focus is currently in a textarea or input. When I integrate this into my future search tool that I'm building this for, I will have to add an exception for the search input in which it was activated for the 'esc' key.

Listening => Hit => Activated

Wrong: Key | Target