comparison src/w32fns.c @ 15377:65d9ff2c8602

(sync_modifiers): New function. (w32_wnd_proc): Synchronize modifiers on each key down.
author Richard M. Stallman <rms@gnu.org>
date Mon, 10 Jun 1996 17:35:37 +0000
parents 796d825f4444
children 8b01836a6b06
comparison
equal deleted inserted replaced
15376:73d3ebc6aecd 15377:65d9ff2c8602
2777 2777
2778 /* Otherwise, leave the modifier state as it was when Emacs lost 2778 /* Otherwise, leave the modifier state as it was when Emacs lost
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. */
2786 static void
2787 sync_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
2782 static int 2799 static int
2783 modifier_set (int vkey) 2800 modifier_set (int vkey)
2784 { 2801 {
2785 if (vkey == VK_CAPITAL) 2802 if (vkey == VK_CAPITAL)
2786 return (GetKeyState (vkey) & 0x1); 2803 return (GetKeyState (vkey) & 0x1);
2946 record_keyup (wParam, lParam); 2963 record_keyup (wParam, lParam);
2947 goto dflt; 2964 goto dflt;
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);
2954 2974
2955 windows_translate = 0; 2975 windows_translate = 0;