From: Ilya Zakharevich <nospam-abuse@ilyaz.org>
To: help-gnu-emacs@gnu.org
Subject: Re: Unicode input on Windows Emacs: any plans?
Date: Fri, 28 Mar 2014 22:08:14 +0000 (UTC) [thread overview]
Message-ID: <lh4rsd$c0t$1@dont-email.me> (raw)
In-Reply-To: mailman.18438.1396028301.10748.help-gnu-emacs@gnu.org
On 2014-03-28, Eli Zaretskii <eliz@gnu.org> wrote:
> No, I meant that the input loop now gets Unicode codepoints on systems
> that support that.
Yes, this is a major simplification!
> More often than not, ToUnicode is not needed.
AFAIU, getting any kind of close-to-correct behaviour requires either
calling TranslateMessage() on all Down/Up events, or calling
ToUnicode() explicitly on all events.
>> This matches my experiments with 24.3: the simplest cases of Unicode
>> input work, the more complicated ones fail.¹⁾
>
> Please report those cases as bugs, and please include all the
> necessary details to reproduce the problems. Thanks.
Too much work… But here is a copy of my notes of today (reading
http://fossies.org/dox/emacs-24.3/w32fns_8c_source.html
).
Ilya
=============================================== lispy_function_keys[] (named non-main-island “unprintable” keys)
http://fossies.org/dox/emacs-24.3/keyboard_8c_source.html (SPACE, ABNT_C1, ABNT_C2 considered “printable”; OK!)
comment may be improved: KEYPAD stuff, actually, comes from the following:
=============================================== map_keypad_keys()
http://fossies.org/dox/emacs-24.3/w32fns_8c_source.html#l02209
=============================================== Logic of TranslateMessage() for non-special-cased keys:
[Basically, all cases when TranslateMessage()
is not called are WRONG!]
Convert numpad-vk to special values near 0x90; (breaks translation, but translation is disabled anyway)
If vk < 0x100 and has Emacs’ key-name: do not translate; (SPACE has no name!)
Otherwise: LCONTROL & RMENU & !user_disabled_this: translate;
Otherwise: has recognized modifiers (except shift and CapsLock): manually translate:
if 'A' … 'Z': ————? WM_CHAR with 'A' … 'Z' or 'a' … 'z';
otherwise: Using only SHIFT/CTRL/ALT/CAPSLOCK modifiers (chiral, and tuned for AltGr too!),
call ToUnicode() (with correct limit on the length of the buffer);
convert to ASCII (with wrong limit on the length of the buffer).
(Should return complete gibberish if output is of length>1:
See ansi_code[2] and no treatment for dead_key > 2)
Post (Windows/Emacs???) messages for the ASCII chars.
Otherwise: translate
=============================================== WM_INPUTLANGCHANGE
Complete nonsense
=============================================== Treatment of WM_CHAR
BUG: The modifiers (Alt/Ctrl) are passed downstream. Ctrl should not
be passed at all (unless the delivered char is in 0..0x20 or 0x7f);
Alt/Win/etc should be passed only if their presence is not changing
the result of ToUnicode() (this requires a non-destructive call of
ToUnicode()).
next prev parent reply other threads:[~2014-03-28 22:08 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-25 15:40 Unicode input on Windows Emacs: any plans? Ilya Zakharevich
2014-03-25 16:25 ` Eli Zaretskii
2014-03-25 18:16 ` Eli Zaretskii
[not found] ` <mailman.18190.1395771430.10748.help-gnu-emacs@gnu.org>
2014-03-28 13:50 ` Ilya Zakharevich
2014-03-28 14:17 ` Ilya Zakharevich
2014-03-28 17:31 ` Eli Zaretskii
[not found] ` <mailman.18437.1396027924.10748.help-gnu-emacs@gnu.org>
2014-03-28 21:57 ` Ilya Zakharevich
2014-03-29 7:03 ` Eli Zaretskii
[not found] ` <mailman.18472.1396076654.10748.help-gnu-emacs@gnu.org>
2014-03-29 14:28 ` Ilya Zakharevich
[not found] ` <mailman.18175.1395766786.10748.help-gnu-emacs@gnu.org>
2014-03-28 14:15 ` Ilya Zakharevich
2014-03-28 15:39 ` Ilya Zakharevich
2014-03-28 17:38 ` Eli Zaretskii
[not found] ` <mailman.18438.1396028301.10748.help-gnu-emacs@gnu.org>
2014-03-28 22:08 ` Ilya Zakharevich [this message]
2014-03-29 7:06 ` Eli Zaretskii
2014-03-28 22:12 ` Ilya Zakharevich
2014-03-29 7:09 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='lh4rsd$c0t$1@dont-email.me' \
--to=nospam-abuse@ilyaz.org \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).