Class for controlling keyboard events.