I have a new keyboard that has a split spacebar, backspace on left thumb, space on right thumb. Before getting this keyboard, I was using the short cut Ctrl+Alt+Space to open Launchy. With this new keyboard, I would ALSO like to be able to use Ctrl+Alt+Backspace.
I added the following mapping to AutoHotKey
^!BS::
MsgBox Working
SendInput ^!{Space}
return
If I have certain windows open (say Notpad), pressing Ctrl+Alt+Backspace shows the message box, and then launches the program as expected (the Launchy binding to Ctrl+Alt+Space is controlled by it's own options UI stuff). However, certain windows (e.g. Powershell) seem to swallow the SendInput part, so I will see the message box, but Launchy will not open.
What can I do to get AutoHotKey to send it's commands into the regular message queue instead of to the active window.
Note: I have already tried using various different combinations, but it doesn't seem to work.
Edit: Thanks to MCL for suggesting WinActivate which led me in the right direction. Full details below
Solution:
^!BS::
DetectHiddenWindows, on
WinActivate, Launchy
SendInput ^!{Space}
return
For some reason, certain apps were swallowing the keyboard shortcuts being generated by AHK. So Launchy never received them and didn't launch. However, DetectHiddenWindows and WinActivate followed by the regular keyboard shortcut seems to work.
#UseHook
and#InstallKeybdHook
. Put them at the top of your script. Also, you could consider just running it directly likeRun, path\to\launchy.exe
. – MCL