Implement KeyboardController class and fix #5