Added KeyEvent to keyPressed and keyReleased methods