Hi,
Since switch does no pattern match variables but only constants (static inline), the whole Keycode class is a potential disaster (at least with recent haxe versions).
for example : key_1 is static var and thus the pattern matcher will use every work key_1 as switch traps and all the code in the switch is a potential switch trap.
I suggest obliterating the code (asap) and replacing the old implementation switch with an Int Map matching keycodes and scancodes.
Xoxo