forked from benblazak/ergodox-firmware
/
colemak--macros-mod.c
164 lines (136 loc) · 7.19 KB
/
colemak--macros-mod.c
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
/* ----------------------------------------------------------------------------
* Copyright (c) 2013 Ben Blazak <benblazak.dev@gmail.com>
* Released under The MIT License (see "doc/licenses/MIT.md")
* Project located at <https://github.com/benblazak/ergodox-firmware>
* ------------------------------------------------------------------------- */
/** description
* A Colemark layout utilizing layers for quick access to macros.
*
* Implements the "layout" section of '.../firmware/keyboard.h'
*/
#include "./common/definitions.h"
// ----------------------------------------------------------------------------
// matrix control
// ----------------------------------------------------------------------------
#include "./common/exec_key.c.h"
// ----------------------------------------------------------------------------
// LED control
// ----------------------------------------------------------------------------
void kb__led__logical_on(char led) {
switch(led) {
case 'N': kb__led__off(1); break; // numlock
case 'C': kb__led__on(2); break; // capslock
case 'S': kb__led__on(3); break; // scroll lock
case 'O': break; // compose
case 'K': break; // kana
};
}
void kb__led__logical_off(char led) {
switch(led) {
case 'N': kb__led__on(1); break; // numlock
case 'C': kb__led__off(2); break; // capslock
case 'S': kb__led__off(3); break; // scroll lock
case 'O': break; // compose
case 'K': break; // kana
};
}
// ----------------------------------------------------------------------------
// keys
// ----------------------------------------------------------------------------
#include "./common/keys.c.h"
KEYS__LAYER__NUM_PUSH(10, 3);
KEYS__LAYER__NUM_POP(10);
// ----------------------------------------------------------------------------
// layout
// ----------------------------------------------------------------------------
#include "./common/matrix.h"
static _layout_t _layout = {
// ............................................................................
MATRIX_LAYER( // BLACK layer 0 : default
// macro, unused,
K, nop,
// left hand ...... ......... ......... ......... ......... ......... .........
esc, 1, 2, 3, 4, 5, grave,
tab, q, w, f, p, g, lpu3l3,
guiL, a, r, s, t, d,
shL2kcap, z, x, c, v, b, ins,
ctrlL, altL, app, altL, ctrlL2l1,
F17, F18,
nop, nop, prScr,
bs, lpupo1l1, del,
// right hand ..... ......... ......... ......... ......... ......... .........
equal, 6, 7, 8, 9, 0, dash,
brktL, j, l, u, y, semicol, bkslash,
h, n, e, i, o, quote,
brktR, k, m, comma, period, slash, shR2kcap,
space, lpu1l1, app, altR, ctrlR,
m_winLt, m_winRt,
m_winUp, nop, nop,
bs, lpu2l2, enter ),
// ............................................................................
MATRIX_LAYER( // RED layer 1 : function keys, navigation
// macro, unused,
K, nop,
// left hand ...... ......... ......... ......... ......... ......... .........
m_altF4, F1, F2, F3, F4, F5, transp,
transp, pageU, home, arrowU, end, ins, transp,
transp, pageD, arrowL, arrowD, arrowR, del,
transp, m_ctrlZ, m_ctrlX, m_ctrlC, m_ctrlV, m_ctrlB, transp,
transp, transp, transp, transp, ctrlL,
transp, transp,
nop, nop, transp,
transp, nop, transp,
// right hand ..... ......... ......... ......... ......... ......... .........
btldr, F6, F7, F8, F9, F10, F11,
F17, ins, home, arrowU, end, transp, transp,
del, arrowL, arrowD, arrowR, transp, transp,
F18, F12, pageU, transp, pageD, transp, transp,
transp, lpo1l1, transp, transp, transp,
m_cad, m_caEnd,
transp, nop, nop,
transp, bs, transp ),
// ............................................................................
MATRIX_LAYER( // BLUE layer 2 : numpad
// macro, unused,
K, nop,
// left hand ...... ......... ......... ......... ......... ......... .........
transp, transp, transp, transp, transp, transp, transp,
transp, transp, transp, transp, transp, transp, transp,
transp, transp, transp, transp, transp, transp,
transp, transp, transp, transp, transp, transp, transp,
transp, transp, transp, transp, transp,
transp, transp,
nop, nop, transp,
transp, transp, transp,
// right hand ..... ......... ......... ......... ......... ......... .........
transp, nop, num, kpDiv, kpMul, kpSub, transp,
transp, esc, kp7, kp8, kp9, kpAdd, transp,
F20, kp4, kp5, kp6, kpAdd, transp,
transp, nop, kp1, kp2, kp3, kpEnter, transp,
kp0, nop, kpDec, kpEnter, transp,
transp, transp,
transp, nop, nop,
transp, lpo2l2, transp ),
// ............................................................................
MATRIX_LAYER( // GREEN layer 3 : qwerty
// macro, unused,
K, nop,
// left hand ...... ......... ......... ......... ......... ......... .........
transp, 1, 2, 3, 4, 5, transp,
transp, q, w, e, r, t, lpo3l3,
transp, a, s, d, f, g,
transp, z, x, c, v, b, transp,
transp, transp, transp, transp, transp,
transp, transp,
nop, nop, transp,
transp, transp, transp,
// right hand ..... ......... ......... ......... ......... ......... .........
transp, 6, 7, 8, 9, 0, transp,
transp, y, u, i, o, p, transp,
h, j, k, l, semicol, transp,
transp, n, m, transp, transp, transp, transp,
transp, transp, transp, transp, transp,
transp, transp,
transp, nop, nop,
transp, transp, transp ),
};