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 · 30 comments
Open
1 task done

Shortcut remapping sporadically does not work #17344

dapal-003 opened this issue Mar 30, 2022 · 30 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 Tracker Issue that is used to collect multiple sub-issues about a feature

Comments

@dapal-003
Copy link

dapal-003 commented Mar 30, 2022

crutkas: this issue has some insights #35638

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.

@crutkas crutkas added this to the PowerToys 0.87 milestone Nov 1, 2024
@crutkas crutkas added the Tracker Issue that is used to collect multiple sub-issues about a feature label Nov 1, 2024
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 Tracker Issue that is used to collect multiple sub-issues about a feature
Projects
Status: No status
Development

No branches or pull requests