help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Unicode input on Windows Emacs: any plans?


From: Ilya Zakharevich
Subject: Re: Unicode input on Windows Emacs: any plans?
Date: Fri, 28 Mar 2014 15:39:02 +0000 (UTC)
User-agent: slrn/pre1.0.0-18 (Linux)

On 2014-03-25, Eli Zaretskii <address@hidden> wrote:
>> P.P.S.  The last time I inspected the source code of Emacs was several
>>      months ago; I could not post before, so maybe my info is
>>      obsolete now.
>
> What version did you look in?

If I can navigate github (and googling for
    emacs 24.3 ToUnicode OR ToUnicodeEx WCHAR
) correctly, ToUnicode(Ex) is used only once,
in w32_kbd_patch_key(), and w32_kbd_patch_key() is used only once, in
w32inevt.c as
  w32_kbd_patch_key (event, -1);

The call with second argument -1 DOES NOT USE ToUnicode(): the
function is CALLED, but its result is immediately converted to the
corresponding result of ToAscii().

=======================================================

On the other hand, an application is not REQUIRED to call ToUnicode();
it may rely on delivery of WM_CHAR instead.  So it looks like what you
call “support of Unicode input” is that in some rare cases, Emacs
calls TranslateMessage() (which enables delivery of WM_CHAR).  (I
cannot still understand the logic of operation; to me, it looks like a
complete mess of special cases…)

This matches my experiments with 24.3: the simplest cases of Unicode
input work, the more complicated ones fail.¹⁾

It IS possible to handle keyboard input on Windows WITHOUT any special
cases.  (See the reference in the original message.)  You cannot
decide what to do with keypress without either calling ToUnicode(), or
inspecting the following WM_CHAR message (may be done by
peaking — after TranslateMessage()).

Ilya

  ¹⁾ See http://k.ilyaz.org/windows/izKeys-visual-maps.html#examples


reply via email to

[Prev in Thread] Current Thread [Next in Thread]