Just remembered the "bang on the keyboard indiscriminately."

The code above might not work how you want it to, as if two keys are pressed at the same time, two key events will be triggered.

I'll revise the code so that the function being triggered only changes after each "mash" of the keyboard, and not after each keypress.