-
Notifications
You must be signed in to change notification settings - Fork 0
/
ergodox.srt
225 lines (194 loc) · 5.73 KB
/
ergodox.srt
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
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
;;ergodox template
set mode "c-mode"
set escape_start "{{"
set escape_end "}}"
context file
set comment_start "/**"
set comment_end " */"
set comment_prefix " *"
set DOLLAR "$"
context classdecl
template ergodox-mod
"ergodox mod"
----
/* ----------------------------------------------------------------------------
* ergoDOX layout : QWERTY (modified from the Kinesis layout)
* -----------------------------------------------------------------------------
* Copyright (c) 2012 Ben Blazak <[email protected]>
* Released under The MIT License (MIT) (see "license.md")
* Project located at <https://github.com/benblazak/ergodox-firmware>
* -------------------------------------------------------------------------- */
#include <stdint.h>
#include <stddef.h>
#include <avr/pgmspace.h>
#include "../../../lib/data-types/misc.h"
#include "../../../lib/usb/usage-page/keyboard--short-names.h"
#include "../../../lib-other/pjrc/usb_keyboard/usb_keyboard.h"
#include "../../../lib/key-functions/public.h"
#include "../../../lib/key-functions/private.h"
#include "../matrix.h"
#include "../layout.h"
#include "../../../lib/usb/usage-page/keyboard.h"
#include "../../../keyboard/layout.h"
#include "../../../main.h"
// FUNCTIONS ------------------------------------------------------------------
void kbfun_layer_pop_all(void) {
kbfun_layer_pop_1();
kbfun_layer_pop_2();
kbfun_layer_pop_3();
kbfun_layer_pop_4();
kbfun_layer_pop_5();
kbfun_layer_pop_6();
kbfun_layer_pop_7();
kbfun_layer_pop_8();
kbfun_layer_pop_9();
kbfun_layer_pop_10();
}
// DEFINITIONS ----------------------------------------------------------------
#define kprrel &kbfun_press_release
#define ktog &kbfun_toggle
#define ktrans &kbfun_transparent
#define lpush1 &kbfun_layer_push_1
#define lpush2 &kbfun_layer_push_2
#define lpush3 &kbfun_layer_push_3
#define lpush4 &kbfun_layer_push_4
#define lpush5 &kbfun_layer_push_5
#define lpush6 &kbfun_layer_push_6
#define lpush7 &kbfun_layer_push_7
#define lpush8 &kbfun_layer_push_8
#define lpush9 &kbfun_layer_push_9
#define lpush10 &kbfun_layer_push_10
#define lpop &kbfun_layer_pop_all
#define lpop1 &kbfun_layer_pop_1
#define lpop2 &kbfun_layer_pop_2
#define lpop3 &kbfun_layer_pop_3
#define lpop4 &kbfun_layer_pop_4
#define lpop5 &kbfun_layer_pop_5
#define lpop6 &kbfun_layer_pop_6
#define lpop7 &kbfun_layer_pop_7
#define lpop8 &kbfun_layer_pop_8
#define lpop9 &kbfun_layer_pop_9
#define lpop10 &kbfun_layer_pop_10
#define dbtldr &kbfun_jump_to_bootloader
#define sshprre &kbfun_shift_press_release
#define s2kcap &kbfun_2_keys_capslock_press_release
#define slpunum &kbfun_layer_push_numpad
#define slponum &kbfun_layer_pop_numpad
#define IS_PRESSED main_arg_is_pressed
void kbfun_altgr_press_release(void) {
_kbfun_press_release(IS_PRESSED, KEY_RightAlt);
kbfun_press_release();
usb_keyboard_send();
}
#define saltgrprre &kbfun_altgr_press_release
void local_kbfun_macro00(void) {
_kbfun_press_release(true, _H);
usb_keyboard_send();
_kbfun_press_release(false, _H);
_kbfun_press_release(true, _I);
usb_keyboard_send();
_kbfun_press_release(false, _I);
}
void altx(void) {
_kbfun_press_release(true, KEY_LeftAlt);
usb_keyboard_send();
_kbfun_press_release(true, _X);
usb_keyboard_send();
_kbfun_press_release(false, _X);
usb_keyboard_send();
_kbfun_press_release(false, KEY_LeftAlt);
}
void ctrlx(void) {
_kbfun_press_release(true, KEY_LeftControl);
usb_keyboard_send();
_kbfun_press_release(true, _X);
usb_keyboard_send();
_kbfun_press_release(false, _X);
usb_keyboard_send();
_kbfun_press_release(false, KEY_LeftControl);
}
void ctrlhome(void) {
_kbfun_press_release(true, KEY_LeftControl);
usb_keyboard_send();
_kbfun_press_release(true, _home);
usb_keyboard_send();
_kbfun_press_release(false, _home);
usb_keyboard_send();
_kbfun_press_release(false, KEY_LeftControl);
}
void ctrlend(void) {
_kbfun_press_release(true, KEY_LeftControl);
usb_keyboard_send();
_kbfun_press_release(true, _end);
usb_keyboard_send();
_kbfun_press_release(false, _end);
usb_keyboard_send();
_kbfun_press_release(false, KEY_LeftControl);
}
const uint8_t PROGMEM _kb_layout[KB_LAYERS][KB_ROWS][KB_COLUMNS] = {
{{#LAYERS}}
{{>KEYS:classdecl:erg-layout}}
{{/LAYERS}}
};
const void_funptr_t PROGMEM _kb_layout_press[KB_LAYERS][KB_ROWS][KB_COLUMNS] = {
{{#LAYERS}}
{{>KEYS:classdecl:erg-press}}
{{/LAYERS}}
};
const void_funptr_t PROGMEM _kb_layout_release[KB_LAYERS][KB_ROWS][KB_COLUMNS] = {
{{#LAYERS}}
{{>KEYS:classdecl:erg-release}}
{{/LAYERS}}
};
----
template erg-layout-top :indent
""
sectiondictionary "LAYERS"
----
const uint8_t PROGMEM _kb_layout[KB_LAYERS][KB_ROWS][KB_COLUMNS] = {
{{#LAYERS}}
{{>KEYS:classdecl:erg-layout}}
{{/LAYERS}}
}
const uint8_t PROGMEM _kb_press[KB_LAYERS][KB_ROWS][KB_COLUMNS] = {
{{#LAYERS}}
{{>KEYS:classdecl:erg-press}}
{{/LAYERS}}
}
const uint8_t PROGMEM _kb_release[KB_LAYERS][KB_ROWS][KB_COLUMNS] = {
{{#LAYERS}}
{{>KEYS:classdecl:erg-release}}
{{/LAYERS}}
}
----
bind "e"
template erg-layout :indent
""
sectiondictionary "KEYS"
----
{{#FIRST}}
KB_MATRIX_LAYER({{/FIRST}}{{#NOTLAST}}{{#KEYS}}{{NAME}}, {{/KEYS}}{{/NOTLAST}}{{#LAST}}{{#KEYS}}{{NAME}}{{/KEYS}}),
{{/LAST}}
----
bind "e"
template erg-press :indent
""
sectiondictionary "KEYS"
----
{{#FIRST}}
KB_MATRIX_LAYER({{/FIRST}}{{#NOTLAST}}{{#KEYS}}{{PRESS}}, {{/KEYS}}{{/NOTLAST}}{{#LAST}}{{#KEYS}}{{PRESS}}{{/KEYS}}),
{{/LAST}}
----
bind "e"
template erg-release :indent
""
sectiondictionary "KEYS"
----
{{#FIRST}}
KB_MATRIX_LAYER(
{{/FIRST}}{{#NOTLAST}}{{#KEYS}}{{RELEASE}}, {{/KEYS}}{{/NOTLAST}}{{#LAST}}
{{#KEYS}}{{RELEASE}}{{/KEYS}}
),
{{/LAST}}
----
bind "e"