Implemented keyboard input.