Fixed KeyEvent code