-
Notifications
You must be signed in to change notification settings - Fork 0
/
mac.ahk
109 lines (103 loc) · 2.57 KB
/
mac.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
; This script assumes that Alt and Ctrl characters have been swapped using a third-party tool
; -----KEY GUIDE-----
; # Win. (the key with the Windows logo) therefore `Send #e` would hold down Win and then press E.
; + Shift. For example, `Send, +abC` would send the text "AbC", and `Send, !+a` would press Alt+Shift+A.
; ^ Alt (because of remapkey). For example, `Send, This is text!a` would send the keys "This is text" and then press Alt+A. Note: !A produces a different effect in some programs than !a. This is because !A presses Alt+Shift+A and !a presses Alt+A. If in doubt, use lowercase.
; ! Ctrl (because of remapkey). For example, `Send, ^!a` would press Ctrl+Alt+A, and Send, ^{Home} would send Ctrl+Home. Note: ^A produces a different effect in some programs than ^a. This is because ^A presses Ctrl+Shift+A and ^a presses Ctrl+A. If in doubt, use lowercase.Sends Ctrl. For example, Send, ^!a would press Ctrl+Alt+A, and Send, ^{Home} would send Ctrl+Home. Note: ^A produces a different effect in some programs than ^a. This is because ^A presses Ctrl+Shift+A and ^a presses Ctrl+A. If in doubt, use lowercase.
; & An ampersand may be used between any two keys or mouse buttons to combine them into a custom hotkey.
; #Warn ; Uncomment to 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.
; Uncomment for key history
; #InstallKeybdHook
; KeyHistory
; App and tab switching
Ctrl & Tab::AltTab
!Tab::Send("^{Tab}")
; Quit the active app
^q::Send("!{f4}")
; Insertion point movement
^Left::
{
Suspend(true)
Send("{Home}")
Suspend(false)
return
}
^Right::
{
Suspend(true)
Send("{End}")
Suspend(false)
return
}
^Up::
{
Suspend(true)
Send("^{Home}")
Suspend(false)
return
}
^Down::
{
Suspend(true)
Send("^{End}")
Suspend(false)
return
}
+^Left::
{
Suspend(true)
Send("+{Home}")
Suspend(false)
return
}
+^Right::
{
Suspend(true)
Send("+{End}")
Suspend(false)
return
}
+^Up::
{
Suspend(true)
Send("+^{Home}")
Suspend(false)
return
}
+^Down::
{
Suspend(true)
Send("+^{End}")
Suspend(false)
return
}
#Left::
{
Suspend(true)
Send("^{Left}")
Suspend(false)
return
}
#Right::
{
Suspend(true)
Send("^{Right}")
Suspend(false)
return
}
+#Left::
{
Suspend(true)
Send("+^{Left}")
Suspend(false)
return
}
+#Right::
{
Suspend(true)
Send("+^{Right}")
Suspend(false)
return
}