Implement dynamic mapping for the Keyboard input device

We use QKeySequence to convert from a key's string representation to its
int keycode.