Module: wine Branch: master Commit: 7a25bd885e52cd176cee4dceeaf88607eaa13ec9 URL: https://gitlab.winehq.org/wine/wine/-/commit/7a25bd885e52cd176cee4dceeaf8860...
Author: Alexandros Frantzis alexandros.frantzis@collabora.com Date: Fri Mar 15 13:59:52 2024 +0200
win32u: Cancel auto-repeat only if the repeat key is released.
This fixes the behavior to match other systems, where releasing an unrelated key does not affect the repeating key.
---
dlls/win32u/message.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/dlls/win32u/message.c b/dlls/win32u/message.c index f7f751ef883..417f67452d7 100644 --- a/dlls/win32u/message.c +++ b/dlls/win32u/message.c @@ -2433,7 +2433,9 @@ static BOOL process_keyboard_message( MSG *msg, UINT hw_id, HWND hwnd_filter,
case WM_KEYUP: case WM_SYSKEYUP: - kill_system_timer( thread_info->key_repeat_msg.hwnd, SYSTEM_TIMER_KEY_REPEAT ); + /* Only stop repeat if the scan codes match. */ + if ((thread_info->key_repeat_msg.lParam & 0x01ff0000) == (msg->lParam & 0x01ff0000)) + kill_system_timer( thread_info->key_repeat_msg.hwnd, SYSTEM_TIMER_KEY_REPEAT ); break; } }