From 7cd0d6a35130114fb22facdb4e58b65ddadfba04 Mon Sep 17 00:00:00 2001 From: dijunkun Date: Sun, 26 Jul 2026 18:11:41 +0800 Subject: [PATCH] fix: support SDL keyboard auto-repeat --- src/gui/application/sdl_events.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/gui/application/sdl_events.cpp b/src/gui/application/sdl_events.cpp index 4346e25..4da2cb6 100644 --- a/src/gui/application/sdl_events.cpp +++ b/src/gui/application/sdl_events.cpp @@ -220,10 +220,8 @@ int GuiApplication::ProcessKeyboardEvent(const SDL_Event &event) { return -1; } - if (event.type == SDL_EVENT_KEY_DOWN && event.key.repeat) { - return 0; - } - + // SDL represents key auto-repeat as additional key-down events. Forward + // them so the fallback path has the same long-press behavior as native hooks. const int key_code = TranslateSdlKeyboardEventToVk(event.key); if (key_code < 0) { return 0; @@ -412,4 +410,4 @@ int GuiApplication::ProcessMouseEvent(const SDL_Event &event) { return 0; } -} // namespace crossdesk \ No newline at end of file +} // namespace crossdesk