Keyboard support

This is WIP and targets #263, #314
Could you move this below keymap? That way the internal structure still makes sense