From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: covici@ccs.covici.com Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Override Windows default Win-* key combinations when using Emacs Date: Tue, 12 Jan 2016 10:08:56 -0500 Message-ID: <32755.1452611336@ccs.covici.com> References: <568BBC58.50702@aprikoodi.fi> <83y4c43qkh.fsf@gnu.org> <5691667C.5000009@aprikoodi.fi> <838u3wkkvb.fsf@gnu.org> <5694E07E.8010005@aprikoodi.fi> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1452611364 349 80.91.229.3 (12 Jan 2016 15:09:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 12 Jan 2016 15:09:24 +0000 (UTC) Cc: Eli Zaretskii , emacs-devel@gnu.org To: Jussi Lahdenniemi Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jan 12 16:09:20 2016 Return-path: Envelope-to: ged-emacs-devel@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 1aJ0ZT-0001GV-GH for ged-emacs-devel@m.gmane.org; Tue, 12 Jan 2016 16:09:19 +0100 Original-Received: from localhost ([::1]:60830 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aJ0ZS-0005gc-PZ for ged-emacs-devel@m.gmane.org; Tue, 12 Jan 2016 10:09:18 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51642) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aJ0ZO-0005f5-A9 for emacs-devel@gnu.org; Tue, 12 Jan 2016 10:09:16 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aJ0ZM-0002H1-Uy for emacs-devel@gnu.org; Tue, 12 Jan 2016 10:09:14 -0500 Original-Received: from mail0200.smtp25.com ([174.37.170.200]:33035) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aJ0ZI-0002DZ-NV; Tue, 12 Jan 2016 10:09:08 -0500 Original-Received: from ccs.covici.com (localhost [127.0.0.1]) by ccs.covici.com (8.14.9/8.14.8) with ESMTP id u0CF8uNC032756; Tue, 12 Jan 2016 10:08:57 -0500 In-reply-to: <5694E07E.8010005@aprikoodi.fi> Comments: In-reply-to Jussi Lahdenniemi message dated "Tue, 12 Jan 2016 13:16:14 +0200." X-Mailer: MH-E 8.5; nmh 1.6; GNU Emacs 23.4.1 Content-ID: <32754.1452611336.1@ccs.covici.com> X-SpamH-OriginatingIP: 70.109.53.110 X-SpamH-Filter: s-out-001.smtp25.com-u0CF8vsS030727 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 174.37.170.200 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:198076 Archived-At: Jussi Lahdenniemi wrote: > >> The patch is attached. I decided to place the new functionality in a = new > >> file (w32hook.c) - it could have been added to some existing file as = well. > > > > I'd prefer not to create a new file, but to have this in w32fns.c. It > > might even allow you to make some functions static. > = > OK. > = > >> -@findex w32-register-hot-key > >> -@findex w32-unregister-hot-key > >> - MS-Windows reserves certain key combinations, such as > > > > I'm not sure I understand why you moved this stuff down in the file. > > Was something wrong with its original place? You could make the > > changes without moving the stuff, no? > = > In the documentation for w32-register-hot-key I am now referring to > the w32-[lr]window-modifier variables; there is a strongish dependency > between these now. For this reason, I preferred documenting the > w32-*-hot-key functions after the w32-*-modifier part. But of course, > this is not a must. > = > >> + The hotkey registrations always also include all the shift and > >> +control modifier combinations for the given hotkey; that is, > >> +registering @kbd{s-@key{a}} as a hotkey gives you @kbd{s-@key{A}}, > >> +@kbd{C-s-@key{a}} and @kbd{C-s-@key{A}} as well. > > > > I believe you meant to use "C-S-" etc. here, for the Shift key (not > > "super"). > = > No, what I mean is that registering s-a also registers S-s-a, C-s-a, > and C-S-s-a. I wrote S-*-a as *-A in that documentation, base on the > observation that for example C-h k M-S-a is shown as M-A by Emacs. But > maybe it would be better to write a lower-case a and explicit S > modifier in all the cases? > = > >> - if (NUMBERP (Vw32_phantom_key_code)) > >> - key =3D XUINT (Vw32_phantom_key_code) & 255; > >> - else > >> - key =3D VK_SPACE; > > > > It looks like you are removing the support for this feature. Is it > > really not needed anymore? If so, we should mention this change in > > NEWS, and tell there how to achieve the same effect without this > > variable. > = > True. I have never used the w32-phantom-key-code myself, so I did not > notice that (and, actually, the variable is still checked - = > unnecessarily - in w32inevt.c). But, setting > w32-pass-[lr]window-to-system to NIL has now the desired effect even > without the use of a phantom key code; the keypress is routed directly > from the hook function to the Emacs input handler, without passing > through the standard system keyboard functionality inbetween, which > eliminates the need to lie to the system about the key that has been > pressed. > = > > I've briefly reviewed the rest of the patch, and it looks OK to me. > > Did you make sure the new code doesn't call any API that might be > > unavailable on older systems? We still support Windows 98 and later. > = > Unfortunately, Windows 98 does not include the low-level keyboard hook > functionality that is essential for my code to work. It is supported > in Windows 2000 (and even NT4, apparently), but not on the 95/98/ME > branch. > = > So, probably I would need to change the code so that the old > functionality is preserved and used if the new API are not available > (pre-Win2000), in the same style that w32uniscribe works? It should > still even be possible to write a single configuration file that works > on both environments. > = > > Also, I understand that this code will work on versions of Windows > > before v8, is that right? > = > I have tested the code on Windows 10 (my physical PC) and Windows 7 > (in a VM) both as 32-bit and 64-bit versions. I'll try to get Win2000 > installed on another VM as well and test with it, just to be sure. > = > -- = > Jussi Lahdenniemi I have a screen reader which is also doing keyboard coding at the low level, I wonder if this patch would effect that program? Also, I hope you don't hijack alt-tab, that is necessary even when emacs is running. -- = Your life is like a penny. You're going to lose it. The question is: How do you spend it? John Covici covici@ccs.covici.com