Created
August 4, 2022 00:25
-
-
Save lu0/6dc1cb094343f7294cf15a303786b06d to your computer and use it in GitHub Desktop.
Autohotkey script to switch the cursor between displays
This file contains 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
#NoTrayIcon | |
#SingleInstance Force | |
CoordMode, Mouse, Screen | |
; Autohotkey script to move the cursor from the left to the right monitor and viceversa | |
; Currently hardcoded | |
LeftMonitorWidth = 1920 | |
LeftMonitorHeight = 1080 | |
RightMonitoWidth = 2560 | |
RightMonitoHeight = 1440 | |
CenterX = 0 | |
CenterY = 0 | |
; 0 is immediate | |
MouseSpeed = 0 | |
; super + 1 | |
; Move cursor to the left monitor | |
#1:: | |
LeftMonitorMidX := CenterX - (LeftMonitorWidth/2) | |
LeftMonitorMidY := CenterY + (LeftMonitorHeight/2) | |
MouseMove, LeftMonitorMidX, LeftMonitorMidY, MouseSpeed | |
return | |
; super + 2 | |
; Move cursor to the right monitor | |
#2:: | |
RightMonitorMidX := CenterX + (RightMonitorWidth/2) | |
RightMonitorMidY := CenterY + (RightMonitorHeight/2) | |
MouseMove, RightMonitorMidX, RightMonitorMidY, MouseSpeed | |
return |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment