Slight update for keyboard event handling