keyboard: emit key events without keymap

Sometimes compositors don't need an XKB keymap at all, they just handle
raw keycodes. Emit key events even if no keymap is set.
This commit is contained in:
Simon Ser 2019-11-30 12:17:34 +01:00 committed by Drew DeVault
parent dc6ef658b6
commit 16f22940d9

View file

@ -88,13 +88,13 @@ void wlr_keyboard_notify_modifiers(struct wlr_keyboard *keyboard,
void wlr_keyboard_notify_key(struct wlr_keyboard *keyboard,
struct wlr_event_keyboard_key *event) {
keyboard_key_update(keyboard, event);
wlr_signal_emit_safe(&keyboard->events.key, event);
if (keyboard->xkb_state == NULL) {
return;
}
keyboard_key_update(keyboard, event);
wlr_signal_emit_safe(&keyboard->events.key, event);
if (event->update_state) {
uint32_t keycode = event->keycode + 8;
xkb_state_update_key(keyboard->xkb_state, keycode,