Subject: bug#10299: Emacs doesn't handle Unicode characters in keyboard layout on MS Windows

From: Eli Zaretskii <[email-masked]>
Date: Thu, 15 Dec 2011 12:52:14 +0200

> Date: Thu, 15 Dec 2011 08:53:15 +0100
> From: Joakim Hårsman <[email-masked]>
> Cc: [email-masked], [email-masked], [email-masked]
> 
> I really don't know my way around the Emacs source, but a quick look
> at w32_kbd_patch_key in w32inevt.c seems to indicate that Emacs really
> is decoding the Unicode character event correctly, both
> uChar.UnicodeChar and uChar.AsciiChar seem to be set correctly.
> [...]
> However, this bit from w32_wnd_proc in w32fns.c looks suspicious to me:
> [...]
> It looks like it's re-posting the event with just the Ascii key code,
> clobbering the Unicode info that's originally in wParam.

I'd begin by establishing what kind of message Emacs gets when you
type a key created by MKLC.  It could be WM_KEYDOWN, but it could also
be something else, like WM_UNICHAR.

Can you find that out, either with a debugger or with some other tool?
If you can, please show the parameters of the message sent to Emacs.
Then we can continue tracing the code execution from there.

Note that Emacs has a separate thread that reads the Windows events,
and that thread then passes the events to the main thread, where the
event undergoes several levels of processing.  It's a complicated
issue, so we had better established from the get-go what kind of input
are we processing.