PowerToys icon indicating copy to clipboard operation
PowerToys copied to clipboard

Remapping shortcuts to include a remapped key works inconsistently

Open soliton-bryenton opened this issue 3 years ago • 27 comments

Microsoft PowerToys version

0.66.0

Installation method

PowerToys auto-update

Running as admin

Yes

Area(s) with issue?

Keyboard Manager

Steps to reproduce

Recently discovered PowerToys and it is a godsend for someone who runs a mac at home but a windows computer at work.

For consistency and ergonomics I much prefer the location of the command key for functions rather than using control as it is on windows. I've swapped my keycaps around to order windows / alt / control, and done the same inside of PowerToys. Amazing! However this results in the alt + tab functionality that I use a ton being a bit more out of reach (and inconsistent with the mac command + tab). When swapping control + tab > alt + tab, and vice versa - sometimes it will work and sometimes it will not.

Upon initial setup the first time using PowerToys everything was great. Then all of a sudden (perhaps some specific app is override keyboard settings?) I lost my alt + tab rebind. Disabling and re-enabling keyboard manager did not resolve the issue, but restarting my computer brought back the functionality. However after a bit it was gone again. Restarting PowerToys will bring back the functionality as well.

I am running as administrator.

I'll test with the applications I have on my computer to try to find what might be overriding if that's the case. However I thought I'd post first as I generally have a multitude of apps open at the same time for development.

powertoys

✔️ Expected Behavior

Control + tab sends command for alt + tab on repositioned alt/control keys.

❌ Actual Behavior

Alt + tab remapping is overidden and returns to functionality as if remap never took place (individual key remaps continue to work as expected)

Other Software

No response

soliton-bryenton avatar Jan 09 '23 17:01 soliton-bryenton

As of so far I have yet to find any consistent repro steps. However I have found another keybind that "loses" it's binding. I've bound Ctrl + Shift + 4 > Win + Shift + S, as that's the mac shortcut for the equivalent snipping tool. When I lose the ability to ctrl + tab I also lose this functionality. screenshot

soliton-bryenton avatar Jan 09 '23 21:01 soliton-bryenton

Looks like the Keys and the Shortcuts are conflicting. Since one needs to press a few keys to type a shortcut. Key remappings are maintained, even "inside shortcuts". Maybe there's another app that can help you for this specific case, for example Microsoft Power Automate, or AutoHotkey?

Jay-o-Way avatar Jan 09 '23 22:01 Jay-o-Way

When you say conflicting do you mean that the app itself is running into conflicts or that I've mapped something incorrectly? My understanding was that remapping of individual keys took precedence, meaning that if I'd remapped windows to alt. Any remapped shortcuts including alt would only activate when they receive the "input call" for alt, which should now be originating from the windows key location.

I've thought about AutoHotkey as well, and can definitely set that up without issue. I was just very attracted to PowerToys thanks to all the other additions that are included (PowerToys Run is insane with how much better it is than the default windows search)

The thing that led me to believe that perhaps it was something getting into conflict with the app (or potentially a PowerToys bug) was that it will work for a set period of time, but then eventually (still no consistent repro) will stop until a PowerToys restart.

Again if I have misunderstood something, my apologies. But from reading the documentation I gathered my above assumption. :)

soliton-bryenton avatar Jan 10 '23 15:01 soliton-bryenton

I should also mention that the individual key remaps continue to work. So for my use case I have swapped the alt key to control. All the usual ctrl + c / ctrl + t / etc. continue to work after the loss of functionality for the above mentioned shortcut rebinds.

soliton-bryenton avatar Jan 10 '23 16:01 soliton-bryenton

same issue as yours

I should also mention that the individual key remaps continue to work. So for my use case I have swapped the alt key to control. All the usual ctrl + c / ctrl + t / etc. continue to work after the loss of functionality for the above mentioned shortcut rebinds.↳

lwqisme avatar Mar 22 '23 02:03 lwqisme

Having the same issue. Had it for years now. Raised today #36334 to discover there was already this issue.

Noticed I moved from AutoHotkey of the same reason.

Happy to provide any logs or debugging information for this issue to be solved.

kvervo avatar Dec 13 '24 21:12 kvervo

In my case, deactivating and re-enabling the Keyboard Manager successfully re-applies the shortcuts, only for it to stop working after a single shortcut use.

It doesn't matter in which application I am when pressing a configured key combination. Once the shortcut has been used, the functionality is "spent" and none of the shortcuts work anymore.

Windows 11

creative-resort avatar Dec 17 '24 09:12 creative-resort

I don't quite get why issues that people are reporting with straight mapping doesn't involve remapping shortcuts are being duped to here. If the PT team has insights as to how they are the same issue, it would be great to see an explanation to that end.

For example, my Caps Lock to Control remapping randomly stops working, and that's the only remapping I have.

vttale avatar Jan 11 '25 05:01 vttale

For me, the remapped keys stop working after sleep. I don't see how my complaint (reported in other issues) is a duplicate of this issue. It is consistent, it happens every single time after sleep, and I only use LCtrl->Home and Num0/NumInsert->End. Restarting PT or re-enabling the KM fixes the issue. Super annoying, and it doesn't happen with AHK and similar tools.

Irfy avatar Feb 10 '25 11:02 Irfy

I’m experiencing the same problem.

Up until today, everything was functioning perfectly. However, after I removed Windows Defender (wscsvc, SmartScreen, Pluton Support, System Mitigations, Antivirus Service) from my computer, the Keyboard Manager started malfunctioning intermittently. I’ve tried reinstalling PowerToys and toggling the Keyboard Manager on and off, but nothing seems to resolve the issue.

Is there a Windows component that plays a role?

jay-waves avatar Feb 27 '25 14:02 jay-waves

I see this is the only open issue regarding Keyboard Manager stops to work.

The only thing that worked for me was the following comment from https://github.com/microsoft/PowerToys/issues/26457, restarting PT did not!

yes, me too. it stopped working , i re-locked the laptop(use the shortcut win+l), then unlocked the laptop, and keyboard manager worked again

dimateos avatar Mar 07 '25 09:03 dimateos

I'm having similar issue (I think). The shortcuts started to fail a few months ago. But If I disable and enable the keyboard manager then it starts to work until a few minutes later it fails again.

EDIT: I've installed the v0.83.0 and looks like this version works as expected. So it should be a bug added in a newer version.

alvarokrn avatar Mar 11 '25 11:03 alvarokrn

Still an issue for me, too. After applying one single shortcut — it's spent and stops working.

creative-resort avatar Mar 12 '25 00:03 creative-resort

Still an issue - any update on this getting fixed in the future? @admins

borsodigerii avatar Apr 11 '25 09:04 borsodigerii

Still an issue for me as well

lucas-pessoa avatar Jun 18 '25 14:06 lucas-pessoa

ver 0.92.1, Still an issue for me as well

startup-handler avatar Aug 02 '25 17:08 startup-handler

Doesn't work at all, period, for me. I tried many things, even a simple Alt O -> Run calc.exe. v0.93, Windows 10 22H2 (19045.6216)

Unknow0059 avatar Sep 02 '25 12:09 Unknow0059

@cinnamon-msft @zadjii-msft Do we have an estimate on when this issue is planned to be triaged/taken care of?

borsodigerii avatar Sep 02 '25 12:09 borsodigerii

I am encountering the same issue, remapping shortcuts stops working randomly. While restarting powertools fixes the issue for an undefined amount of time (between ~1min and ~30min) it becomes really annoying to pretty much always have to restart powertools when i need one of the mappings. Considering i find github issues back to 2022 on this i have very little hope of this ever getting fixed

loadmi avatar Sep 02 '25 13:09 loadmi

For anyone that just needs a quick fix, i switched to using AutoHotkey which seems to work reliably. It's a little more technical to use and requires you to write your own script but it is robust and works well. I can provide a sample script i use to remap < and > on my keyboard:

; Remap CTRL + , to < ^,:: { Send("<") }

; Remap CTRL + . to > ^.:: { Send(">") }

Save as .ahk and place a shortcut to the script into the autostart folder (Windows + R Then enter 'shell:startup' and enter)

loadmi avatar Sep 02 '25 14:09 loadmi

I'm still using v0.83.0 since this version doesn't have the issue

alvarokrn avatar Sep 02 '25 14:09 alvarokrn

It's still not resolved for me, either.

creative-resort avatar Sep 05 '25 20:09 creative-resort

still an issue in 0.94.0

andersgranaker avatar Oct 24 '25 06:10 andersgranaker

In addition to shortcuts randomly failing until next computer lock->unlock, I just encountered a new issue. On chrome, ctrl + right/left arrow would not jump word, like if ctrl was ignored. I have shortcuts exclusive to excel that map ctrl+right/left to ctrl+PgUp/PgDn, but that seems unrelated. Deactivating and reactivating keyboard manager solved it. Then it stopped working again rather quickly.

This happened during the writing of this very comment. What I originally meant to say was one of my most important setting is disabling ctrl+w in chrome because it's so close to ctrl+x sometime I accidentally press it, losing my work. keyboard manager usually saves me, but it is unreliable. Many issues (including mine) with a broader title were closed, which make tracking the issue harder than it should be IMO because the title make it looks like it's a very specific issue (shortcut including remapped key) while it's not. Ofc duplicates should be closed, but maybe the chosen issue to track the problem should have better title

thefasquelle avatar Nov 04 '25 11:11 thefasquelle

i agree with @thefasquelle on that this is a broader issue than the title suggests. just remapping alt+tab to ctrl+tab (and vise versa) already stops working multiple times a day for me. i have this issue consistently on multiple devices (win 10 and 11; different manufacturers; over many months and different PowerToys versions).

many thanks to @alvarokrn 🙏 reverting to v0.83.0 seems to fix the issue. so it seems like the issue had been fixed and reintroduced since it was posted.

AlexanderMlr avatar Jan 05 '26 14:01 AlexanderMlr

It's interesting that it's been 3 years and nobody came up with the simple solution.

https://github.com/microsoft/PowerToys/blob/36a64cae909b954216f9771335b06eb7f2354506/src/common/interop/KeyboardHook.cpp#L52-L56

It's pretty obvious that this keyboard hook (HookProc) gets removed because of the LowLevelHooksTimeout limitation:

If the hook procedure times out, the system passes the message to the next hook. However, on Windows 7 and later, the hook is silently removed without being called. There is no way for the application to know whether the hook is removed.

Source

The solution is to increase the value of LowLevelHooksTimeout by creating or updating a key in registry using the following command:

reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v LowLevelHooksTimeout /t REG_DWORD /d 1000 /f

1000 milliseconds is the maximum value.

monoblaine avatar Jan 05 '26 16:01 monoblaine

Thanks for the reply @monoblaine . I tried adding the register entry for LowLevelHooksTimeout on PowerToys v0.96.1 the way you suggested but the issue persists. Your explanation for the underlying issue seems plausible, though.

Also, locking and unlocking windows does not temporarily resolve the issue for me as suggested earlier.

I also noticed that on my ARM device (Surface Pro 11), the issue is much more prominent (occurs at least every couple minutes).

Downgrading to v0.83.0 seems to be the best workaround so far.

AlexanderMlr avatar Jan 06 '26 18:01 AlexanderMlr