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
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
|
/* Copyright 2021 @daliusd
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include QMK_KEYBOARD_H
#include "flow.h"
// Each layer gets a name for readability, which is then used in the keymap matrix below.
// The underscores don't mean anything - you can have a layer called STUFF or any other name.
// Layer names don't all need to be of the same length, obviously, and you can also skip them
// entirely and just use numbers.
enum layers {
_QWERTY,
_SYM,
_NAV,
_MISC,
_TMUX,
_MOUSE,
_FUNC,
_LT_MAC,
_LT_LINUX,
};
enum custom_keycodes {
TM_NEXT = SAFE_RANGE,
TM_PREV,
TM_LEFT,
TM_RIGHT,
TM_NEW,
TM_SLCT,
TM_SRCH,
TM_URL,
OS_MISC,
OS_TMUX,
OS_FUNC,
LT_OSLNX,
};
// Shortcut to make keymap more readable
#define L_NAV MO(_NAV)
#define L_SYM MO(_SYM)
#define L_MOUSE MO(_MOUSE)
#define K_PRINT (QK_LCTL | QK_LSFT | QK_LGUI | KC_4)
#define K_VIDEO (QK_LSFT | QK_LGUI | KC_5)
// flow_config should correspond to following format:
// * layer keycode
// * modifier keycode
const uint16_t flow_config[FLOW_COUNT][2] = {
{L_NAV, KC_LALT},
{L_NAV, KC_LGUI},
{L_NAV, KC_LCTL},
{L_SYM, KC_RCTL},
{L_SYM, KC_RGUI},
{L_SYM, KC_RALT},
};
const uint16_t flow_layers_config[FLOW_LAYERS_COUNT][2] = {
{OS_MISC, _MISC},
{OS_TMUX, _TMUX},
{OS_FUNC, _FUNC},
};
// Unicode characters
enum unicode_names {
SNEK,
EURO,
LT_S_A,
LT_L_A,
LT_S_C,
LT_L_C,
LT_S_E1,
LT_L_E1,
LT_S_E2,
LT_L_E2,
LT_S_I,
LT_L_I,
LT_S_S,
LT_L_S,
LT_S_U1,
LT_L_U1,
LT_S_U2,
LT_L_U2,
LT_S_Z,
LT_L_Z,
LT_OB,
LT_CB,
};
const uint32_t PROGMEM unicode_map[] = {
[SNEK] = 0x1F40D, // ๐
[EURO] = 0x20ac, // โฌ
[LT_S_A] = 0x105, // ฤ
[LT_L_A] = 0x104, // ฤ
[LT_S_C] = 0x10d, // ฤ
[LT_L_C] = 0x10c, // ฤ
[LT_S_E1] = 0x119, // ฤ
[LT_L_E1] = 0x118, // ฤ
[LT_S_E2] = 0x117, // ฤ
[LT_L_E2] = 0x116, // ฤ
[LT_S_I] = 0x12f, // ฤฏ
[LT_L_I] = 0x12e, // ฤฎ
[LT_S_S] = 0x161, // ลก
[LT_L_S] = 0x160, // ล
[LT_S_U1] = 0x173, // ลณ
[LT_L_U1] = 0x172, // ลฒ
[LT_S_U2] = 0x16b, // ลซ
[LT_L_U2] = 0x16a, // ลช
[LT_S_Z] = 0x17e, // ลพ
[LT_L_Z] = 0x17d, // ลฝ
[LT_OB] = 0x201e, // โ
[LT_CB] = 0x201c, // โ
};
#define K_SNEK X(SNEK)
#define K_EURO X(EURO)
#define K_LT_A XP(LT_S_A, LT_L_A)
#define K_LT_AU X(LT_L_A)
#define K_LT_C XP(LT_S_C, LT_L_C)
#define K_LT_CU X(LT_L_C)
#define K_LT_E1 XP(LT_S_E1, LT_L_E1)
#define K_LT_E1U X(LT_L_E1)
#define K_LT_E2 XP(LT_S_E2, LT_L_E2)
#define K_LT_E2U X(LT_L_E2)
#define K_LT_I XP(LT_S_I, LT_L_I)
#define K_LT_IU X(LT_L_I)
#define K_LT_S XP(LT_S_S, LT_L_S)
#define K_LT_SU X(LT_L_S)
#define K_LT_U1 XP(LT_S_U1, LT_L_U1)
#define K_LT_U1U X(LT_L_U1)
#define K_LT_U2 XP(LT_S_U2, LT_L_U2)
#define K_LT_U2U X(LT_L_U2)
#define K_LT_Z XP(LT_S_Z, LT_L_Z)
#define K_LT_ZU X(LT_L_Z)
#define K_LT_OB X(LT_OB)
#define K_LT_CB X(LT_CB)
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_QWERTY] = LAYOUT(
//โโโโโโโโโโฌโโโโโโโโโฌโโโโโโโโโฌโโโโโโโโโฌโโโโโโโโโ โโโโโโโโโโฌโโโโโโโโโฌโโโโโโโโโฌโโโโโโโโโฌโโโโโโโโโ
KC_Q ,KC_W ,KC_E ,KC_R ,KC_T, KC_Y ,KC_U ,KC_I ,KC_O ,KC_P ,
//โโโโโโโโโโผโโโโโโโโโผโโโโโโโโโผโโโโโโโโโผโโโโโโโโโค โโโโโโโโโโผโโโโโโโโโผโโโโโโโโโผโโโโโโโโโผโโโโโโโโโค
KC_A ,KC_S ,KC_D ,KC_F ,KC_G , KC_H ,KC_J ,KC_K ,KC_L ,KC_SCLN ,
//โโโโโโโโโโผโโโโโโโโโผโโโโโโโโโผโโโโโโโโโผโโโโโโโโโค โโโโโโโโโโผโโโโโโโโโผโโโโโโโโโผโโโโโโโโโผโโโโโโโโโค
KC_Z ,KC_X ,KC_C ,KC_V ,KC_B , KC_N ,KC_M ,KC_COMM ,KC_DOT ,KC_SLSH,
//โโโโโโโโโโดโโโโโโโโโดโโโโโโโโโดโโโโโฌโโโโดโโโโโฌโโโโผโโโโโโโโโ โโโโโโโโโโผโโโโฌโโโโโดโโโโฌโโโโโดโโโโโโโโโดโโโโโโโโโดโโโโโโโโโ
L_NAV , KC_SPC , KC_LSFT , L_SYM
// โโโโโโโโโโ โโโโโโโโโโ โโโโโโโโโโ โโโโโโโโโโ
),
[_SYM] = LAYOUT(
//โโโโโโโโโโฌโโโโโโโโโฌโโโโโโโโโฌโโโโโโโโโฌโโโโโโโโโ โโโโโโโโโโฌโโโโโโโโโฌโโโโโโโโโฌโโโโโโโโโฌโโโโโโโโโ
KC_EXLM ,KC_AT ,KC_HASH ,KC_DLR ,KC_PERC , KC_CIRC ,KC_AMPR ,KC_ASTR ,KC_LPRN ,KC_RPRN ,
//โโโโโโโโโโผโโโโโโโโโผโโโโโโโโโผโโโโโโโโโผโโโโโโโโโค โโโโโโโโโโผโโโโโโโโโผโโโโโโโโโผโโโโโโโโโผโโโโโโโโโค
XXXXXXX ,KC_GRV ,KC_LBRC ,KC_RBRC ,KC_PLUS , KC_MINS ,KC_PIPE ,KC_RCTL ,KC_RGUI ,KC_RALT ,
//โโโโโโโโโโผโโโโโโโโโผโโโโโโโโโผโโโโโโโโโผโโโโโโโโโค โโโโโโโโโโผโโโโโโโโโผโโโโโโโโโผโโโโโโโโโผโโโโโโโโโค
KC_DEL ,KC_BSPC ,KC_LCBR ,KC_RCBR ,KC_EQL , KC_UNDS ,KC_QUOT ,KC_DQT ,OS_MISC ,KC_BSLS ,
//โโโโโโโโโโดโโโโโโโโโดโโโโโโโโโดโโโโโฌโโโโดโโโโโฌโโโโผโโโโโโโโโ โโโโโโโโโโผโโโโฌโโโโโดโโโโฌโโโโโดโโโโโโโโโดโโโโโโโโโดโโโโโโโโโ
_______ , _______ , _______ , XXXXXXX
// โโโโโโโโโโ โโโโโโโโโโ โโโโโโโโโโ โโโโโโโโโโ
),
[_NAV] = LAYOUT(
//โโโโโโโโโโฌโโโโโโโโโฌโโโโโโโโโฌโโโโโโโโโฌโโโโโโโโโ โโโโโโโโโโฌโโโโโโโโโฌโโโโโโโโโฌโโโโโโโโโฌโโโโโโโโโ
KC_1 ,KC_2 ,KC_3 ,KC_4 ,KC_5 , KC_6 ,KC_7 ,KC_8 ,KC_9 ,KC_0 ,
//โโโโโโโโโโผโโโโโโโโโผโโโโโโโโโผโโโโโโโโโผโโโโโโโโโค โโโโโโโโโโผโโโโโโโโโผโโโโโโโโโผโโโโโโโโโผโโโโโโโโโค
KC_LALT ,KC_LGUI ,KC_LCTL ,KC_TAB ,KC_ENT , KC_LEFT ,KC_DOWN ,KC_UP ,KC_RIGHT,KC_PGUP ,
//โโโโโโโโโโผโโโโโโโโโผโโโโโโโโโผโโโโโโโโโผโโโโโโโโโค โโโโโโโโโโผโโโโโโโโโผโโโโโโโโโผโโโโโโโโโผโโโโโโโโโค
KC_LSFT ,KC_BSPC ,KC_ESC ,KC_TILDE,OS_TMUX , OS_FUNC ,L_MOUSE ,KC_COMM ,KC_DOT ,KC_PGDN ,
//โโโโโโโโโโดโโโโโโโโโดโโโโโโโโโดโโโโโฌโโโโดโโโโโฌโโโโผโโโโโโโโโ โโโโโโโโโโผโโโโฌโโโโโดโโโโฌโโโโโดโโโโโโโโโดโโโโโโโโโดโโโโโโโโโ
XXXXXXX , _______ , _______ , _______
// โโโโโโโโโโ โโโโโโโโโโ โโโโโโโโโโ โโโโโโโโโโ
),
[_MISC] = LAYOUT(
//โโโโโโโโโโฌโโโโโโโโโฌโโโโโโโโโฌโโโโโโโโโฌโโโโโโโโโ โโโโโโโโโโฌโโโโโโโโโฌโโโโโโโโโฌโโโโโโโโโฌโโโโโโโโโ
QK_BOOT ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , KC_BRID ,KC_BRIU ,KC_PSCR ,XXXXXXX ,K_PRINT ,
//โโโโโโโโโโผโโโโโโโโโผโโโโโโโโโผโโโโโโโโโผโโโโโโโโโค โโโโโโโโโโผโโโโโโโโโผโโโโโโโโโผโโโโโโโโโผโโโโโโโโโค
XXXXXXX ,XXXXXXX ,DB_TOGG ,LT_OSLNX,XXXXXXX , KC_MPRV ,KC_MPLY ,KC_MNXT ,XXXXXXX ,K_VIDEO ,
//โโโโโโโโโโผโโโโโโโโโผโโโโโโโโโผโโโโโโโโโผโโโโโโโโโค โโโโโโโโโโผโโโโโโโโโผโโโโโโโโโผโโโโโโโโโผโโโโโโโโโค
XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , KC_VOLD ,KC_VOLU ,XXXXXXX ,XXXXXXX ,XXXXXXX ,
//โโโโโโโโโโดโโโโโโโโโดโโโโโโโโโดโโโโโฌโโโโดโโโโโฌโโโโผโโโโโโโโโ โโโโโโโโโโผโโโโฌโโโโโดโโโโฌโโโโโดโโโโโโโโโดโโโโโโโโโดโโโโโโโโโ
XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX
// โโโโโโโโโโ โโโโโโโโโโ โโโโโโโโโโ โโโโโโโโโโ
),
[_TMUX] = LAYOUT(
//โโโโโโโโโโฌโโโโโโโโโฌโโโโโโโโโฌโโโโโโโโโฌโโโโโโโโโ โโโโโโโโโโฌโโโโโโโโโฌโโโโโโโโโฌโโโโโโโโโฌโโโโโโโโโ
XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , XXXXXXX ,TM_URL ,XXXXXXX ,XXXXXXX ,XXXXXXX ,
//โโโโโโโโโโผโโโโโโโโโผโโโโโโโโโผโโโโโโโโโผโโโโโโโโโค โโโโโโโโโโผโโโโโโโโโผโโโโโโโโโผโโโโโโโโโผโโโโโโโโโค
XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , TM_LEFT ,TM_NEXT ,TM_PREV ,TM_RIGHT,XXXXXXX ,
//โโโโโโโโโโผโโโโโโโโโผโโโโโโโโโผโโโโโโโโโผโโโโโโโโโค โโโโโโโโโโผโโโโโโโโโผโโโโโโโโโผโโโโโโโโโผโโโโโโโโโค
XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , TM_NEW ,TM_SLCT ,XXXXXXX ,XXXXXXX ,TM_SRCH ,
//โโโโโโโโโโดโโโโโโโโโดโโโโโโโโโดโโโโโฌโโโโดโโโโโฌโโโโผโโโโโโโโโ โโโโโโโโโโผโโโโฌโโโโโดโโโโฌโโโโโดโโโโโโโโโดโโโโโโโโโดโโโโโโโโโ
XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX
// โโโโโโโโโโ โโโโโโโโโโ โโโโโโโโโโ โโโโโโโโโโ
),
[_MOUSE] = LAYOUT(
//โโโโโโโโโโฌโโโโโโโโโฌโโโโโโโโโฌโโโโโโโโโฌโโโโโโโโโ โโโโโโโโโโฌโโโโโโโโโฌโโโโโโโโโฌโโโโโโโโโฌโโโโโโโโโ
XXXXXXX ,XXXXXXX ,KC_MS_U ,KC_BTN3 ,KC_WH_U , XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,
//โโโโโโโโโโผโโโโโโโโโผโโโโโโโโโผโโโโโโโโโผโโโโโโโโโค โโโโโโโโโโผโโโโโโโโโผโโโโโโโโโผโโโโโโโโโผโโโโโโโโโค
XXXXXXX ,KC_MS_L ,KC_MS_D ,KC_MS_R ,KC_WH_D , XXXXXXX ,XXXXXXX ,KC_RCTL ,KC_RGUI ,KC_RALT ,
//โโโโโโโโโโผโโโโโโโโโผโโโโโโโโโผโโโโโโโโโผโโโโโโโโโค โโโโโโโโโโผโโโโโโโโโผโโโโโโโโโผโโโโโโโโโผโโโโโโโโโค
XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,
//โโโโโโโโโโดโโโโโโโโโดโโโโโโโโโดโโโโโฌโโโโดโโโโโฌโโโโผโโโโโโโโโ โโโโโโโโโโผโโโโฌโโโโโดโโโโฌโโโโโดโโโโโโโโโดโโโโโโโโโดโโโโโโโโโ
KC_BTN1 , KC_BTN2 , _______ , XXXXXXX
// โโโโโโโโโโ โโโโโโโโโโ โโโโโโโโโโ โโโโโโโโโโ
),
[_FUNC] = LAYOUT(
//โโโโโโโโโโฌโโโโโโโโโฌโโโโโโโโโฌโโโโโโโโโฌโโโโโโโโโ โโโโโโโโโโฌโโโโโโโโโฌโโโโโโโโโฌโโโโโโโโโฌโโโโโโโโโ
KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 ,KC_F5 , XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,
//โโโโโโโโโโผโโโโโโโโโผโโโโโโโโโผโโโโโโโโโผโโโโโโโโโค โโโโโโโโโโผโโโโโโโโโผโโโโโโโโโผโโโโโโโโโผโโโโโโโโโค
KC_F6 ,KC_F7 ,KC_F8 ,KC_F9 ,KC_F10 , XXXXXXX ,XXXXXXX ,KC_RCTL ,KC_RGUI ,KC_RALT ,
//โโโโโโโโโโผโโโโโโโโโผโโโโโโโโโผโโโโโโโโโผโโโโโโโโโค โโโโโโโโโโผโโโโโโโโโผโโโโโโโโโผโโโโโโโโโผโโโโโโโโโค
KC_F11 ,KC_F12 ,XXXXXXX ,XXXXXXX ,XXXXXXX , XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,
//โโโโโโโโโโดโโโโโโโโโดโโโโโโโโโดโโโโโฌโโโโดโโโโโฌโโโโผโโโโโโโโโ โโโโโโโโโโผโโโโฌโโโโโดโโโโฌโโโโโดโโโโโโโโโดโโโโโโโโโดโโโโโโโโโ
XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX
// โโโโโโโโโโ โโโโโโโโโโ โโโโโโโโโโ โโโโโโโโโโ
),
[_LT_MAC] = LAYOUT(
//โโโโโโโโโโฌโโโโโโโโโฌโโโโโโโโโฌโโโโโโโโโฌโโโโโโโโโ โโโโโโโโโโฌโโโโโโโโโฌโโโโโโโโโฌโโโโโโโโโฌโโโโโโโโโ
KC_EXLM ,KC_AT ,KC_HASH ,KC_DLR ,KC_PERC , KC_CIRC ,KC_AMPR ,KC_ASTR ,KC_PLUS ,XXXXXXX ,
//โโโโโโโโโโผโโโโโโโโโผโโโโโโโโโผโโโโโโโโโผโโโโโโโโโค โโโโโโโโโโผโโโโโโโโโผโโโโโโโโโผโโโโโโโโโผโโโโโโโโโค
KC_1 ,KC_2 ,KC_3 ,KC_4 ,KC_5 , KC_6 ,KC_7 ,KC_8 ,KC_EQL ,XXXXXXX ,
//โโโโโโโโโโผโโโโโโโโโผโโโโโโโโโผโโโโโโโโโผโโโโโโโโโค โโโโโโโโโโผโโโโโโโโโผโโโโโโโโโผโโโโโโโโโผโโโโโโโโโค
XXXXXXX ,KC_BSPC ,XXXXXXX ,XXXXXXX ,XXXXXXX , XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,
//โโโโโโโโโโดโโโโโโโโโดโโโโโโโโโดโโโโโฌโโโโดโโโโโฌโโโโผโโโโโโโโโ โโโโโโโโโโผโโโโฌโโโโโดโโโโฌโโโโโดโโโโโโโโโดโโโโโโโโโดโโโโโโโโโ
XXXXXXX , XXXXXXX , _______ , XXXXXXX
// โโโโโโโโโโ โโโโโโโโโโ โโโโโโโโโโ โโโโโโโโโโ
),
[_LT_LINUX] = LAYOUT(
//โโโโโโโโโโฌโโโโโโโโโฌโโโโโโโโโฌโโโโโโโโโฌโโโโโโโโโ โโโโโโโโโโฌโโโโโโโโโฌโโโโโโโโโฌโโโโโโโโโฌโโโโโโโโโ
K_LT_AU ,K_LT_CU ,K_LT_E1U,K_LT_E2U,K_LT_IU , K_LT_SU ,K_LT_U1U,K_LT_U2U,K_LT_ZU ,XXXXXXX ,
//โโโโโโโโโโผโโโโโโโโโผโโโโโโโโโผโโโโโโโโโผโโโโโโโโโค โโโโโโโโโโผโโโโโโโโโผโโโโโโโโโผโโโโโโโโโผโโโโโโโโโค
K_LT_A ,K_LT_C ,K_LT_E1 ,K_LT_E2 ,K_LT_I , K_LT_S ,K_LT_U1 ,K_LT_U2 ,K_LT_Z ,XXXXXXX ,
//โโโโโโโโโโผโโโโโโโโโผโโโโโโโโโผโโโโโโโโโผโโโโโโโโโค โโโโโโโโโโผโโโโโโโโโผโโโโโโโโโผโโโโโโโโโผโโโโโโโโโค
XXXXXXX ,KC_BSPC ,XXXXXXX ,K_SNEK ,K_LT_OB , K_LT_CB ,K_EURO ,XXXXXXX ,XXXXXXX ,XXXXXXX ,
//โโโโโโโโโโดโโโโโโโโโดโโโโโโโโโดโโโโโฌโโโโดโโโโโฌโโโโผโโโโโโโโโ โโโโโโโโโโผโโโโฌโโโโโดโโโโฌโโโโโดโโโโโโโโโดโโโโโโโโโดโโโโโโโโโ
XXXXXXX , XXXXXXX , _______ , XXXXXXX
// โโโโโโโโโโ โโโโโโโโโโ โโโโโโโโโโ โโโโโโโโโโ
),
};
#define TMUX_PREFIX SS_DOWN(X_LCTL) "b" SS_UP(X_LCTL)
bool lt_os_is_linux = false;
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
if (!update_flow(keycode, record->event.pressed, record->event.key)) return false;
switch (keycode) {
case TM_LEFT:
if (!record->event.pressed) return true;
SEND_STRING(TMUX_PREFIX "<");
return false;
case TM_RIGHT:
if (!record->event.pressed) return true;
SEND_STRING(TMUX_PREFIX ">");
return false;
case TM_NEXT:
if (!record->event.pressed) return true;
SEND_STRING(TMUX_PREFIX "n");
return false;
case TM_PREV:
if (!record->event.pressed) return true;
SEND_STRING(TMUX_PREFIX "p");
return false;
case TM_NEW:
if (!record->event.pressed) return true;
SEND_STRING(TMUX_PREFIX "c");
return false;
case TM_SLCT:
if (!record->event.pressed) return true;
SEND_STRING(TMUX_PREFIX "[");
return false;
case TM_SRCH:
if (!record->event.pressed) return true;
SEND_STRING(TMUX_PREFIX "\t");
return false;
case TM_URL:
if (!record->event.pressed) return true;
SEND_STRING(TMUX_PREFIX SS_LCTL("u"));
return false;
case LT_OSLNX:
if (!record->event.pressed) return true;
lt_os_is_linux = !lt_os_is_linux;
return false;
}
return true;
}
void matrix_scan_user(void) {
flow_matrix_scan();
}
bool lang_layer_on = false;
layer_state_t layer_state_set_user(layer_state_t state) {
state = update_tri_layer_state(state, _SYM, _NAV, lt_os_is_linux ? _LT_LINUX : _LT_MAC);
uint8_t hl = get_highest_layer(state);
if (hl == _LT_MAC) {
if (!lang_layer_on) {
tap_code16(LCTL(KC_SPC));
lang_layer_on = true;
}
} else {
if (lang_layer_on) {
tap_code16(LCTL(KC_SPC));
lang_layer_on = false;
}
}
return state;
}
|