aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/w32fns.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/w32fns.c b/src/w32fns.c
index a2f1ed77d74..e3ad7a8f757 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -2779,6 +2779,23 @@ reset_modifiers ()
2779 keyboard focus. */ 2779 keyboard focus. */
2780} 2780}
2781 2781
2782/* Synchronize modifier state with what is reported with the current
2783 keystroke. Even if we cannot distinguish between left and right
2784 modifier keys, we know that, if no modifiers are set, then neither
2785 the left or right modifier should be set. */
2786static void
2787sync_modifiers ()
2788{
2789 if (!modifiers_recorded)
2790 return;
2791
2792 if (!(GetKeyState (VK_CONTROL) & 0x8000))
2793 modifiers[EMACS_RCONTROL] = modifiers[EMACS_LCONTROL] = 0;
2794
2795 if (!(GetKeyState (VK_MENU) & 0x8000))
2796 modifiers[EMACS_RMENU] = modifiers[EMACS_LMENU] = 0;
2797}
2798
2782static int 2799static int
2783modifier_set (int vkey) 2800modifier_set (int vkey)
2784{ 2801{
@@ -2948,6 +2965,9 @@ win32_wnd_proc (hwnd, msg, wParam, lParam)
2948 2965
2949 case WM_KEYDOWN: 2966 case WM_KEYDOWN:
2950 case WM_SYSKEYDOWN: 2967 case WM_SYSKEYDOWN:
2968 /* Synchronize modifiers with current keystroke. */
2969 sync_modifiers ();
2970
2951 record_keydown (wParam, lParam); 2971 record_keydown (wParam, lParam);
2952 2972
2953 wParam = map_keypad_keys (wParam, lParam); 2973 wParam = map_keypad_keys (wParam, lParam);