diff options
author | Eli Zaretskii <eliz@gnu.org> | 2020-11-21 10:14:55 +0200 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2020-11-21 10:14:55 +0200 |
commit | 86cbc9d216c724e6be5db27fb33df2ca0c7d9804 (patch) | |
tree | eab69db320484877da47356a6bf01ae9f825e3f1 /src/w32fns.c | |
parent | 32b97bb9e0d91522a76c984b594be35343bf9fe3 (diff) | |
download | emacs-86cbc9d216c724e6be5db27fb33df2ca0c7d9804.tar.gz emacs-86cbc9d216c724e6be5db27fb33df2ca0c7d9804.tar.bz2 emacs-86cbc9d216c724e6be5db27fb33df2ca0c7d9804.zip |
Make ignoring modifiers on IME input optional
By default, ignore modifier keys on IME input, but add
a variable to get back old behavior.
* src/w32fns.c (syms_of_w32fns): New variable
w32-ignore-modifiers-on-IME-input.
(w32_wnd_proc): Use it to ignore modifier keys when IME input is
used. (Bug#44641)
* etc/NEWS: Announce the change and the new variable.
Diffstat (limited to 'src/w32fns.c')
-rw-r--r-- | src/w32fns.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/w32fns.c b/src/w32fns.c index 96cf34430d4..fd13a958651 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -4576,7 +4576,10 @@ w32_wnd_proc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) int size, i; W32Msg wmsg; HIMC context = get_ime_context_fn (hwnd); - wmsg.dwModifiers = 0; + wmsg.dwModifiers = + w32_ignore_modifiers_on_IME_input + ? 0 + : w32_get_key_modifiers (wParam, lParam); /* Get buffer size. */ size = get_composition_string_fn (context, GCS_RESULTSTR, NULL, 0); buffer = alloca (size); @@ -10697,6 +10700,15 @@ tip frame. */); doc: /* Non-nil means don't display the abort dialog when aborting. */); w32_disable_abort_dialog = 0; + DEFVAR_BOOL ("w32-ignore-modifiers-on-IME-input", + w32_ignore_modifiers_on_IME_input, + doc: /* Whether to ignore modifier keys when processing input with IME. +Some MS-Windows input methods use modifier keys such as Ctrl or Alt to input +characters, in which case applying the modifiers will change the input. +The default value of this variable is therefore t, to ignore modifier +keys when IME input is received. */); + w32_ignore_modifiers_on_IME_input = true; + #if 0 /* TODO: Port to W32 */ defsubr (&Sx_change_window_property); defsubr (&Sx_delete_window_property); |