-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathnumpad_mode.ahk
178 lines (156 loc) · 3.74 KB
/
numpad_mode.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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
#Requires AutoHotkey v2.0
#SingleInstance Force
; Initialize persistent mode variables
numpad_mode := false
symbols_mode := false
arrow_mode := false
select_mode := false
; Make CapsLock work as a modifier key
*CapsLock:: {
global numpad_mode
numpad_mode := true
}
*CapsLock Up:: {
global numpad_mode
numpad_mode := false
}
; Make Tab work as a modifier key for symbols
*Tab:: {
if GetKeyState("Alt", "P") { ; If Alt is held down
if GetKeyState("Shift", "P") { ; Check if Shift is also held
Send "{Alt Down}{Shift Down}{Tab}" ; Pass through Alt+Shift+Tab
} else {
Send "{Alt Down}{Tab}" ; Pass through Alt+Tab
}
return
}
global symbols_mode
symbols_mode := true
}
*Tab Up:: {
if GetKeyState("Alt", "P") { ; If Alt is still held down
return ; Don't interfere with Alt+Tab
}
global symbols_mode
symbols_mode := false
if (A_PriorKey = "Tab")
Send "{Tab}"
}
; Make semicolon work as a modifier for Arrow Mode
*;:: {
global arrow_mode, select_mode
if GetKeyState("Shift", "P") {
select_mode := true
} else {
arrow_mode := true
}
}
*; Up:: {
global arrow_mode, select_mode
if (select_mode) {
select_mode := false
if (A_PriorKey = ";")
Send ":"
} else {
arrow_mode := false
if (A_PriorKey = ";")
Send ";"
}
}
; Double-Shift for Caps Lock
LShift & RShift::SetCapsLockState !GetKeyState("CapsLock", "T")
RShift & LShift::SetCapsLockState !GetKeyState("CapsLock", "T")
; Basic numpad layout (Dvorak)
#HotIf numpad_mode
m::Send "1"
w::Send "2"
v::Send "3"
h::Send "4"
t::Send "5"
n::Send "6"
g::Send "7"
c::Send "8"
r::Send "9"
Space::Send "0"
; Additional Numpad Mode symbols
a::Send ":"
z::Send "\"
s::Send "["
-::Send "]"
l::Send "/"
/::Send "="
; Basic deletion functions
f::Backspace
d::^Backspace ; Delete word
b::Send "+{Home}{Backspace}" ; Delete to start of line
#HotIf
; Symbols mode (when Tab is held)
#HotIf symbols_mode
m::Send "{!}" ; Shift + 1
w::Send "@" ; Shift + 2
v::Send "{#}" ; Shift + 3
h::Send "$" ; Shift + 4
t::Send "%" ; Shift + 5
n::Send "{^}" ; Shift + 6
g::Send "&" ; Shift + 7
c::Send "*" ; Shift + 8
r::Send "(" ; Shift + 9
Space::Send ")" ; Shift + 0
; Additional Symbols Mode symbols
'::Send ":"
z::Send "|"
s::Send "{{}"
-::Send "{}}"
l::Send "?"
/::Send "{+}"
; Delete forward functions in symbols mode
f::Delete
d::^Delete
b::Send "+{End}{Delete}"
#HotIf
; Arrow Mode (when semicolon is held)
#HotIf arrow_mode
; First level - character movement
g::Left
c::Up
r::Down
l::Right
; Second level - word and paragraph movement
h::^Left ; Word left
t::^Up ; Paragraph up
n::^Down ; Paragraph down
s::^Right ; Word right
; Third level - line and document movement
m::Home ; Start of line
w::^Home ; Top of document
v::^End ; Bottom of document
z::End ; End of line
; Deletion functions
Space::Backspace
f::Delete
d::^Backspace
b::Send "+{Home}{Backspace}"
#HotIf
; Select Mode (when Shift+semicolon is held)
#HotIf select_mode
; First level - character movement with selection
g::+Left
c::+Up
r::+Down
l::+Right
; Second level - word and paragraph movement with selection
h::+^Left ; Select word left
t::+^Up ; Select paragraph up
n::+^Down ; Select paragraph down
s::+^Right ; Select word right
; Third level - line and document movement with selection
m::+Home ; Select to start of line
w::+^Home ; Select to top of document
v::+^End ; Select to bottom of document
z::+End ; Select to end of line
; Deletion functions
Space::Backspace
f::Delete
d::^Backspace
b::Send "+{Home}{Backspace}"
#HotIf