From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ilya Zakharevich Newsgroups: gmane.emacs.bugs Subject: bug#19994: 25.0.50; Unicode keyboard input on Windows Date: Thu, 5 Mar 2015 16:43:32 -0800 Message-ID: <20150306004332.GA4927@math.berkeley.edu> References: <20150303230949.GA29784@math.berkeley.edu> <83bnk8prqa.fsf@gnu.org> 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 1425602666 18063 80.91.229.3 (6 Mar 2015 00:44:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 6 Mar 2015 00:44:26 +0000 (UTC) Cc: 19994@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Mar 06 01:44:13 2015 Return-path: Envelope-to: geb-bug-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 1YTgNA-0008AR-Mj for geb-bug-gnu-emacs@m.gmane.org; Fri, 06 Mar 2015 01:44:12 +0100 Original-Received: from localhost ([::1]:55658 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YTgN9-0002X5-JM for geb-bug-gnu-emacs@m.gmane.org; Thu, 05 Mar 2015 19:44:11 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45482) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YTgN5-0002W9-SJ for bug-gnu-emacs@gnu.org; Thu, 05 Mar 2015 19:44:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YTgN0-0005Xr-SH for bug-gnu-emacs@gnu.org; Thu, 05 Mar 2015 19:44:07 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:38041) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YTgN0-0005Xl-OU for bug-gnu-emacs@gnu.org; Thu, 05 Mar 2015 19:44:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1YTgN0-0006cK-9E for bug-gnu-emacs@gnu.org; Thu, 05 Mar 2015 19:44:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Ilya Zakharevich Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 06 Mar 2015 00:44:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 19994 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 19994-submit@debbugs.gnu.org id=B19994.142560262625403 (code B ref 19994); Fri, 06 Mar 2015 00:44:02 +0000 Original-Received: (at 19994) by debbugs.gnu.org; 6 Mar 2015 00:43:46 +0000 Original-Received: from localhost ([127.0.0.1]:36609 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YTgMj-0006be-9K for submit@debbugs.gnu.org; Thu, 05 Mar 2015 19:43:45 -0500 Original-Received: from nm30-vm1.bullet.mail.gq1.yahoo.com ([98.136.216.192]:40727) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YTgMg-0006bN-AC for 19994@debbugs.gnu.org; Thu, 05 Mar 2015 19:43:43 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1425602615; bh=1wWuBuzCyAc0nXYeo3TH9vOVjB6ZehK/Z85u5blnZ+I=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From:Subject; b=RJE4WjgXiUPQZcsxOhdrJ/jIKzVBJrM+5NPsWWbVNP6/FHk2/sgNPbr83GEMb5zafCSkIolHIKRYQZPi+y/i+Ncc+hR3IP4AxxdeJ1AovfPxGE6Fu9NUxOViDDf6dENbWw/MRyD/DWbRA1ouzHn/RsuDEeRNvjTvp3e5DuqVaqVgOsQp8+5FkI8I1rSuHFpq+hDvFxL4osqqVFYCBupkP3zCc1O8QxoJ+9g0ZARR58kGDtVMZW30BdDbY1Gj2Ypt5nDbHtIxogbltlzFg4+L+CaVAOPypvHcxWSY8FbcXCFj++8dlyty0MjankHe3PTfqVURaD4t/2bpRf1ckzo+0g== Original-Received: from [98.137.12.55] by nm30.bullet.mail.gq1.yahoo.com with NNFMP; 06 Mar 2015 00:43:35 -0000 Original-Received: from [208.71.42.198] by tm15.bullet.mail.gq1.yahoo.com with NNFMP; 06 Mar 2015 00:43:35 -0000 Original-Received: from [127.0.0.1] by smtp209.mail.gq1.yahoo.com with NNFMP; 06 Mar 2015 00:43:35 -0000 X-Yahoo-Newman-Id: 923722.36833.bm@smtp209.mail.gq1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: vVYvBuEVM1k3P0ZMmhsjxbHnWhDopb.Di2VgOEZZp9Kmbsk rSo_fVqZQZotfWqSFQS61JI4T6IkNldYtBr.6AeVX50BlQYz8YSmBIOXZhkk AoBKizvWRFM_sP3dqDS7SGthJhmGiLblbEaFBli_pZQLgfw7i2.ZKUjWiml9 l_BATwabZxva1Y5FH_K6clokGXw2Px0FWMRL7aScUf09FX8W11Gum4d0mk0z DytNf1gJ52KOmm8p_NU2xJDrAQyc7Sc.SBrfcVRZl.JdjXMm75JvTCp9.b3W .zDaGLMIxi5viCDD2wbTN7DPVAdppquU7_9R_gmMSX0M7vlQhryCaR5LuHoV YJtCqf8C0cBdqKvwNuvccEZPcG4oG1F6I.PiZTL9mN3ON8DCOaJTPzvxuX68 Fd71ozSzrxkMOrWnJzOwQWG6X.dhLo23cwDrgeE9tB8lmOd7isxbksYPjt5T XOxopRbkqNqQKCyOxikeQaenj4Pk7egNo52aWcfxtIWo6_9D4.zXuYCvqxhU whIRZ4k4DChHbjNtCmATW7KlJDCDmvPAkikrTauTZ1M9JYxHE4aY- X-Yahoo-SMTP: oLSY3dWswBBqoBVzCkLl_RIsw6heKMxu8wpEbARv1SU- Content-Disposition: inline In-Reply-To: <83bnk8prqa.fsf@gnu.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:100122 Archived-At: 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