Skip to content

Instantly share code, notes, and snippets.

@NigelThorne
Created April 19, 2012 23:07
Show Gist options
  • Save NigelThorne/2424782 to your computer and use it in GitHub Desktop.
Save NigelThorne/2424782 to your computer and use it in GitHub Desktop.
AutoHotKey Script for CNC style window focus control
; AutoHotKey script file
; press Ctrl+win+1 to make Win+1 give focus to whatever the current window is
; press Ctrl+win+2 to make Win+2 give focus to whatever the current window is
; press Ctrl+win+3 to make Win+3 give focus to whatever the current window is
; press Ctrl+win+4 to make Win+4 give focus to whatever the current window is
; press Ctrl+win+5 to make Win+5 give focus to whatever the current window is
;;;;;;;;;;;;;;;;;CNC KEYS;;;;;;;;;;;;;;;;;;;;;;;;;
CNCKey1 =
^#1:: ;save current focused window to a variable
WinGetActiveTitle, CNCKey1
return
#1:: ;give focus to whichever window was saved in variable
If WinExist(CNCKey1)
WinActivate
MouseMove, 100, 100
return
CNCKey2 =
^#2:: ;save current focused window to a variable
WinGetActiveTitle, CNCKey2
return
#2:: ;give focus to whichever window was saved in variable
If WinExist(CNCKey2)
WinActivate
MouseMove, 100, 100
return
CNCKey3 =
^#3:: ;save current focused window to a variable
WinGetActiveTitle, CNCKey3
return
#3:: ;give focus to whichever window was saved in variable
If WinExist(CNCKey3)
WinActivate
MouseMove, 100, 100
return
CNCKey4 =
^#4:: ;save current focused window to a variable
WinGetActiveTitle, CNCKey4
return
#4:: ;give focus to whichever window was saved in variable
If WinExist(CNCKey4)
WinActivate
MouseMove, 100, 100
return
CNCKey5 =
^#5:: ;save current focused window to a variable
WinGetActiveTitle, CNCKey5
return
#5:: ;give focus to whichever window was saved in variable
If WinExist(CNCKey5)
WinActivate
MouseMove, 100, 100
return
;;;;;;;;;;;;;;;;;CNC KEYS ENDS;;;;;;;;;;;;;;;;;;;;;;;;;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment