From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ilya Zakharevich Newsgroups: gmane.emacs.help Subject: Re: Unicode input on Windows Emacs: any plans? Date: Fri, 28 Mar 2014 15:39:02 +0000 (UTC) Organization: A noiseless patient Spider Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1396021210 4943 80.91.229.3 (28 Mar 2014 15:40:10 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 28 Mar 2014 15:40:10 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Mar 28 16:40:21 2014 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WTYtH-0005zd-7D for geh-help-gnu-emacs@m.gmane.org; Fri, 28 Mar 2014 16:40:19 +0100 Original-Received: from localhost ([::1]:34251 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WTYtG-0002gm-Os for geh-help-gnu-emacs@m.gmane.org; Fri, 28 Mar 2014 11:40:18 -0400 Original-Path: usenet.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!rt.uk.eu.org!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 39 Injection-Date: Fri, 28 Mar 2014 15:39:02 +0000 (UTC) Injection-Info: mx05.eternal-september.org; posting-host="06ab0fed6ae52f560e1f8417db1ec81f"; logging-data="23517"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18qQmfPJ1mvFkzT4DHH/q6f" User-Agent: slrn/pre1.0.0-18 (Linux) Cancel-Lock: sha1:hmZqD4NWteFLdZ3TlPb1TBLt1B8= Original-Xref: usenet.stanford.edu gnu.emacs.help:204545 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:96814 Archived-At: On 2014-03-25, Eli Zaretskii 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