From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#14794: 24.3.50; `w32-register-hot-key' does not work on Windows 7 64-bit Date: Thu, 11 Jul 2013 19:36:35 +0300 Message-ID: <8361whuk8c.fsf@gnu.org> References: <1bda8371-6234-45f4-a2b8-00ac282f2088@default> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1373560750 19369 80.91.229.3 (11 Jul 2013 16:39:10 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 11 Jul 2013 16:39:10 +0000 (UTC) Cc: 14794@debbugs.gnu.org To: Drew Adams Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jul 11 18:39:09 2013 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 1UxJtd-0006sh-52 for geb-bug-gnu-emacs@m.gmane.org; Thu, 11 Jul 2013 18:39:09 +0200 Original-Received: from localhost ([::1]:38924 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UxJtc-0006eq-PT for geb-bug-gnu-emacs@m.gmane.org; Thu, 11 Jul 2013 12:39:08 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35530) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UxJtY-0006eU-17 for bug-gnu-emacs@gnu.org; Thu, 11 Jul 2013 12:39:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UxJtW-0001dc-OK for bug-gnu-emacs@gnu.org; Thu, 11 Jul 2013 12:39:03 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:53899) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UxJtW-0001dY-Lh for bug-gnu-emacs@gnu.org; Thu, 11 Jul 2013 12:39:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1UxJtW-0003ZN-9X for bug-gnu-emacs@gnu.org; Thu, 11 Jul 2013 12:39:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 11 Jul 2013 16:39:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 14794 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 14794-submit@debbugs.gnu.org id=B14794.137356068813621 (code B ref 14794); Thu, 11 Jul 2013 16:39:01 +0000 Original-Received: (at 14794) by debbugs.gnu.org; 11 Jul 2013 16:38:08 +0000 Original-Received: from localhost ([127.0.0.1]:48213 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1UxJsd-0003Xb-4l for submit@debbugs.gnu.org; Thu, 11 Jul 2013 12:38:07 -0400 Original-Received: from mtaout20.012.net.il ([80.179.55.166]:35138) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1UxJsV-0003Wg-OF for 14794@debbugs.gnu.org; Thu, 11 Jul 2013 12:38:00 -0400 Original-Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0MPS008005UKEK00@a-mtaout20.012.net.il> for 14794@debbugs.gnu.org; Thu, 11 Jul 2013 19:36:46 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MPS007IB655XSC0@a-mtaout20.012.net.il>; Thu, 11 Jul 2013 19:36:42 +0300 (IDT) In-reply-to: <1bda8371-6234-45f4-a2b8-00ac282f2088@default> X-012-Sender: halo1@inter.net.il 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:76233 Archived-At: > Date: Wed, 10 Jul 2013 15:28:37 -0700 (PDT) > From: Drew Adams > Cc: 14794@debbugs.gnu.org > > > > emacs -Q ; but same problem with older Emacs versions > > > > > > (w32-register-hot-key [M-tab]) > > > (w32-register-hot-key [M-S-tab]) > > > > > > Try C-h k M-TAB. Try M-TAB. The key is immediately grabbed by Windows. > > > > Because it is not bound to any command. If you bind it, it will work > > as expected. > > Nope, not as far as I can see. Add this to the recipe: > > (global-set-key [M-tab] 'forward-char) > > Makes no difference. But perhaps you meant something different? > > I'm using Windows 7 64-bit, if that makes a difference. > (And the same code worked fine on Windows XP SP3.) Turns out it does make a difference. This documentation page: http://msdn.microsoft.com/en-us/library/windows/desktop/ms646309%28v=vs.85%29.aspx explicitly says that the behavior of the underlying API has changed since XP: if the hot key is already registered, the API now fails instead of replacing the old registration with the new. And Alt+TAB is hooked by the Windows Explorer. And indeed, on Windows 7 I see that the call to RegisterHotKey API consistently fails with an error code which says "Hot key is already registered". Unless someone knows a way around this (I searched for it, but didn't find any solutions, only complaints), I guess this will remain a "known bug". Does this work for you with other key combinations, btw?