Implemented keyboard input detection with KeyboardListener.java