Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shortcut remapping sporadically does not work #17344

Open
1 task done
dapal-003 opened this issue Mar 30, 2022 · 28 comments
Open
1 task done

Shortcut remapping sporadically does not work #17344

dapal-003 opened this issue Mar 30, 2022 · 28 comments
Labels
Issue-Bug Something isn't working Priority-1 Bug that is high priority Product-Keyboard Shortcut Manager Issues regarding Keyboard Shortcut Manager Status-Reproducible This issue was reproduced by a maintainer

Comments

@dapal-003
Copy link

Microsoft PowerToys version

v0.56.2

Running as admin

  • Yes

Area(s) with issue?

Keyboard Manager

Steps to reproduce

Create any shortcut combination that includes a modifier in the mapped key, for example Win + V to CTRL+ALT+V
Create another keyboard shortcut that doesn't include a modifier key, for example Win + Space to O
Press the shortcuts while in a text editor, allowing of plenty of time between each press of combination

Restarting power toys, turning keyboard remapping on and off and completely re-doing the shortcuts all have a chance to fix the issue. I've not been able to reliably use one method to consistently fix the issue. Sometimes it's required to apply the same "fix" multiple times before it works again. The modifier shortcuts break randomly as far as I am aware.

Debug archive

✔️ Expected Behavior

Powertoys intercepts both shortcut and changes each over to press their new mapped key

❌ Actual Behavior

Powertoys ignores the combination that includes a modifier key in the mapped to and lets the original key combination go through
Powertoys intercepts the combination that does not include the Windows key and sends the new mapped key through.

This behavior has shown itself sporadically over the last month, however it's gotten to a point now that turning the manager on and off or restarting power toys no longer fixes the issue.

Other Software

https://github.com/hluk/CopyQ V6.1.0 with the shortcut CTRL+ALT+V to show the latest clipboard
This software has been working together with powertoys flawlessly when the keyboard shortcut manager actually works.

@dapal-003 dapal-003 added Issue-Bug Something isn't working Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams labels Mar 30, 2022
@franky920920 franky920920 added the Product-Keyboard Shortcut Manager Issues regarding Keyboard Shortcut Manager label Mar 30, 2022
@TzakShrike
Copy link

TzakShrike commented Mar 31, 2022

I think this is related to simulated keyup events for modifier keys.

I noticed this when mapping a Shift+something to Shift+something else, and the events that ended up being sent resulting in windows 100% consistently thinking that my modifier key was held long after release, which interfered with me sending other shortcuts (or typing, obviously) later.

I found that I could work around the issue by mapping Shift (Left) and Shift (Right) individually, and not using the non-directional Shift at all.

Even in the example that @dapal-003 posted above, this issue doesn't occur if you only map Win (Right) for example in both shortcuts, and ensuring that you release the windows key after each shortcut press. (Edit: This turns out to be not true, this just avoids some bugs, not all)

I was about to create a similar bug report for my issue, but I found this one and think these two are very strongly related.

As a recommended start, don't release the modifier key after sending the target key combination if the same modifier key exists in the source key combination.

@dapal-003 if you end up in this kind of situation, just double-tap the offending modifier key (windows in this case) and your shortcuts should all work again. Can you confirm this, just to be sure?

@jaimecbernardo
Copy link
Collaborator

There are definitely some bugs here. Mapped Win (Left)+space to 'o' and Win(Left)+v to Ctrl(Left)+v and it replicates.
Unpressing the shortcut and then repressing it seems to fix it for a bit, buy yeah, issue returns after a while.
Replicates nicely if I press Win(Left)+v; Win (Left)+space; Win (Left)+space; . The third Win(Left)+space won't work. Win(Left)+v stops working until I totally unpress keys and introduce Win(Left)+ space again.

@jaimecbernardo jaimecbernardo added Status-Reproducible This issue was reproduced by a maintainer and removed Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams labels Mar 31, 2022
@jaimecbernardo jaimecbernardo added the Priority-1 Bug that is high priority label Mar 31, 2022
@TzakShrike
Copy link

There's definitely more going on here in addition to what I said earlier. It's as though the program is getting into an inconsistent state.

While we're at it, could whoever looks at modifiers for this also add the LOya (Left Thumb) and ROya (Right Thumb) modifiers?

@dapal-003
Copy link
Author

@dapal-003 if you end up in this kind of situation, just double-tap the offending modifier key (windows in this case) and your shortcuts should all work again. Can you confirm this, just to be sure?

Thanks for getting back to me with the issue, I just tried your suggestion, and sadly it did not fix the issue. Doubletapping win (left or right) did not reset the keyboard manager to its previous state

@jaimecbernardo
Copy link
Collaborator

While we're at it, could whoever looks at modifiers for this also add the LOya (Left Thumb) and ROya (Right Thumb) modifiers?

What keys are these? First time I'm hearing of these keys. Perhaps this is a Feature Request?

@TzakShrike
Copy link

TzakShrike commented Apr 5, 2022

Yeah it's pretty much a feature request. They're keys specific to a uncommon type of Japanese keyboard, but they have surprisingly good low-level support in Windows (Recently there was a bug in UWP apps that meant they didn't work, but it was patched and now they're fine). Think of them like two additional independent shift-like keys, and the keyboard as the DVORAK of the Japanese language.

Considering we can remap keys, I wanted to utilize them to make way more shortcuts, shortcuts that wouldn't ever conflict with any program. This should work, but PowerToys only recognises standard modifier keys for making shortcuts now.

image

@jaimecbernardo
Copy link
Collaborator

Yeah it's pretty much a feature request. They're keys specific to a uncommon type of Japanese keyboard, but they have surprisingly good low-level support in Windows (Recently there was a bug in UWP apps that meant they didn't work, but it was patched and now they're fine). Think of them like two additional independent shift-like keys, and the keyboard as the DVORAK of the Japanese language.

Considering we can remap keys, I wanted to utilize them to make way more shortcuts, shortcuts that wouldn't ever conflict with any program. This should work, but PowerToys only recognises standard modifier keys for making shortcuts now.

image

I see. Is any key reported if you press that key while trying to map a shortcut?
Open a separate feature request for this, please.

@acomagu
Copy link

acomagu commented Apr 13, 2022

Same here. All these shortcuts stop to work randomly. Seems start working after few minutes.
image

(Actually I tried another remapper(AHK) in other PC but faced same problem so I guess it may be Windows side bug...)

@levilansing
Copy link

I have this issue in 0.57.0. It's hard to repro, but when it happens, it seems like every key used in any keyboard shortcut (and the letter A for some reason) completely stops working for most applications, but not all. Sometimes it happens while I'm typing, other times it happens when I wake up my PC (I do often tap CTRL/ALT/WIN (left) to wake and WIN (left) is mapped to CTRL and used in several shortcuts)

I have a possibly related issue where I have several windows (left) + [key] shortcuts, and if I accidentally type WIN+L (I have the WIN+L lock shortcut disabled in the registry), the win left key gets stuck down for all future key presses until I press and release the OTHER windows key. Sometimes when I get stuck in this state just my shortcuts stop working, other times those keys stop working entirely. may or may not be related because other times when I end up with keys not working I definitely did NOT press WIN+L.

Rebooting is the only guaranteed fix, restarting powertoys, toggling keyboard manager, and even turning the keyboard manager OFF doesn't always fix the keys that stop working. recently, just starting powertoys as administrator (not toggling anything) did fix it.

@ghost
Copy link

ghost commented Jun 4, 2022

See my comment at #17788 for a workaround and more info.

@jaimecbernardo
Copy link
Collaborator

On 0.59 we did some fixes that might also work here. Could you please give it a try and check if it helps here?

@levilansing
Copy link

I upgraded yesterday and experience the issue again today, where the key mappings suddenly stopped working. I opened powertoys as an administrator and they instantly started working again.

@dapal-003
Copy link
Author

dapal-003 commented Sep 29, 2022

Issue is still around. Now even restarting powertoys or turning keyboard manager doesn't restore it's functionality.

@maykot
Copy link

maykot commented Jan 18, 2024

I'm experiencing the exact same problem with a few different shortcuts. All of them of the form Ctrl (Left) + Alt (Rigth) + key -> key, e.g. Ctrl (Left) + Alt (Rigth) + ] -> End, Ctrl (Left) + Alt (Rigth) + S -> `, etc.

In all of these cases pressing the destination key directly fixes the issue. So does locking and unlocking Windows.

@NathanWailes
Copy link

Not sure how relevant / helpful this will be, but just in case: I was just having an issue where my PowerToys shortcut Win+A/D to map to Win+Left/Right wasn't working. I went to https://www.keyboardtester.com/ and heard a constant "clicking" sound indicating some key was being held down; it turned out that the issue was that I had a second keyboard plugged in that was upside-down on my desk and spamming a particular key (I'm not sure which one), preventing the shortcut from working. Once I turned that keyboard over so there weren't any keys being held down, my shortcuts started working again.

@oxodao
Copy link

oxodao commented Feb 26, 2024

Same issue here, my config is the following:

  • Remapped Win+Space to Ctrl+Alt+Divide (Which is mapped in Flow.Launcher, because it doesn't support directly Win+Space)
  • Remapped Win+Enter to Ctrl+Alt+Shift+d (Which is mapped in Windows Terminal to show quake mode, because it doesn't support directly Win+Enter)
  • Remapped Caps Lock to Escape
  • Remapped Escape to Caps Lock

Seemingly randomly, the first two shortcut will no longer work. When this happens the swapping of the Capslock and Escape keys is still working. Calling the one configured in each app does work though so this definitely comes from PowerToys

Restarting Powertoys do not helps. It then later randomly unstuck itself at some point.

Running PT 0.78.0 (Latest) does not solve the issue

@jl133780085
Copy link

jl133780085 commented Feb 28, 2024

Same issue for me; stopped using the software because of it

@rbento
Copy link

rbento commented Mar 5, 2024

This problems seems to be related to the PowerToys.AlwaysOnTop process.

I could consistently reproduce it like so:

  1. Remap Caps Lock to Esc
    • Works fine
  2. Bring up the TaskManager
    • Raises a notification from PowerToys for AlwaysOnTop program, which causes the KeyboardManager/Remaps to stop working.
  3. Open PowerToys from the System Tray > Turn off/on either Always On Top or Keyboard Manager
    • Works again until step 2 is repeated.

PowerToys v0.78.0
Edition Windows 11 Home
Version 23H2
OS build 22631.3235
Experience Windows Feature Experience Pack 1000.22687.1000.0

@oxodao
Copy link

oxodao commented Mar 6, 2024

This problems seems to be related to the PowerToys.AlwaysOnTop process.

I could consistently reproduce it like so:

1. Remap Caps Lock to Esc
   
   * Works fine

2. Bring up the TaskManager
   
   * Raises a notification from PowerToys for AlwaysOnTop program, which causes the KeyboardManager/Remaps to stop working.

3. Open PowerToys from the System Tray > Turn off/on either Always On Top or Keyboard Manager
   
   * Works again until step 2 is repeated.

PowerToys v0.78.0 Edition Windows 11 Home Version 23H2 OS build 22631.3235 Experience Windows Feature Experience Pack 1000.22687.1000.0

This is probably not the same issue. Caps-lock to esc never breaks for me, only shortcut related to modifier keys. I never had AOT enabled. The only features I have are keyboard manager, color picker and screen rule.

EDIT: Just had the issue. It seems that locking (Win+L) + unlocking fixed it. Not great but its good to know
EDIT2: After a week of usage, locking+unlocking CONSISTENTLY fixes the issue, this was not a one-time thing, its just a pain to do

@raprocks
Copy link

facing the same issue with remap of ctrl + escape to ctrl + backtick( ` ), workaround of win + L and unlocking working as of now as mentioned by @oxodao

@arminmiau
Copy link

arminmiau commented May 26, 2024

Same Issue with Win + S rebinded to Alt + Space (Windows Search to PowerToys Run) and workaround with locking and unlocking works.

@ImDino
Copy link

ImDino commented May 28, 2024

Happens to me frequently (Windows 11). It stopped working in Ableton 12, I quit the program, went to my Brave browser and it worked there, I re-opened Atleton and it started working there again too.

image

PS. I have it set up this way because some apps (such as Davinci Resolve) already uses Ctrl+Shift+Z as redo.

@TenSeventy7
Copy link

TenSeventy7 commented May 31, 2024

Happens to me as well on a new (OEM) Windows 11 install. The Win+L workaround works, though.

Here's my config:

  • Ctrl+Alt+T opens Windows Terminal
  • Alt + Win+Shift+F23/Copilot Key opens Gemini
  • Ctrl + Win+Shift+S/Snipping Tool Key mapped to Win+PrintScreen

PowerToys v0.78.1
Edition Windows 11 Home Single Language
Version 23H2
OS build 22631.3672
Experience Windows Feature Experience Pack 1000.22700.1009.0

@iibach
Copy link

iibach commented Jun 25, 2024

Dear Sir, just doulbe check this haven't been fixed into the latest release. I am on 0.81.1. I am still experiencing shortcut failed and I need to restart the computer to fix it. Mine is mapping alt + a to ctrl + a.

@iibach
Copy link

iibach commented Jun 25, 2024

WIN + L can workaround it. Thanks @oxodao ~

@worldsayshi
Copy link

I only have:

  • Caps Lock to Esc
  • Esc to Caps Lock

And I sporadically get this issue. Waking from hibernation might be related. PowerToys v0.83.0.

@oxodao
Copy link

oxodao commented Aug 14, 2024

I only have:

* Caps Lock to Esc

* Esc to Caps Lock

And I sporadically get this issue. Waking from hibernation might be related. PowerToys v0.83.0.

I replaced PT with AutoHotkey for this use case which comes with its own set of issues, but as far as I remember it happened to me sporadically too but I NEVER used hibernation, always full shutdown.

@DanielBakerCF
Copy link

Happens to me all the time on Windows 11 and 10.

Mapped Ctrl + C to Ctrl + .
Mapped Ctrl + V to Ctrl + /

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug Something isn't working Priority-1 Bug that is high priority Product-Keyboard Shortcut Manager Issues regarding Keyboard Shortcut Manager Status-Reproducible This issue was reproduced by a maintainer
Projects
Status: No status
Development

No branches or pull requests