Skip to content

Instantly share code, notes, and snippets.

@j67678
Forked from dvtate/HotCorner.ahk
Last active September 26, 2019 01:27
Show Gist options
  • Save j67678/b31d7eed31dc5879075dba4c99e655d2 to your computer and use it in GitHub Desktop.
Save j67678/b31d7eed31dc5879075dba4c99e655d2 to your computer and use it in GitHub Desktop.
Add a hot-corner to switch desktop in windows 10
; download & install: https://autohotkey.com/
; save this script with the extension ".ahk"
; click on the script to start it and/or set it to launch automatically.
#Persistent
SetTimer, HotCorners, 0
return
HotCorners:
CoordMode, Mouse, Screen
; get desktop size
WinGetPos, X, Y, Xmax, Ymax, Program Manager
; adjust tolerance value if desired
T = 2
MouseGetPos, MouseX, MouseY
; any of these can be used to have a different hot corner
Corner := (MouseY < T and MouseX < T) ; top left
;Corner := (MouseY < T and MouseX > Xmax - T) ; top right
;Corner := (MouseY > Ymax - T and MouseX < T) ; bottom left
;Corner := (MouseY > Ymax - T and MouseX > Xmax - T) ; bottom right
; top-left hot-corner-hit => send super + tab
if Corner {
; ^ = Control and # = Windows Key
Send, ^#{Left}
; prevent retriggering
Sleep, 500
}
return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment