Refactoring the keyboard handler to be separated properly (as in the slides)
Using the keyboard_handler stuff instead the inlined version