aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2020-11-21 10:14:55 +0200
committerEli Zaretskii2020-11-21 10:14:55 +0200
commit86cbc9d216c724e6be5db27fb33df2ca0c7d9804 (patch)
treeeab69db320484877da47356a6bf01ae9f825e3f1
parent32b97bb9e0d91522a76c984b594be35343bf9fe3 (diff)
downloademacs-86cbc9d216c724e6be5db27fb33df2ca0c7d9804.tar.gz
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.
-rw-r--r--etc/NEWS9
-rw-r--r--src/w32fns.c14
2 files changed, 21 insertions, 2 deletions
diff --git a/etc/NEWS b/etc/NEWS
index 61f9c0e1fe2..4855cd3b61d 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -48,7 +48,7 @@ skip leading or trailing empty lines of the buffer.
48 48
49** Tramp 49** Tramp
50 50
51*** The user option 'tramp-completion-reread-directory-timeout' is made obsolete. 51*** The user option 'tramp-completion-reread-directory-timeout' is now obsolete.
52 52
53 53
54* New Modes and Packages in Emacs 27.2 54* New Modes and Packages in Emacs 27.2
@@ -62,6 +62,13 @@ skip leading or trailing empty lines of the buffer.
62 62
63* Changes in Emacs 27.2 on Non-Free Operating Systems 63* Changes in Emacs 27.2 on Non-Free Operating Systems
64 64
65** Emacs now ignores modifier keys when IME input is used.
66By default, pressing Ctrl, Shift, and Alt keys while using IME input
67will no longer apply the modifiers to the produced characters, as
68there are IMEs which use keys with modifiers to input some
69characters. Customize the variable 'w32-ignore-modifiers-on-IME-input'
70to nil to get back the old behavior.
71
65 72
66* Installation Changes in Emacs 27.1 73* Installation Changes in Emacs 27.1
67 74
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)
4576 int size, i; 4576 int size, i;
4577 W32Msg wmsg; 4577 W32Msg wmsg;
4578 HIMC context = get_ime_context_fn (hwnd); 4578 HIMC context = get_ime_context_fn (hwnd);
4579 wmsg.dwModifiers = 0; 4579 wmsg.dwModifiers =
4580 w32_ignore_modifiers_on_IME_input
4581 ? 0
4582 : w32_get_key_modifiers (wParam, lParam);
4580 /* Get buffer size. */ 4583 /* Get buffer size. */
4581 size = get_composition_string_fn (context, GCS_RESULTSTR, NULL, 0); 4584 size = get_composition_string_fn (context, GCS_RESULTSTR, NULL, 0);
4582 buffer = alloca (size); 4585 buffer = alloca (size);
@@ -10697,6 +10700,15 @@ tip frame. */);
10697 doc: /* Non-nil means don't display the abort dialog when aborting. */); 10700 doc: /* Non-nil means don't display the abort dialog when aborting. */);
10698 w32_disable_abort_dialog = 0; 10701 w32_disable_abort_dialog = 0;
10699 10702
10703 DEFVAR_BOOL ("w32-ignore-modifiers-on-IME-input",
10704 w32_ignore_modifiers_on_IME_input,
10705 doc: /* Whether to ignore modifier keys when processing input with IME.
10706Some MS-Windows input methods use modifier keys such as Ctrl or Alt to input
10707characters, in which case applying the modifiers will change the input.
10708The default value of this variable is therefore t, to ignore modifier
10709keys when IME input is received. */);
10710 w32_ignore_modifiers_on_IME_input = true;
10711
10700#if 0 /* TODO: Port to W32 */ 10712#if 0 /* TODO: Port to W32 */
10701 defsubr (&Sx_change_window_property); 10713 defsubr (&Sx_change_window_property);
10702 defsubr (&Sx_delete_window_property); 10714 defsubr (&Sx_delete_window_property);