Created
October 28, 2022 14:54
-
-
Save RaptorX/8026b9e2bf8f080df3791aa32661c7ee to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$F14:: | |
$F13:: | |
$F15:: | |
; Separate the modifier keys(Ctrl, Alt, Shift) from the hotkey(F4,F6...) | |
RegexMatch(a_thishotkey, "O)^\$(?<mod>[\^+!#]+)?(?<key>.*)$", matched) | |
mod := matched.mod | |
key := matched.key | |
; Translate certain hotkeys to something ProgramName can understand | |
switch matched.key | |
{ | |
case "F13": | |
mod := "" | |
key := "Tab" | |
case "F14": | |
key := "z" | |
case "F15": | |
mod := "+" | |
key := matched.key | |
} | |
if WinExist("ProgramName") | |
{ | |
WinGetTitle, currentTitle, A ; get the currently active window | |
WinActivate, ProgramName ; activate programs window | |
Send, % mod "{" key "}" ; remove the $ from the hotkey before sending it | |
WinActivate %currentTitle% ; reactivate the previous window | |
return | |
} | |
Send, % mod "{" key "}" ; remove the $ from the hotkey before sending it | |
return |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment