Fixed the keyPressed and KeyRelease events for pratice