Subject: [PATCH] Ignore modifiers when processing WM_IME_CHAR messages

From: tsuucat <[email-masked]>
Date: Sun, 15 Nov 2020 01:58:34 +0900

Current Emacs for Windows recognizes modifier keys even when inputting
with IME. Some IMEs use modifier keys to input characters, so this
causes inconvenient for such IME users.

Example: Microsoft IME (Japanese input method)
If I type Ctrl+m to input こんにちは, I get C-こ C-ん C-に C-ち C-は
in Emacs.

This patch ignores modifier keys when processing WM_IME_CHAR
messages. This patch is not intended to introduce Windows specific
behavior; X build already ignores modifier keys when processing inputs
via XIM.

src/xterm.c:
...
              nbytes = XmbLookupString (FRAME_XIC (f),
                                        &xkey, (char *) copy_bufptr,
                                        copy_bufsiz, &keysym,
                                        &status_return);
...
              else if (status_return == XLookupChars)
                {
                  keysym = NoSymbol;
                  modifiers = 0;
                }
...

--
tsuucat