1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-14 09:39:42 +00:00

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.
This commit is contained in:
Eli Zaretskii 2020-11-21 10:14:55 +02:00
parent 32b97bb9e0
commit 86cbc9d216
2 changed files with 21 additions and 2 deletions

View File

@ -48,7 +48,7 @@ skip leading or trailing empty lines of the buffer.
** Tramp
*** The user option 'tramp-completion-reread-directory-timeout' is made obsolete.
*** The user option 'tramp-completion-reread-directory-timeout' is now obsolete.
* New Modes and Packages in Emacs 27.2
@ -62,6 +62,13 @@ skip leading or trailing empty lines of the buffer.
* Changes in Emacs 27.2 on Non-Free Operating Systems
** Emacs now ignores modifier keys when IME input is used.
By default, pressing Ctrl, Shift, and Alt keys while using IME input
will no longer apply the modifiers to the produced characters, as
there are IMEs which use keys with modifiers to input some
characters. Customize the variable 'w32-ignore-modifiers-on-IME-input'
to nil to get back the old behavior.
* Installation Changes in Emacs 27.1

View File

@ -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);