Implements keyboard input.