[PATCH 0/2] MR7606: user32/edit: Block key input when mouse input is captured.
From: Nikolay Sivov <nsivov(a)codeweavers.com> Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56108 --- dlls/user32/edit.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dlls/user32/edit.c b/dlls/user32/edit.c index 4c300730acb..c762cac55e9 100644 --- a/dlls/user32/edit.c +++ b/dlls/user32/edit.c @@ -3178,6 +3178,9 @@ static LRESULT EDIT_WM_Char(EDITSTATE *es, WCHAR c) { BOOL control; + if (es->bCaptureState) + return 0; + control = NtUserGetKeyState(VK_CONTROL) & 0x8000; switch (c) { @@ -3450,6 +3453,9 @@ static LRESULT EDIT_WM_KeyDown(EDITSTATE *es, INT key) BOOL shift; BOOL control; + if (es->bCaptureState) + return 0; + if (NtUserGetKeyState(VK_MENU) & 0x8000) return 0; -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/7606
From: Nikolay Sivov <nsivov(a)codeweavers.com> Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56108 --- dlls/comctl32/edit.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dlls/comctl32/edit.c b/dlls/comctl32/edit.c index e57f3d328d1..d7f387fd342 100644 --- a/dlls/comctl32/edit.c +++ b/dlls/comctl32/edit.c @@ -3028,6 +3028,9 @@ static LRESULT EDIT_WM_Char(EDITSTATE *es, WCHAR c) { BOOL control; + if (es->bCaptureState) + return 0; + control = GetKeyState(VK_CONTROL) & 0x8000; switch (c) { @@ -3284,6 +3287,9 @@ static LRESULT EDIT_WM_KeyDown(EDITSTATE *es, INT key) BOOL shift; BOOL control; + if (es->bCaptureState) + return 0; + if (GetKeyState(VK_MENU) & 0x8000) return 0; -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/7606
Zhiyi Zhang (@zhiyi) commented about dlls/comctl32/edit.c:
{ BOOL control;
+ if (es->bCaptureState) + return 0; Hi, the return value for WM_CHAR and WM_KEYDOWN in these cases is 1 according to manual tests.
``` while (1) { POINT pt; HWND hwnd; char class_name[80] = {0}; LRESULT lr, lr2; GetCursorPos(&pt); hwnd = WindowFromPoint(pt); GetClassNameA(hwnd, class_name, sizeof(class_name)); lr = SendMessageA(hwnd, WM_CHAR, 'A', 0); lr2 = SendMessageA(hwnd, WM_KEYDOWN, VK_SPACE, 0); printf("hwnd %p class name %s lr %#x lr2 %#x.\n", hwnd, class_name, lr, lr2); Sleep(500); } return 0; ``` -- https://gitlab.winehq.org/wine/wine/-/merge_requests/7606#note_98236
participants (3)
-
Nikolay Sivov -
Nikolay Sivov (@nsivov) -
Zhiyi Zhang (@zhiyi)