Changed key input to keyup() and altered how keycodes are processed