From e54c704628110dfedae1964b400cd976d7842507 Mon Sep 17 00:00:00 2001 From: Jan Hendrik Farr Date: Fri, 31 May 2024 01:42:53 +0200 Subject: [PATCH] Wayland: Fix key repeat Key repeat shoud only be interrupted when the repeating key is released, not when another key is released. --- src/wl_window.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/wl_window.c b/src/wl_window.c index 2e842aaa..ad0c6449 100644 --- a/src/wl_window.c +++ b/src/wl_window.c @@ -1796,11 +1796,12 @@ static void keyboardHandleKey(void* userData, timer.it_value.tv_sec = _glfw.wl.keyRepeatDelay / 1000; timer.it_value.tv_nsec = (_glfw.wl.keyRepeatDelay % 1000) * 1000000; + timerfd_settime(_glfw.wl.keyRepeatTimerfd, 0, &timer, NULL); } + } else if (scancode == _glfw.wl.keyRepeatScancode) { + timerfd_settime(_glfw.wl.keyRepeatTimerfd, 0, &timer, NULL); } - timerfd_settime(_glfw.wl.keyRepeatTimerfd, 0, &timer, NULL); - _glfwInputKey(window, key, scancode, action, _glfw.wl.xkb.modifiers); if (action == GLFW_PRESS)