microsoft/PowerToys

Keyboard shortcut manager

Jaykul opened this issue ยท 44 comments

I would love a good, lightweight shortcut key manager.

Ideally, I'd like to be able to remap some of the new windows hotkeys (like putting Win+F back to "find" (which is now Win+S for "search") instead of the new "Feedback").

Bonus points if you can tell me who registered which hotkeys, so I can find and kill OneNote when it clobbers the PrtScn button...

I think it would also be awesome if it could kick off executables or scripts like PowerShell or WSF scripts.


saahmedm update:
the beta version of keyboard manager is in the latest release (0.18)!!! ๐Ÿ˜Ž here is the readme for more info: https://github.com/microsoft/PowerToys/tree/master/src/modules/keyboardmanager

orev commented

Would love to see something that allows one to view and possibly alter the system hotkey table. This has been sorely missing from Windows for its whole history, so would be really helpful!

I subscribed to GitHub just to to say it would be wonderful

Massive extra points for some pre-loaded shortcut "themes," like maybe a vim theme and an Emacs theme.

throw in autotype:
ctrl+shift+u => types that long url you have to use all the time

If this is not added, you can try AutoHotKey and get many of the requested features

Bonus points if you can tell me who registered which hotkeys, so I can find and kill OneNote when it clobbers the PrtScn button...

This might be impossible to get perfect since a process sometimes hooks WH_KEYBOARD_LL to get all key inputs, and triggers actions based on whatever it wants. But just being able to see all the processes which have used RegisterHotKey would be phenomenal.

If this is not added, you can try AutoHotKey and get many of the requested features

True, but why should we rely on a third party app when MS should be providing this sort of basic functionality.

for keyboard shortcuts to be useful in Power Toys, Microsoft would have to allow users to remap shortcuts that Windows tools take over, like putting Shift-Win-S back to OneNote, but Windows blocks those reassignments, even in the registry.

I want to remap Ctrl+C -> Win+C to use easy use my mac keyboard.

+1

ecc86 commented

Also really great would be to export/import custom keymaps to share between devices.

Also really great would be to export/import custom keymaps to share between devices.

I like it.
Like a JSON file which can be synced via cloud.

+1

Wow, I just came in here thinking that it would be just me wanting that. Of course, I was thinking of something very specific, but hey, who am I to argue with an even better idea?
For the record, I wanted a PowerToy giving users the ability to remap the "change keyboard language" shortcut, which only accepts CTRL+SHIFT, ALT+LEFT_SHIFT, [GRAVE ACCENT `] or nothing!
For us people who type a lot and between languages, the ability to set one single dedicated key would be God-sent.
Of course, even more functionality would be even better.

xfirf commented

Pressing and holding "Windows" should show the available shortcuts of the current active application. E.g. OneNote is active I can see all shortcuts available in OneNote. When switchting to Chrome I should see all Chrome-shortcuts while holding "Windows"

If you will add the option to remap ALL the keyboard softwarely, to the system (not as an addon like ahk, that if an app with high hierarchy crashes, the custom-keystrokes stuck) permanently, that will be Great!

adding in shortcut guide as well here as the two PowerToys work together.

SharpKeys is one tool on Windows that does this (https://github.com/randyrants/sharpkeys) and was crucial for when running bootcamp to get your laptop keyboard to run like a Windows Keyboard for remapping.

Mac has a similar tool, https://github.com/pqrs-org/Karabiner-Elements that was important for the same reason when using a Windows style keyboard and having it map like a Mac keyboard.

There are tons of use cases past these two.

  • a nice to have requirement here would be to have changes instantly be reflected without a restart
  • movable to different computers
  • per-keyboard ability to map (when you have a laptop and a full keyboard, happens when you bootcamp a mac and use a microsoft keyboard for instance)

Other applications that do this

Other general ideas

  • Make sure to rationalize all the shortcuts in PowerToys itself
  • Make sure any Windows key related shortcuts that are changed show up on the Windows Key Shortcut Guide (#179)
  • Support the idea of profiles that people can generate and share
    • Make a Mac to Windows shortcut profile to make it easier for Mac folks to land on Windows
  • Create a marketplace of the top profiles
  • Allow others to submit profiles to the marketplace

the hardest thing for keyboard remappers is to know what keys are present on the keyboard and to present the keys that can be remapped to. Even with SharpKeys it can be hard to know which key you are remapping when it's not a key that's on every keyboard, and getting a canonical list of keys with helpful descriptions would be useful. (eg right Alt and Alt Gr are not always the same, the right mouse/Windows context key has a completely inexplicable name)

remapping keyboard shortcuts on Windows currently requires registry access and so is blocked on Windows S; any options for changing that?

remapping keyboard shortcuts on Windows currently requires registry access and so is blocked on Windows S; any options for changing that?

we have ideas :)

the hardest thing for keyboard remappers is to know what keys are present on the keyboard and to present the keys that can be remapped to. Even with SharpKeys it can be hard to know which key you are remapping when it's not a key that's on every keyboard, and getting a canonical list of keys with helpful descriptions would be useful. (eg right Alt and Alt Gr are not always the same, the right mouse/Windows context key has a completely inexplicable name)

For those wondering, AltGR -> https://en.wikipedia.org/wiki/AltGr_key Most would still reference this as Right side alt :)

Another common scenarios are a Surface Laptop 2 does not have a right ctrl but a Surface Ergo keyboard does have a right ctrl

Bonus points if you can tell me who registered which hotkeys, so I can find and kill OneNote when it clobbers the PrtScn button...

What I'm looking for is a tool that picks up shortcut key assignments in Windows shortcut files. I have one particular app that recreates it's default desktop shortcut every time I update it. The problem is it uses a shortcut combo I use constantly in Word. But since the shortcut is a Windows "system" shortcut I keep launching the stupid app. I don't even see it all the time because it opens in the background. So I have to remember to remove the keyboard shortcut from the newly recreated desktop shortcut. But I don't always remember.
.
So if the PowerToy can pick it up, showing 'ALL' shortcuts honored by Windows, where they are defined. If the tool can reach out and directly change the shortcuts too, that would be even better. But by simply pointing me to the right place it would save a huge amount of time, and hair pulling.

Hey friends, we just want to make sure everyone saw that we have a PM Spec for the feature. #1112 is the pull request. Please add in any comments there for consideration. @saahmedm did a ton of great work here and we want to be sure we're prioritizing the correct things and not missing anything.

For those wondering, AltGR -> https://en.wikipedia.org/wiki/AltGr_key Most would still reference this as Right side alt :)
E0_2038
and context key is E0_5D
and I have to keep a screenshot of these in my 'new PC setup list' to copy from every time!

For those wondering, AltGR -> https://en.wikipedia.org/wiki/AltGr_key Most would still reference this as Right side alt :)
E0_2038
and context key is E0_5D
and I have to keep a screenshot of these in my 'new PC setup list' to copy from every time!

thanks for the messages, not sure we're clear on the AltGr feedback however! the team (@crutkas) is going to contact @marypcbuk and better understand scenario directly

Swoy commented

This looks awesome!

While the spec contain a lot of good features, I would like to include a few ideas of my own to the mix, for your consideration:

Tapable Keys

Assign tapping actions to keys. We can potentially allow for cadet style typing this way, which is something I'd wanted natively for years. Right now I need to use custom firmwares with custom keyboards. But it is not always an option, so it would be most welcome. And since the spec already mentions app-specific shortcuts, these would be great to use in text-editors.

Examples:

  1. Assign single tap to L/R shift, so as to type [ and ] and double tap them for { and }. And maybe tapping on L/R Ctrl for ( and ).
  2. Tap-dancing to perform a macro when a key has been tapped a set amount of times. (Just like Sticky Keys work with 5xShift today).

This can also provide a way to assign leader keys (much like how Fn works today, but with a OneShot style behaviour.

Examples:

  1. Set Print Screen as OneShot, and then pressing 1, 2 or 3 for screenshot Window, Screen or Defined area, respectively.
  2. OneShot Fn key to open a temporary layer (more below). where you can assign new commands to the entire keyboard. Perfect for those hard to remember ALT-000 code symbols.

Key layers

Assign key layers that can be reached by using a specified mod key + number row would greatly improve workflows and give almost an endless amount of hotkeys to those out there who currently use several keyboards to achieve this.

Is this doable?

@Swoy good idea, i doubt that would be in a v1. Once we have a better base for the remapper, happy to have community contributions for it.

For the Linux profile, I would propose the following shortcuts for WSL and desktop Linux users. This list is not exhaustive, it is merely a starting point for the types of shortcuts that could be included.

These shortcuts are influenced by the GNOME desktop environment and bash shell. GNOME at the moment the default Linux desktop on the most popular Linux distributions so it makes a logical starting point.

I would propose that eventually users be able to create, share, and load their own keyboard shortcut profiles. This way users could create profiles for the shortcuts used by KDE Plasma, MATE, and i3.

Linux Windows

Workspace Management

Super+[PgUp/Down] = Win+Ctrl+[Left/Right]
Note: Linux does not
create or delete workspaces.

Window Management

Ctrl+Alt+D = Win+M
Super+H = Win+[Down]

Desktop

Super+M = Win+A
PrtScn = Win+Shift+S

Accessibility

Super+Alt+8 = Win+Plus
Super+Alt+Plus = Win+Plus
Super+Alt+Minus = Win+Minus
Super+Alt+A = Win+Ctrl+Enter

Terminal

Ctrl+A = Home
Ctrl+E = End
Alt+B = Ctrl+Left
Ctrl+F = Ctrl+Right
Ctrl+P = Up
Ctrl+N = Down

Miscellaneous

Alt+F2 = Win+R
Shift+Ctrl+C = Ctrl+C
Shift+Ctrl+V = Ctrl+V
Ctrl+_ = Ctrl +Z

Already Similar

Win/Super+[Left/Right]
Win/Super+Shift+[Left/Right]
Alt+Tab
Win/Super
Win/Super+L
Ctrl+C
F11

Gnome Keyboard Shortcuts
KDE Keyboard Shortcuts
i3 Keyboard Shortcuts

@sirredbeard great work and thank you for all the links! this is a v valuable starting point

quick update y'all! we have a preliminary design, in gif form, that we'd love for you to check out: here

quick suggestion: the GIF would be easier to comment on if it was broken up into separate GIFs for the different steps/features it's showing. I kept getting lost on when it was still the same feature and when it was a new one. love the visual representation of the keys though!

quick suggestion: the GIF would be easier to comment on if it was broken up into separate GIFs for the different steps/features it's showing. I kept getting lost on when it was still the same feature and when it was a new one. love the visual representation of the keys though!

this is a great suggestion, I've added smaller gifs at each step, if you scroll lower to the specific sections! thanks mary ๐Ÿ‘

@saahmedm Great spec!

I was wondering, can't we simplify the 'key remap' / 'shortcut remap' inputscreens by using a simple dialog? The spec shows the user would press a button on the settings page to move to a new screen.

I'd like to propose a dialog that allows the user to enter the original key and updated key out of the editable ComboBox. Saving it would add it to the keystrokes ListView. Remapped buttons can be deleted there. Clicking on a ListView item would open the same dialog with the correct values pre-selected. This would reduce complexity and an additional navigation step for the end user. (For the shortcut remapping we can use something similar for consistency).

Here's some working XAML to illustrate:

KeyboardRemappingdialog

Thoughts?

@niels9001. i think in the future that could be do-able but due to how things were developed, it had to be a separate app like FZ Editor.

Swoy commented

Can't wait for this to hit the shelf!
One thing that struck me, those list views in Main UI seems kind of wasteful with the available space. Wouldn't it be better to compact the list items a bit? This could be subjective, but I find it hard to get an overview when I have to scroll a lot to see what i've added as key substitutes. In my mind, each of those list items could be half the height they currently have.

Quick question: does anybody know if the back-tab button is implemented or even implementable on Windows? Of course, back-tab would be the same functionality as pressing Shift-Tab but I'd like to know if I can design a custom keyboard (which I am) with a back-tab button right next to the plain tab and actually have it work. Of course, that could/would have to do with the Keyboard Shortcut Manager, as it would also have to support not only the "regular" keys which are found on a normal keyboard, but literally everything, including all the media buttons, special buttons like "Mail" key, "Calculator" key, "My Computer" key and also F13-F24, Power, Sleep, Eject, etc.

@skagon for our v1 we won't be able to map shortcuts (shift-tab) to single keys. We are looking into this for later versions however. also, we will support special keys like mail, calculator, F13-F24 etc. Keys like Power, Eject, Sleep though are not considered virtual keys and wouldn't be supported in our v1.

if we did have support for shortcut-to-key mapping in our v2/v3, you would be able to map shift-tab to any key, creating a "back-tab" button.

@saahmedm So, the v1 of the Keyboard Manager would only do what can be done through the registry? As in, literally remap one key to another and only that?

@skagon no! our v1 would be able to the following, briefly:

  • map key-to-key (through the registry)
  • map key-to-key (in-process, not touching registry / no requirement to reboot) *
  • map shortcut-to-shortcut for the OS (So changing Ctrl-Z to Ctrl-A) *
  • map shortcut-to-shortcut for specific apps as well (changing Ctrl-Shift-N in Edge to Ctrl-N) *

*these work only when PT is running

for detailed information here is the spec

hi everyone! 0.18 is LIVE!!!! ๐ŸŽ‰๐Ÿ‘€ here is our beta keyboard manager โœ”. Keep in mind, this is not the finished product and we only have basic functionality here and will be adding more (app specific shortcuts, profiles, etc) for our V1 release. Thanks everyone for their input to get this far, we'll be asking for more feedback as you use this version to help us deliver an even better experience!!

https://github.com/microsoft/PowerToys/releases

I'd love to see a global hotkey manager for Windows 11 Developer Preview, in PowerToys. The existing "Keyboard Manager" feature in PowerToys 0.59.0 doesn't really do what I'd expect. It only remaps keys and simple shortcuts.

See for example this utility: https://www.nirsoft.net/utils/hot_keys_list.html