Skip to content

Instantly share code, notes, and snippets.

@grandsilence
Created November 27, 2023 12:10
Show Gist options
  • Save grandsilence/fb8bcf8ea1acb2133537ce724e9c83ba to your computer and use it in GitHub Desktop.
Save grandsilence/fb8bcf8ea1acb2133537ce724e9c83ba to your computer and use it in GitHub Desktop.
Windows AutoHotKey script switch virtual desktops by mouse scroll on taskbar or by Alt+Right / Alt+Left
#If MouseIsInvolumecontrolarea() and not WinActive("ahk_class TscShellContainerClass")
WheelUp::Send {LControl down}#{Right}{LControl up}
WheelDown::Send {LControl down}#{Left}{LControl up}
#If
MouseIsInvolumecontrolarea()
{
CoordMode, Mouse, Screen
MouseGetPos, xpos, ypos
if (ypos > A_ScreenHeight-60 and xpos <= A_ScreenWidth-500)
Return 1
else
Return 0
}
;Switch to right virtual desktop
!Right::
Send, {LControl down}#{Right}{LControl up}
return
;Switch to left virtual desktop
!Left::
Send, {LControl down}#{Left}{LControl up}
return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment