GNU bug report logs - #14794
24.3.50; `w32-register-hot-key' does not work on Windows 7 64-bit

Previous Next

Package: emacs;

Reported by: Drew Adams <drew.adams <at> oracle.com>

Date: Thu, 4 Jul 2013 21:11:02 UTC

Severity: minor

Found in version 24.3.50

Fixed in version 26.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 14794 <at> debbugs.gnu.org
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
> Date: Wed, 10 Jul 2013 15:28:37 -0700 (PDT)
> From: Drew Adams <drew.adams <at> oracle.com>
> Cc: 14794 <at> 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?




This bug report was last modified 3 years and 87 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.