From cd942ad12d9d2030963e3dd5fbfe2d181013c750 Mon Sep 17 00:00:00 2001 From: Vaxry Date: Thu, 25 Jul 2024 13:10:53 +0200 Subject: [PATCH] keyboard: update xkb state after key event fixes #6946 --- src/devices/Keyboard.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/devices/Keyboard.cpp b/src/devices/Keyboard.cpp index ae28c07d..0a8f6b57 100644 --- a/src/devices/Keyboard.cpp +++ b/src/devices/Keyboard.cpp @@ -32,13 +32,13 @@ CKeyboard::CKeyboard(SP keeb) : keyboard(keeb) { listeners.key = keeb->events.key.registerListener([this](std::any d) { auto E = std::any_cast(d); - updateXkbStateWithKey(E.key + 8, E.pressed); - keyboardEvents.key.emit(SKeyEvent{ .timeMs = E.timeMs, .keycode = E.key, .state = E.pressed ? WL_KEYBOARD_KEY_STATE_PRESSED : WL_KEYBOARD_KEY_STATE_RELEASED, }); + + updateXkbStateWithKey(E.key + 8, E.pressed); }); listeners.modifiers = keeb->events.modifiers.registerListener([this](std::any d) {