Keyboard support

This is WIP and targets #263, #314
Is this supposed to be `NULL`?