Disable (unbind) default Win+Arrows hotkeys to make them usable in other applications

9

2

On Windows 7 I'd like to unbind the default Win+Up/Down/Left/Right so that these can be bound directly* in other applications. How can this be done?

These hotkeys can easily be disabled by:

  1. Going to Ease of Access Center,
  2. selecting Make the keyboard easier to use, and
  3. Checking Prevent windows from being automatically arranged when moved to the edge of the screen:

    Setting

But even when using this setting and having the hotkeys disabled (they do nothing) the hotkeys still can't be bound in other applications.


I have tried the following ways and none of these work:

  1. Making the above change in Ease of Access Center
  2. Enabling policy Turn off Windows+X hotkeys, which is the same as setting: HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoWinKeys to 1. (With this setting alone the hotkeys in question still work as usual.)
  3. Disabling the windows key as described in KB216893 by setting System\CurrentControlSet\Control\Keyboard Layout\Scancode Map. This disables the windows key completely so that it cannot be bound or used anywhere.
  4. Enabling policy Turn off Windows Mobility Center


Some googling revealed this post:

the Win+Arrow key combinations are one of several (along with Win+P, Win+U and Win+L) that are somehow “super-registered/reserved” in Windows 7. I’ve been trying to track down where and when they get reserved, but have so far come up empty. I’ve also tried various tricks to reserved them before Windows has a chance, but so far nothing works. These key combos are just locked to Windows at a deep, intrinsic level whether or not you actually use them.

This guy didn't find a way, but maybe some of you know more. Maybe there is some dll/exe we can easily patch. ;-)

*) I'd like to avoid using other tools such as AutoHotKey to hook the hotkey and remap it to something else that can be bound in common applications.

Qtax

Posted 2012-08-09T23:05:45.267

Reputation: 379

Have you tried modifying HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoWinKeys ? Your question said you changed the one in HKCU. Create the key if it isn't present, reboot, and see if it has any effect. – Zac B – 2012-08-18T20:15:58.467

Answers

7

This guy didn't find a way, but maybe some of you know more.

Not likely. I have been trying to find a way to prevent Windows Vista+ from hogging hotkeys since they came out.

The fact is, that unlike most Windows hotkeys that can be disabled with the NoWinKeys setting, there are several that are not registered via Windows Explorer. Instead, the higher- (lower-?) level CSRSS registers several hotkeys early in the boot process, so not only can you not register them first, but there is no setting to not use them. These are the keys are specially handled:

Win + P
Win + L
Win + U
Win + G
Win + X
Ctrl + Shift + Esc
Ctrl + Alt + Del

They can be overridden by certain programs like AutoHotkey, but not in the way that you are looking for (allowing programs to register them globally).

Maybe there is some dll/exe we can easily patch. ;-)

That is also quite unlikely. It would require hacking core components of Windows and even if the location where the hotkeys are registered were found and patched, it would mean that you would have to prevent security software from viewing the patch as an infection and make sure to reapply the patch after every Windows update.


You can try the Windows Hotkey Explorer which uses Windows hooks to determine the source of global hotkeys. Unfortunately it only shows these special combos as being reserved by System, meaning that they are loaded by the Windows core. What’s even more interesting with WHE is that it says the same thing for these keys even in Windows XP where they are not used. This implies that they are not actually being read like the other ones, and instead of hard-coded, which unfortuantely means that even with low-level Windows hooks, WHE cannot directly access them. This makes it especially unlikely that any sort of easy patch, driver, etc. can be made to stop them from being bound.


Sadly, the best, most effective solution would be to leave Microsoft feedback and hope they change it in a future update, but that rarely if ever works.

In my case, I simply gave in and changed my XMPlay hotkeys to use the arrow keys on the numeric keypad instead.

Synetech

Posted 2012-08-09T23:05:45.267

Reputation: 63 242

Slightly related: I found this thread "RegisterHotkey - list?" that has some info which is interesting and maybe could help find where the hotkey is set. If I understand correctly on Vista (and Win7 I assume) there is a _gphkHashTable kernel function that you could use to get a lists of registered hotkeys. Googling for it only finds some Chinese sites - I guess only some guys in China like playing with this. ;-)

– Qtax – 2012-08-14T06:14:18.157

It is possible, but you would have to install a hook to get at the information, then write and install a driver to load early in the boot process to patch the code in memory to avoid patching the file on disk. – Synetech – 2012-08-14T06:38:01.217

0

You can add the following registry [ WIN+R ->regedit.exe] :

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System + right-side, create a new DWORD 32-bit + Double-click on the newly created DisableLockWorkstation entry and change its value from 0 (zero) to 1 (one).

Ref. http://www.intowindows.com/how-to-disable-windowsl-shortcut-key-in-windows-78-1/

PS. No need for a restart xD

aemonge

Posted 2012-08-09T23:05:45.267

Reputation: 121

The article and the setting is talking about the Win+L hotkey. Does this unbind the win+arrow keys? – Qtax – 2018-05-07T12:42:35.253

Not, it actually only unbind the win+L. But seeing that this is posible I bet there's a way for the arrow functions. – aemonge – 2018-05-08T07:40:12.270

0

There's at least two tools to do this.

The first is Microsoft Keyboard Layout Creator

enter image description here

The second is KeyTweak

enter image description here

For more information on a related question: Program to re-program my keyboard?

climenole

Posted 2012-08-09T23:05:45.267

Reputation: 3 180

1How does remapping keys help one unbind the hotkeys in question? How does this answer the question? – Qtax – 2012-08-13T06:00:02.613

The only thing you could do with this 'solution' is to remap the keyboard to not have a windows key, replacing it with some other scan code, then map that key. NOT a good solution, as anything that tries to use the Win key for anything would be unusable. – Michael Kohne – 2013-04-30T11:33:45.670

Just guessing here, but you could theoretically create a fake WinKey, register your handler to get all related event, and just rethrow the events with the real windows key. That would provide you a way to customize any mapping related to WinKey as you wish... Though, dunno if possible... – Vajk Hermecz – 2013-11-26T18:07:57.530

0

AutoHotkey can override and do anything you like with the Windows shortcut keys.
See this documentation : Overriding or Disabling Hotkeys.

AutoHotkey can also do its actions conditional on the current window or process, in effect binding the keys differently to different processes. See for example Activating and manipulating windows.

For more information about AutoHotkey see :

Tutorial and Overview
AutoHotkey Documentation

harrymc

Posted 2012-08-09T23:05:45.267

Reputation: 306 093

3They clearly said they didn’t want to use AutoHotkey. Unless you know of a way to have AHK allow other programs to bind these keys, then I don’t see how it applies to the question. – Synetech – 2012-08-13T06:34:23.693

You can hook the hotkeys in AutoHotkey so that they do nothing or perform some action in AHK, but this does not enable you to bind these hotkeys in any other application, which was the question. (This is why I stated in the question that AHK answers are not of much interest.) – Qtax – 2012-08-13T06:43:27.957

@Qtax: The per-window/process key binding of AutoHotkey seemed to me like a solution. Why doesn't it work for you? – harrymc – 2012-08-13T08:04:13.073

1@harrymc, because if for example, he wanted to have Winamp use Win+Left to rewind, there is no way to have AutoHotkey do that. I suppose you could fake it by having Winamp use a different key, say Win+A to rewind, and then writing an AHK script that detects when that key is pressed while the Winamp window is active and then send Winamp Win+A, but that is pointless because the whole point to global hotkeys is to have them work no matter what window is active. – Synetech – 2012-08-13T18:22:13.730

@Synetech: My understanding (maybe wrong) was that Qtax wanted to bind these keys differently inside various applications. The only way I know to do this is for AutoHotkey to translate these keys into something less toxic and more usable, then bind the translated keys into the application(s). An extra sophistication is for AutoHotkey to customize its action to the active application. – harrymc – 2012-08-13T18:29:00.287

> My understanding (maybe wrong)   Yup, wrong. They clearly want to assign those combos in other/any programs which of course won’t work in Vista+ since it greedily hogs them, even when they are not being used (just like it does for Win+P even when you are using a desktop with only one monitor). – Synetech – 2012-08-13T18:32:31.380

@Synetech: Exactly my point - it will only work if AutoHotkey converts these keys to something else, for example Win-Up to Ctrl-Shift-Up. Press Win-Up and the application will receive Ctrl-Shift-Up that one can normally bind easily enough, so Qtax will be using Win-Up as a shortcut to this combo. – harrymc – 2012-08-13T18:47:53.273

Yes, that could theoretically work, but besides being what should be an unnecessary, hacky, kludgey workaround, in my experience, AHK hotkeys (at least the special ones) seem to get unbound in Windows 7 after a while for some reason and the AHK executable needs to be exited and re-run to reestablish them. Besides, it means registering two hotkeys for each one (eight for the four arrow keys) and of course those combos cannot be used for other purposes. :-| Oh, and also …so that these can be bound directly* in other applications. They already thought of this hack and didn’t like it. – Synetech – 2012-08-13T19:01:49.173

@Synetech: Righty-o, I should have read the small print. But then my answer would have been that this is impossible. – harrymc – 2012-08-13T19:21:17.833

It’s the very first line of the question.     Unfortunately it is indeed impossible without hacking Windows’ guts which even then would be much less convenient than just giving up. :-( – Synetech – 2012-08-13T21:35:51.053

1@Qtax: I don't know of a better solution. My apologies if I presumed the lack of knowledge regarding AHK on your part. – harrymc – 2012-08-14T05:34:11.147

harrymc, using AHK to rebind the keys might be the only solution that works, but with this question I wanted to see if there are any other/better ways where you could avoid that. (Edit: Fixed the @name. This was originally posted right before harrymcs comment above.) – Qtax – 2012-08-14T06:23:30.157