Moved key events into separate functions for easier subclass and overrid...

...e