microsoft / PowerToys

Windows system utilities to maximize productivity
MIT License
111.24k stars 6.54k forks source link

Map a Windows global shortcut to a shortcut for a particular application #8153

Open gordonwatts opened 3 years ago

gordonwatts commented 3 years ago

Map a keyboard chord from the Windows level to a chord for a specific program.

As an example. map "WIN+Ctrl+E" to send a "Ctrl+N" to Outlook. This would allow me from any context to open a new email window.

This would replace my current procedure of first starting PowerToys launcher, typing "< outlook", selecting the proper outlook window, and then typing "Ctrl+N". Or use the mouse to bring Outlook to the front from the taskbar, and then typing "Ctrl+N".


If you'd like to see this feature implemented, add a 👍 reaction to this post.

Jay-o-Way commented 3 years ago

First of all, what version of PowerToys are you using at the moment? Maybe I'm not fully understanding something, but in the Keyboard manager you can assign a specific remap of a hotkey to a specific program.

gordonwatts commented 3 years ago

That means the mapping only works in that program. So I'd have to have outlook open and in front for that.

I'd like to have all my outlook windows minimized, and then hit the global shortcut Win+Ctl+E and have powertoys shoot it at the outlook program which would then open the new email.

Perhaps my "any context" is not specific enough in the description. Happy to take suggestions to make it more clear.

Jay-o-Way commented 3 years ago

Okay I understand. Sounds tricky though, if you catch a hotkey in the global OS environment and send it to one app, that means you'd also have to re-send it, or else no other apps can receive this hotkey anymore.

gordonwatts commented 3 years ago

That is correct, and an excellent point. That would be a "feature" of my suggestion here.

Here is what happens now:

  1. On virtual desktop 3 in the middle of vs code. Need to send an email.
  2. Use Atl-Space to bring up powertorys launcher
  3. Type "< outlook"
  4. Make sure that the proper thing was picked, and hit return.
  5. I'm switched to desktop #1 (where outlook is)
  6. Hit Ctrl+N to bring up a new email windows
  7. Use standard techniques to move the window back to desktop 2
  8. Write email with my code window just next to it.

This idea here was a way to cut out a number of those steps.

Could another option be a new power toys launcher? For commands? Then I could do

  1. On virtual desktop 3 in the middle of vs code. Need to send an email.
  2. Use Atl-Space to bring up powertorys launcher
  3. Type "< new mail"
  4. That sends the previously configured keystrokes "Crtl+N" to outlook
  5. A new window opens up (there are issues of what desktop, but this is already faster than what I have now).

Maybe I'm trying to accidentally solve a more general problem?

Thanks for the input!!

enricogior commented 3 years ago

I labeled this as new-powertoy / run-plugin because I don't think it would be a good fit for KBM, since it would open the door to a lot of problematic edges case. On the other hand it would be cool to have a new action key in PT Run to run automated tasks (there might be already an issue with a similar suggestion).

gordonwatts commented 3 years ago

I've been rolling this over in my head trying to figure out what is the "right" way to do this. The discussion above has been very useful to help me think beyond my own vision of how this works. I'm hoping over the next week or two write some powershell scripts, create short cut associations for opening the files/scripts, and see how well that works to get a better feel for what I think I want. ;-)

In short - sure - go ahead. I do not think this idea is fully understood yet to call it a new powertoy or even if it is reasonable to be in PowerToys.

If you want, you can close the issue for now, and I will request a re-open (or similar) if I make progress that is close enough to what I've proposed here. Especially if what I want turns out to already be something that someone else has asked for.

crutkas commented 2 years ago

I'd label this outside PT Run, this is a concept, not an implementation. I would have honestly pointed this at KBM instead as well