From 4cce35824192e855cfda949259cbd149a2165570 Mon Sep 17 00:00:00 2001 From: bruvzg <7645683+bruvzg@users.noreply.github.com> Date: Mon, 6 Mar 2023 10:31:23 +0200 Subject: [Windows] Update modifier key status during IME input. (cherry picked from commit ba995c6ea1aa7f7eaff4e5d6673c7d6a096011dc) --- platform/windows/display_server_windows.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'platform') diff --git a/platform/windows/display_server_windows.cpp b/platform/windows/display_server_windows.cpp index 92af3fef69..360e446de7 100644 --- a/platform/windows/display_server_windows.cpp +++ b/platform/windows/display_server_windows.cpp @@ -3404,16 +3404,8 @@ LRESULT DisplayServerWindows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARA } break; case WM_SYSKEYUP: case WM_KEYUP: - if (windows[window_id].ime_suppress_next_keyup) { - windows[window_id].ime_suppress_next_keyup = false; - break; - } - [[fallthrough]]; case WM_SYSKEYDOWN: case WM_KEYDOWN: { - if (windows[window_id].ime_in_progress) { - break; - } if (wParam == VK_SHIFT) { shift_mem = (uMsg == WM_KEYDOWN || uMsg == WM_SYSKEYDOWN); } @@ -3426,6 +3418,17 @@ LRESULT DisplayServerWindows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARA gr_mem = alt_mem; } } + if (wParam == VK_LWIN || wParam == VK_RWIN) { + meta_mem = (uMsg == WM_KEYDOWN || uMsg == WM_SYSKEYDOWN); + } + + if (windows[window_id].ime_suppress_next_keyup && (uMsg == WM_KEYUP || uMsg == WM_SYSKEYUP)) { + windows[window_id].ime_suppress_next_keyup = false; + break; + } + if (windows[window_id].ime_in_progress) { + break; + } if (mouse_mode == MOUSE_MODE_CAPTURED) { // When SetCapture is used, ALT+F4 hotkey is ignored by Windows, so handle it ourselves -- cgit v1.2.3