Solved problems with keyListener