When pressing "Ctrl + WheelUp/Down" with the pointer under Chrome I would like to focus the Chrome window once and then send the ^+tab hotkey as shown in my code:
Code: Select all
Ctrl & WheelUp::
MouseGetPos,,, WinUMID
WinGetClass, class, ahk_id %WinUMID%
if (InStr(class,"Chrome_WidgetWin_1")) {
send, {Ctrl down}{Shift down}{tab}
send, {Ctrl up}{Shift up}
}
if not (InStr(class,"Chrome_WidgetWin_1")) {
IfWinNotActive, ahk_class Chrome_WidgetWin_1
WinActivate, ahk_class Chrome_WidgetWin_1
}
return
Ctrl & WheelDown::
MouseGetPos,,, WinUMID
WinGetClass, class, ahk_id %WinUMID%
if (InStr(class,"Chrome_WidgetWin_1")) {
send, {Ctrl down}{tab}
send, {Ctrl up}
}
if not (InStr(class,"Chrome_WidgetWin_1")) {
IfWinNotActive, ahk_class Chrome_WidgetWin_1
WinActivate, ahk_class Chrome_WidgetWin_1
}
return
Thanks!