diff options
| author | Richard M. Stallman | 1996-06-10 17:35:37 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1996-06-10 17:35:37 +0000 |
| commit | 7830e24b1e974f802e494928a76798a108b14899 (patch) | |
| tree | 6e2045ba55e95a22d7730d46540a9dee87c69594 /src | |
| parent | 0cd6403b4bc20403394a8aab202ea485ead728c5 (diff) | |
| download | emacs-7830e24b1e974f802e494928a76798a108b14899.tar.gz emacs-7830e24b1e974f802e494928a76798a108b14899.zip | |
(sync_modifiers): New function.
(w32_wnd_proc): Synchronize modifiers on each key down.
Diffstat (limited to 'src')
| -rw-r--r-- | src/w32fns.c | 20 |
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. */ | ||
| 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 | { |
| @@ -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); |