Last active
July 12, 2024 14:59
-
-
Save moshen/4f1dd74229f27f07ab3290c483c96501 to your computer and use it in GitHub Desktop.
Multi Monitor switch
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
; Used to change the monitor source | |
; Requires ControlMyMonitor from https://www.nirsoft.net/utils/control_my_monitor.html | |
setMonitorInputSource(monitor, inputSelectCode, source) | |
{ | |
cmd := "ControlMyMonitor.exe /SetValue " . monitor . " " . inputSelectCode . " " . source | |
Run %cmd% | |
} | |
; Map monitor switch to same keys as synergy keyboard switch | |
$^![:: | |
setMonitorInputSource("\\.\DISPLAY1\Monitor0", 60, 15) | |
Send ^!{[} | |
return | |
$^!]:: | |
setMonitorInputSource("\\.\DISPLAY1\Monitor0", 60, 3) | |
Send ^!{]} | |
return |
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
; Multiple monitors? | |
; Used to change the monitor source | |
; Requires ControlMyMonitor from https://www.nirsoft.net/utils/control_my_monitor.html | |
setMonitorInputSource(monitor, inputSelectCode, source) | |
{ | |
cmd := "ControlMyMonitor.exe /SetValue " . monitor . " " . inputSelectCode . " " . source | |
Run %cmd% | |
} | |
; Map monitor switch to same keys as synergy keyboard switch | |
$^![:: | |
setMonitorInputSource("\\.\DISPLAY1\Monitor0", 60, 15) | |
setMonitorInputSource("\\.\DISPLAY2\Monitor0", 60, 15) | |
Send ^!{[} | |
return | |
$^!]:: | |
setMonitorInputSource("\\.\DISPLAY1\Monitor0", 60, 3) | |
setMonitorInputSource("\\.\DISPLAY2\Monitor0", 60, 3) | |
Send ^!{]} | |
return |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This script requires
ControlMyMonitor.exe
( https://www.nirsoft.net/utils/control_my_monitor.html ) to be in the same folder as the monitorswitch autohotkey script.