From: Ilya Zakharevich <ilya@math.berkeley.edu>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 19994@debbugs.gnu.org
Subject: bug#19994: 25.0.50; Unicode keyboard input on Windows
Date: Thu, 5 Mar 2015 16:43:32 -0800 [thread overview]
Message-ID: <20150306004332.GA4927@math.berkeley.edu> (raw)
In-Reply-To: <83bnk8prqa.fsf@gnu.org>
On Wed, Mar 04, 2015 at 08:01:01PM +0200, Eli Zaretskii wrote:
> > +static int
> > +get_wm_chars (HWND aWnd, int *buf, int buflen, int ignore_ctrl, int ctrl, int
> ^^^^^^^^
> Why 'int' and not 'wchar_t'?
This is for a Unicode chars. They won’t fit into (Windows’ style) wchar_t.
> > + while (buflen && /* Should be called only when w32_unicode_gui */
> > + PeekMessageW(&msg, aWnd, WM_KEYFIRST, WM_KEYLAST, PM_NOREMOVE | PM_NOYIELD) &&
>
> Indeed, any "wide" APIs should only be called when w32_unicode_gui is
> on, and there should be alternative code for when w32_unicode_gui is
> off. We still try to support Windows 9X.
The caller ensures this. Yes, assert() would be beneficial here.
> > + int ctrl_cnt, buf[1024], count, is_dead;
>
> I think buf[] should be an array of wchar_t. Also, will this code
> work for the non-w32_unicode_gui mode?
This code is pure-GUI. For non-GUI “bindable” input on Windows the
major hurdle is that
(A) I know no way to distinguish a “prefix key” (deadkey) keypress
from a keypress which should trigger user bindings;
(B) with “non-destructive ToUnicode()”, one WOULD be able to
distinguish these two cases, — but I have no clue how to find
out the current keyboard layout of a console session.
(There is a lot of examples of code which returns the keyboard
layout of a window; — but these examples do not work for
console sessions. I suppose that the reason is that the window
is actually owned by a system process, and one does not have
permissions to access its properties.)
Thanks,
Ilya
next prev parent reply other threads:[~2015-03-06 0:43 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-03 23:09 bug#19994: 25.0.50; Unicode keyboard input on Windows Ilya Zakharevich
2015-03-04 18:01 ` Eli Zaretskii
2015-03-06 0:43 ` Ilya Zakharevich [this message]
2015-03-06 10:52 ` Eli Zaretskii
2015-03-06 11:40 ` Ilya Zakharevich
2015-03-06 14:00 ` Eli Zaretskii
2015-07-01 10:07 ` Ilya Zakharevich
2015-07-09 0:02 ` Ilya Zakharevich
2015-07-31 9:23 ` Eli Zaretskii
2015-08-01 7:40 ` Eli Zaretskii
2015-08-02 14:42 ` Eli Zaretskii
2020-08-12 16:32 ` Stefan Kangas
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150306004332.GA4927@math.berkeley.edu \
--to=ilya@math.berkeley.edu \
--cc=19994@debbugs.gnu.org \
--cc=eliz@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.
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.