summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/video/win32_v.cpp37
1 files changed, 17 insertions, 20 deletions
diff --git a/src/video/win32_v.cpp b/src/video/win32_v.cpp
index 1b3476dab..b4d3946ea 100644
--- a/src/video/win32_v.cpp
+++ b/src/video/win32_v.cpp
@@ -552,14 +552,6 @@ LRESULT CALLBACK WndProcGdi(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
uint scancode = GB(lParam, 16, 8);
keycode = scancode == 41 ? (uint)WKC_BACKQUOTE : MapWindowsKey(wParam);
- /* Silently drop all messages handled by WM_CHAR. */
- MSG msg;
- if (PeekMessage(&msg, nullptr, 0, 0, PM_NOREMOVE)) {
- if ((msg.message == WM_CHAR || msg.message == WM_DEADCHAR) && GB(lParam, 16, 8) == GB(msg.lParam, 16, 8)) {
- return 0;
- }
- }
-
uint charcode = MapVirtualKey(wParam, MAPVK_VK_TO_CHAR);
/* No character translation? */
@@ -568,21 +560,26 @@ LRESULT CALLBACK WndProcGdi(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
return 0;
}
- /* Is the console key a dead key? If yes, ignore the first key down event. */
- if (HasBit(charcode, 31) && !console) {
- if (scancode == 41) {
- console = true;
- return 0;
+ /* If an edit box is in focus, wait for the corresponding WM_CHAR message. */
+ if (!EditBoxInGlobalFocus()) {
+ /* Is the console key a dead key? If yes, ignore the first key down event. */
+ if (HasBit(charcode, 31) && !console) {
+ if (scancode == 41) {
+ console = true;
+ return 0;
+ }
}
- }
- console = false;
+ console = false;
- /* IMEs and other input methods sometimes send a WM_CHAR without a WM_KEYDOWN,
- * clear the keycode so a previous WM_KEYDOWN doesn't become 'stuck'. */
- uint cur_keycode = keycode;
- keycode = 0;
+ /* IMEs and other input methods sometimes send a WM_CHAR without a WM_KEYDOWN,
+ * clear the keycode so a previous WM_KEYDOWN doesn't become 'stuck'. */
+ uint cur_keycode = keycode;
+ keycode = 0;
- return HandleCharMsg(cur_keycode, LOWORD(charcode));
+ return HandleCharMsg(cur_keycode, LOWORD(charcode));
+ }
+
+ return 0;
}
case WM_SYSKEYDOWN: // user presses F10 or Alt, both activating the title-menu