Added key events, fixed doubletap bug