4

I have a couple of shortcuts pinned to my taskbar. I can use the Windows-key plus "1" or "2" etc to launch these.

When using this shortcut, the behaviour seems to be :-

  • if the application is not started, launch it, and make it foreground
  • if the application is launched, but not the foreground window, make it foreground
  • if already the foreground window, minimise it to the taskbar

It's that last behaviour I would like to stop. Ideally, what I want is for the Win-key-plus-number shortcut to always launch or foreground the application, but if it is already the foreground app, do not do anything.

I'm using these shortcuts on a media-centre PC with a programmable remote - and the remote always sends the same key sequence to start the requested application. Which means if you switch away and then back it can end up minimising the application.

Are there any options that can fix this? Or some utility that I could use to launch my application instead?

Edit:

I did find a similar question here: How do I stop the win+# hotkey from minimizing the focused window? But that was asking how to block that keystroke entirely. I want the keystroke to launch/focus the application.

I might just have to dust off my C compiler and write a tiny program to do this :-)

1 Answer 1

1

Are there any options that can fix this? Or some utility that I could use to launch my application instead?

You could install AutoHotkey and write a script that does what you want and assign an arbitrary keyboard shortcut to it.

Example AutoHotkey script

#1::                            ; Keyboard shortcut for Win+1
IfWinExist, ahk_class MozillaWindowClass
{
    WinActivate
}
else
{
    Run, firefox.exe
}
return
1
  • Thanks - Autohotkey looks like it'll be perfect for this.
    – David
    Commented Jun 25, 2016 at 15:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .