Implement keyboard input.