-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
[Keyboard Manager] Remapping to App/Mail/Calculator keys does not work #3192
Comments
Hi @tabbed. Do the keys work when you remap them to some other key? For example A->Start App 2 and Start App 2 -> A, and similarly for Start Mail? |
Tested this out. Looks like remapping any key to |
From what we could find, the reason why it doesn't work is because these keys send a command which requires a higher access level than what Keyboard Manager currently has. Setting a UIAccess flag as per this doc https://docs.microsoft.com/en-us/windows/win32/winauto/uiauto-securityoverview could be a workaround which we'll need to verify. |
The reason for remapping to Calc/Mail not working and for Play/Pause and other media keys (#3255 ) is UAC permissions. By default if the correct UAC settings are turned on, PowerToys does not have permission to inject this to the target application (which is the Shell in this case, since Shell will start Calc/Mail) as they are rejected by the UIPI. Running as admin will also not work since that doesn't give it enough privilege to launch Calculator, Mail, etc. This applies to all keys that send APPCOMMAND messages, including Mail, Calc, Media keys, Browser keys, etc. According to the docs, the recommended way of giving your application the permissions, is to set the UIAccess flag in the application manifest, which allows the application to bypass UIPI constraints. This flag is generally used by Assistive applications which require this permission in order to perform certain “Windows” tasks which would otherwise not be possible from an application. This doc has a more detailed explanation about it. As an example this is how it would be set in VS. As an example this is how it would be set in VS. The UIAccess can’t be used for any application, and there are certain security constraints that need to be followed for it to work:
This would be the recommended way for us to fix the issue for KBM, however the following problems exist for us:
Based on the above, I think we probably can’t do this for v1, but the following would be needed for us to do this.
|
@saahmedm @ryanbodrug-microsoft I've mentioned details above about what changes would be required for us to fix this issue and #3255 . Since the changes are PowerToys wide and require alot of work, I think we can't get this for 0.19, we should see whether it would be possible or not for v1 too. |
Is there any info on whether this would be fixed in v1.0 or not? I'm curently using AutoHotkey to create the following remaps:
№1 works great with PowerToys but the others don't. I'd like to switch from AHK to PowerToys as a game server I play in has blocked AHK and I can't join (even though those 3 things are all I use it for aka I don't cheat...). |
dup'ing against #3255 as the tracking issue. |
This seems to have been incorrectly closed or the problem resurfaced? Remmaping the "Mail" key to "StartApp2" should open the calculator on my system but nothing happens: |
I tried remapping "Start App 2" to "Play/Pause Media" whatever I try, I cannot remap the "Start App 2" key to anything. |
Environment
Steps to reproduce
I have a keyboard with "app buttons" - one for the mail app, one for the calculator.
I flipped this keys with the keyboard manager.
Important note:
my "mail app" key is a key on its own.
my "calculator app" key can only be accessed by also pressing the FN key on my keyboard.
Expected behavior
My "mail app" key should start the calculator
My "calculator app" key should start the mail app
Actual behavior
both keys don't start any app
Screenshots
The text was updated successfully, but these errors were encountered: