Small refactor of the keydown variable