Subject: bug#44641: closed (Re: bug#44641: [PATCH] Ignore modifiers when processing WM_IME_CHAR messages)

From: [email-masked] (GNU bug Tracking System)
Date: Sat, 21 Nov 2020 08:19:02 +0000

Your bug report

#44641: [PATCH] Ignore modifiers when processing WM_IME_CHAR messages

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
44641: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=44641
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#44641: [PATCH] Ignore modifiers when processing WM_IME_CHAR messages
From: Eli Zaretskii <[email-masked]>
To: tsuucat <[email-masked]>
Cc: [email-masked]
Date: Sat, 21 Nov 2020 10:18:36 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

> From: tsuucat <[email-masked]>
> Date: Mon, 16 Nov 2020 12:07:26 +0900
> Cc: [email-masked]
> 
> 
> >> 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.
> > 
> > You say "some IMEs", so I wonder whether ignoring modifier keys for
> > WM_IME_CHAR is always the right thing.  Do you know for sure? is that
> > documented somewhere?  (I'm not an expert on MS-Windows IMEs.)
> 
> I believe this change will not affect other IME users. Other IME users
> simply don't use modifier keys to input multibyte characters. For
> example, Chinese IME users type Space to select and input the
> candidate, but typing Ctrl+Space doesn't mean users select and input
> the candidate (= WM_IME_CHAR messages will not happen). 
> 
> Some Japanese IME users type Ctrl+m or Ctrl+n to select and input the
> candidate and they want to send Ctrl to IME not to Emacs.
> 
> I don't have just the right documentation but this change just follows
> the way X build Emacs does. 

OK, thanks.  I installed your changes on the emacs-27 branch, but I
also added a variable, w32-ignore-modifiers-on-IME-input, that allows
to get back the old behavior, in case the new behavior adversely
effects some use cases.

With that, I'm closing this bug report.

Subject: [PATCH] Ignore modifiers when processing WM_IME_CHAR messages
From: tsuucat <[email-masked]>
To: [email-masked]
Date: Sun, 15 Nov 2020 01:58:34 +0900
List-Id: <debbugs-submit.debbugs.gnu.org>

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