Last active
June 24, 2020 06:22
-
-
Save seperman/8064659 to your computer and use it in GitHub Desktop.
Auto Hot Key configs to make Windows shortcuts/keyboard like Mac
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
; IMPORTANT INFO ABOUT GETTING STARTED: Lines that start with a | |
; semicolon, such as this one, are comments. They are not executed. | |
; This script has a special filename and path because it is automatically | |
; launched when you run the program directly. Also, any text file whose | |
; name ends in .ahk is associated with the program, which means that it | |
; can be launched simply by double-clicking it. You can have as many .ahk | |
; files as you want, located in any folder. You can also run more than | |
; one .ahk file simultaneously and each will get its own tray icon. | |
; SAMPLE HOTKEYS: Below are two sample hotkeys. The first is Win+Z and it | |
; launches a web site in the default browser. The second is Control+Alt+N | |
; and it launches a new Notepad window (or activates an existing one). To | |
; try out these hotkeys, run AutoHotkey again, which will load this file. | |
;#z::Run www.autohotkey.com | |
^!n:: | |
IfWinExist Untitled - Notepad | |
WinActivate | |
else | |
Run Notepad | |
return | |
;LWin & x::Send ^x ;cut | |
;LWin & c::Send ^c ;copy | |
;LWin & v::Send ^v ;paste | |
;LWin & a::send ^a ;select all | |
;LWin & z::send ^z ;undo | |
;LWin & y::send ^y ;redo | |
;LWin & s::send ^s ;redo | |
;LWin & f::send ^f ;find | |
;LWin & d::send ^d | |
;LWin & g::send ^g | |
;LWin & k::send ^k | |
;LWin & l::send ^l | |
;LWin & Tab::AltTab | |
;Lwin::send {Alt} | |
!x::Send ^x ;cut | |
!c::Send ^c ;copy | |
!b::Send ^b ;copy | |
!v::Send ^v ;paste | |
!a::send ^a ;select all | |
!z::send ^z ;undo | |
!y::send ^y ;redo | |
!s::send ^s ;redo | |
!f::send ^f ;find | |
!k::send ^k | |
!d::send ^d | |
CapsLock::send {ctrl} ; CapsLock | |
PgUp:: return ; Page up | |
PgDn:: return ; page down | |
Volume_Up:: send {Alt Down}{PrintScreen}{Alt Up} | |
Volume_down:: send {Insert} | |
#`:: ; Next window | |
WinGetClass, ActiveClass, A | |
WinSet, Bottom,, A | |
WinActivate, ahk_class %ActiveClass% | |
return | |
#^`:: ; Last window | |
WinGetClass, ActiveClass, A | |
WinActivateBottom, ahk_class %ActiveClass% | |
return | |
!`:: ; Next window | |
WinGetClass, ActiveClass, A | |
WinGet, WinClassCount, Count, ahk_class %ActiveClass% | |
IF WinClassCount = 1 | |
Return | |
Else | |
WinGet, List, List, % "ahk_class " ActiveClass | |
Loop, % List | |
{ | |
index := List - A_Index + 1 | |
WinGet, State, MinMax, % "ahk_id " List%index% | |
if (State <> -1) | |
{ | |
WinID := List%index% | |
break | |
} | |
} | |
WinActivate, % "ahk_id " WinID | |
return | |
!^`:: ; Last window | |
WinGetClass, ActiveClass, A | |
WinGet, WinClassCount, Count, ahk_class %ActiveClass% | |
IF WinClassCount = 1 | |
Return | |
Else | |
WinGet, List, List, % "ahk_class " ActiveClass | |
Loop, % List | |
{ | |
index := List - A_Index + 1 | |
WinGet, State, MinMax, % "ahk_id " List%index% | |
if (State <> -1) | |
{ | |
WinID := List%index% | |
break | |
} | |
} | |
WinActivate, % "ahk_id " WinID | |
return | |
;----------------- Alt + tab ------------------------------ | |
; Note: From now on whenever you run AutoHotkey directly, this script | |
; will be loaded. So feel free to customize it to suit your needs. | |
; Please read the QUICK-START TUTORIAL near the top of the help file. | |
; It explains how to perform common automation tasks such as sending | |
; keystrokes and mouse clicks. It also explains more about hotkeys. |
Nice script!
I created one similar to switch between open Windows but with some small improvements like it works besides regular Window Apps with Chrome Shortcuts and Chrome Apps.
Also, I have another script that could work well in tandem with this one because you will be able to Open, Restore or Minimize (if it is already opened) the desired Apps, using the shortcuts key (hotkeys) that you want to set. Examples:
F7:: OpenOrShowAppBasedOnExeName("C:\Windows\System32\SnippingTool.exe")
F8:: OpenOrShowAppBasedOnWindowTitle("Gmail", "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe --app=https://mail.google.com/mail/")
Feel free to check my repo and give me your thoughts ;)
https://github.com/JuanmaMenendez/AutoHotkey-script-Open-Show-Apps
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
index := List - A_Index + 1
in "last window" should be