-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMacKeyboard-v2.ahk
123 lines (101 loc) · 2.06 KB
/
MacKeyboard-v2.ahk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
;-----------------------------------------
; Mac keyboard to Windows Key Mappings
;=========================================
; --------------------------------------------------------------
; NOTES
; --------------------------------------------------------------
; ! = ALT
; ^ = CTRL
; + = SHIFT
; # = WIN
;
; Debug action snippet: MsgBox You pressed Control-A while Notepad is active.
GroupAdd("Terminal", "ahk_class mintty")
GroupAdd("Terminal", "ahk_class Vim")
GroupAdd("Terminal", "ahk_class PuTTY")
GroupAdd("Terminal", "ahk_class VanDyke Software - SecureCRT")
GroupAdd("Terminal", "ahk_class VirtualConsoleClass")
GroupAdd("Terminal", "ahk_class TMobaXtermForm")
GroupAdd("Terminal", "ahk_exe WindowsTerminal.exe")
GroupAdd("Terminal", "ahk_exe idea64.exe")
GroupAdd("SingleWindow", "ahk_exe notepad.exe")
GroupAdd("SingleWindow", "ahk_exe cmd.exe")
GroupAdd("HideWhenClose", "ahk_exe WeChat.exe")
GroupAdd("HideWhenClose", "ahk_exe WeChatStore.exe")
GroupAdd("HideWhenClose", "ahk_exe QQ.exe")
GroupAdd("HideWhenClose", "ahk_exe WXWork.exe")
GroupAdd("HideWhenClose", "ahk_exe OUTLOOK.EXE")
InTerminal() {
return WinActive("ahk_group Terminal")
}
InSingleWindow() {
return WinActive("ahk_group SingleWindow")
}
hideWhenClose() {
return WinActive("ahk_group HideWhenClose")
}
; Emacs Key binding
<^a::Send("{Home}")
<^e::Send("{End}")
<^d::Send("{Del}")
CtrlK(){
If InTerminal() {
Send("^k")
} else {
Send("+{End}")
Send("{Del}")
}
}
<^k::CtrlK()
; Ctrl + C
CtrlC() {
If InTerminal() {
Send("^{Ins}")
} else {
Send("^c")
}
}
>^c::CtrlC()
; Ctrl + V
CtrlV() {
If InTerminal() {
Send("+{Ins}")
} else {
Send("^v")
}
}
>^v::CtrlV()
CtrlF(){
Send("{Right}")
}
<^f::CtrlF()
CtrlB(){
Send("{Left}")
}
<^b::CtrlB()
; Command key binding
MetaW(){
if hideWhenClose() {
Send("#{Down}")
} else If InSingleWindow() {
Send("!{F4}")
} else {
Send("^w")
}
}
>^w::MetaW()
MetaD(){
Send("#d")
}
>^d::MetaD()
MetaE(){
Send("#e")
}
>^e::MetaE()
MetaR(){
Send("{F5}")
}
>^r::MetaR()
RCtrl & Tab::AltTab
Shift & Tab::ShiftAltTab
!t::WinSetAlwaysontop(, "A")