Implemented keylistener for GUI