all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#44641: [PATCH] Ignore modifiers when processing WM_IME_CHAR messages
@ 2020-11-14 16:58 tsuucat via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2020-11-14 17:24 ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: tsuucat via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2020-11-14 16:58 UTC (permalink / raw)
  To: 44641

[-- Attachment #1: Type: text/plain, Size: 996 bytes --]

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


[-- Attachment #2: 0001-Ignore-modifiers-when-processing-WM_IME_CHAR-message.patch --]
[-- Type: application/octet-stream, Size: 923 bytes --]

From 431f3d821cfef8fad30d39e0b4e7a31be9d02872 Mon Sep 17 00:00:00 2001
From: Masahiro Nakamura <tsuucat@icloud.com>
Date: Sat, 14 Nov 2020 17:55:16 +0900
Subject: [PATCH] Ignore modifiers when processing WM_IME_CHAR messages

* src/w32fns.c (w32_wnd_proc): Ignore modifiers when processing
WM_IME_CHAR messages.
---
 src/w32fns.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/w32fns.c b/src/w32fns.c
index 7bb96891d0..802ee031e8 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -4448,7 +4448,7 @@ 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 = w32_get_key_modifiers (wParam, lParam);
+	  wmsg.dwModifiers = 0;
 	  /* Get buffer size.  */
 	  size = get_composition_string_fn (context, GCS_RESULTSTR, NULL, 0);
 	  buffer = alloca (size);
-- 
2.27.0


[-- Attachment #3: Type: text/plain, Size: 1 bytes --]

 

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-11-21  8:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-14 16:58 bug#44641: [PATCH] Ignore modifiers when processing WM_IME_CHAR messages tsuucat via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-11-14 17:24 ` Eli Zaretskii
2020-11-16  3:07   ` tsuucat via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-11-21  8:18     ` Eli Zaretskii

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.