Skip to content

Instantly share code, notes, and snippets.

@Fmstrat
Last active November 10, 2018 00:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Fmstrat/e78619c2fcc76384149e0ff7831fe728 to your computer and use it in GitHub Desktop.
Save Fmstrat/e78619c2fcc76384149e0ff7831fe728 to your computer and use it in GitHub Desktop.
An AutoHotkey macro that returns 3 monitors to a full extended state after using the nVidia hotkey to exit Surround Mode.
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
; NOTE:
;
; In Windows 10, you can just hit "Win-P" and choose "Extend" instead of using this script.
;
^!+s::
; Open display settings
Send, #i
Sleep 1000
Send, change display settings
Sleep 1000
Send, {Enter}
Sleep 500
Send, {Enter}
Sleep 500
; Go to the monitor selection
Send, {Tab}{Tab}{Tab}{Tab}{Tab}
Send, {Enter}
; Choose duplicate 1 and 2
Send, {Up}{Up}{Enter}
; Keep changes
Sleep 500
Send, {Tab}{Enter}
; Wait for changes, select extend 2.
Sleep 2000
Send, {Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Enter}{Down}{Enter}
; Keep changes
Sleep 500
Send, {Tab}{Enter}
; Wait for changes, select duplicate on 3.
Sleep 2000
Send, {Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Enter}{Up}{Enter}
; Keep changes
Sleep 500
Send, {Tab}{Enter}
; Wait for changes, select extend on 3.
Sleep 2000
Send, {Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Enter}{Down}{Enter}
; Keep changes
Sleep 500
Send, {Tab}{Enter}
Sleep 5000
Send, !{F4}
return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment