fix: support SDL keyboard auto-repeat

This commit is contained in:
dijunkun
2026-07-26 18:11:41 +08:00
parent c01b52eac5
commit 7cd0d6a351
+3 -5
View File
@@ -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
} // namespace crossdesk