Improved the keyboard input system