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

Mapping Alt+Left to MediaNext also remaps all other meta-key combinations #10961

Closed
1 task
mrshanepaul opened this issue Apr 27, 2021 · 17 comments
Closed
1 task
Labels
Issue-Bug Something isn't working Priority-1 Bug that is high priority Product-Keyboard Shortcut Manager Issues regarding Keyboard Shortcut Manager Resolution-Already Fixed/Doesn't Apply A change in the product has made the issue obsolete. Status-Reproducible This issue was reproduced by a maintainer

Comments

@mrshanepaul
Copy link

Microsoft PowerToys version

0.35.0

Running as admin

  • Yes

Area(s) with issue?

Keyboard Manager

Steps to reproduce

Remap a shortcut:
Alt(Left) + Left -> Next Tack

Press:
Ctrl+Alt+Left
OR:
Ctrl+Shift+Alt+left
OR:
Shift+Alt+left

✔️ Expected Behavior

For the shortcut to be restricted to the combination entered.

❌ Actual Behavior

It fires the media event no matter what.
Even if that key combination is used locally in the application I am using.

Other Software

Spotify

@mrshanepaul mrshanepaul added Issue-Bug Something isn't working Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams labels Apr 27, 2021
@enricogior enricogior added Product-Keyboard Shortcut Manager Issues regarding Keyboard Shortcut Manager Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something and removed Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams labels Apr 27, 2021
@enricogior
Copy link
Contributor

@mrshanepaul
can you please post a screenshot of your mapping? Thanks.

@mykhailopylyp
Copy link
Contributor

@mrshanepaul
It is by design. We map exact match only for shortcut to shortcut remapping.

Regarding, Even if that key combination is used locally in the application I am using., we have two types of shortcut remapping global and app-specific so you can specify an app. I guess for music switching it is better when It is global.

@enricogior enricogior removed the Issue-Bug Something isn't working label Apr 27, 2021
@mrshanepaul
Copy link
Author

@enricogior I do not have an advanced setup up, it is just a basic rebind. Here is the image as requested.
image

@mykhailopylyp You have it backwards, that IS the functionality I want. It is doing the opposite. :)

I wrote a key remapping/window management app myself a few years ago (it could recognise individual USB devices and use separate remaps for each - surprisingly difficult in windows) in C# and your tool made mine mostly obsolete. :)

I realise that key combinations in windows do not all work the same way, especially when it comes to meta and special keys.

It might be something to do with this.

@ghost ghost added Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams Needs-Team-Response An issue author responded so the team needs to follow up and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels Apr 27, 2021
@crutkas
Copy link
Member

crutkas commented Apr 28, 2021

So using my keyboard with a Next Track, Spotify only response to the key if Spotify (mine is installed via Store) is in focus. Both normal "Next Track" key and a remapped key. If i flip over to Media Player, both real key and the remapping works appropriately. Tried with both PT running and not running.

So this is spotify not respecting the actual 'next track' event. Repro'ed as external.

here was my remap
image

@crutkas crutkas closed this as completed Apr 28, 2021
@crutkas crutkas added Resolution-External External issue, unrelated to PowerToys and removed Needs-Team-Response An issue author responded so the team needs to follow up Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams labels Apr 28, 2021
@mrshanepaul
Copy link
Author

mrshanepaul commented Apr 28, 2021

@crutkas

You are mistaken. That is not my issue at all.

Spotify control works perfectly on my machine.

The issue I am having is that it is being controlled when I use OTHER metakeys in addition to the Alt key.

As per the bug report:

When I Press:
Ctrl+Alt+Left
OR:
Ctrl+Shift+Alt+left
OR:
Shift+Alt+left

I am pretty sure this has nothing to do with Spotify.

@crutkas
Copy link
Member

crutkas commented Apr 28, 2021

Sorry, i misread the setup step.

@crutkas crutkas reopened this Apr 28, 2021
@crutkas
Copy link
Member

crutkas commented Apr 28, 2021

Notes:

  1. I can repro this on 1 machine but not another. the one i can is a Windows Insider build 21359
    1. the one i was in middle of an OS upgrade cycle.
  2. One i can't is having Alt+Left act like it can't be overridden like Win+L. It is acting like the back key which you'd expect from that shortcut.

Lemme restart the machine i can't

@crutkas crutkas added Issue-Bug Something isn't working Priority-1 Bug that is high priority and removed Resolution-External External issue, unrelated to PowerToys labels Apr 28, 2021
@crutkas crutkas added this to the Stability Release milestone Apr 28, 2021
@mrshanepaul
Copy link
Author

mrshanepaul commented Apr 28, 2021

2. One i can't is having Alt+Left act like it can't be overridden like Win+L.  It is acting like the back key which you'd expect from that shortcut.

The reason I chose these particular key combos because they are the special "Web Back/Forward" keys on my keyboard.

I don't need them for that, but they work well for music. :)

Is it possible that another app is stealing/conflicting this combo for its own purposes? I know some apps will do this with other combos, and you have to unbind them first.

@mykhailopylyp
Copy link
Contributor

@mrshanepaul
Just to clarify.
If we have the following remapping
image

If Ctrl+Alt+Left is pressed, it will be remapped to Ctrl+Next Track(So Spotify still captures Next Track). It is by design. Isn't it part of your issue?

Let's assume we use an application that has Ctrl+Alt+Left shortcut. If we press Ctrl+Alt+Left the application will get Ctrl+Next Track(because it is remapped by PowerToys). Isn't it the second part of your issue?

@mrshanepaul
Copy link
Author

mrshanepaul commented Apr 28, 2021

@mykhailopylyp That would explain it then.

Unfortunately that means that using an Alt bind like this will ruin all other combinations of meta keys that include Alt. They will be forced to be permutations of whatever is bound to the base combination?

I did not know it worked this way, I am not sure it should?

Or at least be configurable to not do this?

What happens if I Bind bother "Ctrl+Right" AND "Alt+Right".
And then press Ctrl+Alt+Right?

I am not sure a single key bind should do this?

PS: I also tried to bind the combo back to itself to try to override whatever was happening, but you are not allowed to do that. :)

@enricogior
Copy link
Contributor

enricogior commented Apr 28, 2021

@crutkas @mrshanepaul @mykhailopylyp
I think we need to fix this, since the default behavior should be that only the exact shortcut is remapped, any other shortcut that contains the given shortcut as a subset should not be affected.
We may consider the current behavior as an option if someone really wants to affect all shortcuts that contains the given one, but I see it has a low priority option.

CORRECTION: since only shortcut to key mapping are affected by this behavior, and since this is the current documented behavior, the only change we can consider is to add an option to also force exact shortcut to key mapping.

@mykhailopylyp
Copy link
Contributor

@mrshanepaul
You can try something like
image
to solve your issue.

If you press Alt+Right it will still send Next Track and it will not remap Shift+Alt+Right.

@mrshanepaul
Copy link
Author

mrshanepaul commented Apr 28, 2021

@enricogior That would be excellent. As part of the upgrade, existing user config could be set to preserve the original functionality while newly created key binds revert to the new method?

@mykhailopylyp Thanks a lot for that. I tried that out and it works great. The 2-key combo does not override everything.
This would not work in most cases but meta-key combinations are ignored by the music player so it does.

Thanks!

@kalokng
Copy link

kalokng commented May 5, 2021

I also have a similar issue:
I am using a Mac keyboard with F13~F19 which has no use in windows, and I mapped them as volume / media control keys:

F13 -> volume mute
Ctrl+F13 -> Play / pause Media

But whenever I press Ctrl+F13, it always mute / unmute the volume.
I tried to remove the F13 binding, then Ctrl+F13 works as intended.

@mrshanepaul
Copy link
Author

But whenever I press Ctrl+F13, it always mute / unmute the volume.
I tried to remove the F13 binding, then Ctrl+F13 works as intended.

Could be due to a quirk of the keyboard standard. :)

F13 == Shift F1

So Ctrl F13 would be Ctrl Shift F1. (I think)

Might be a cause of the issue somehow?

@mykhailopylyp
Copy link
Contributor

@kalokng

F13 -> volume mute
Ctrl+F13 -> Play / pause Media

But whenever I press Ctrl+F13, it always mute / unmute the volume.

It is expected. We map key to key first and it does not matter if a key is a part of a shortcut. In your example, when you press Ctrl+F13, F13 is remapped to volume mute so the system receives Ctrl+volume mute.

@lukeng
Copy link

lukeng commented May 5, 2021

@mrshanepaul

Could be due to a quirk of the keyboard standard. :)

F13 == Shift F1

So Ctrl F13 would be Ctrl Shift F1. (I think)

Might be a cause of the issue somehow?

No, keyboard manager can correctly identify F13 and Shift+F1. And when I press Shift+F1, the volume did not mute.

@mykhailopylyp

@kalokng
It is expected. We map key to key first and it does not matter if a key is a part of a shortcut. In your example, when you press Ctrl+F13, F13 is remapped to volume mute so the system receives Ctrl+volume mute.

I am a bit confused with that behavior, as I can do both bindings in v0.35.

Btw, I found a workaround which achieve what I wanted:

F13 -> Volume Mute
Ctrl + Volume Mute -> Play / Pause media

Maybe some text showing somewhere in the dialog when creating the shortcut would help.

@cinnamon-msft cinnamon-msft added the Status-Reproducible This issue was reproduced by a maintainer label Oct 28, 2024
@jaimecbernardo jaimecbernardo added the Resolution-Fix Committed Fix is checked in, but it might be 3-4 weeks until a release. label Jan 15, 2025
@cinnamon-msft cinnamon-msft added Resolution-Already Fixed/Doesn't Apply A change in the product has made the issue obsolete. and removed Resolution-Fix Committed Fix is checked in, but it might be 3-4 weeks until a release. labels Feb 4, 2025
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 Resolution-Already Fixed/Doesn't Apply A change in the product has made the issue obsolete. Status-Reproducible This issue was reproduced by a maintainer
Projects
None yet
Development

No branches or pull requests

8 participants