Added basic key event handling