aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--keyboards/a_dux/keymaps/daliusd/config.h32
-rw-r--r--keyboards/a_dux/keymaps/daliusd/keymap.c349
-rw-r--r--keyboards/a_dux/keymaps/daliusd/oneshot.c195
-rw-r--r--keyboards/a_dux/keymaps/daliusd/oneshot.h65
-rw-r--r--keyboards/a_dux/keymaps/daliusd/readme.md21
-rw-r--r--keyboards/a_dux/keymaps/daliusd/rules.mk5
6 files changed, 667 insertions, 0 deletions
diff --git a/keyboards/a_dux/keymaps/daliusd/config.h b/keyboards/a_dux/keymaps/daliusd/config.h
new file mode 100644
index 000000000..42e88a687
--- /dev/null
+++ b/keyboards/a_dux/keymaps/daliusd/config.h
@@ -0,0 +1,32 @@
1/*
2Copyright 2021 Dalius Dobravolskas <dalius.dobravolskas@gmail.com>
3
4This program is free software: you can redistribute it and/or modify
5it under the terms of the GNU General Public License as published by
6the Free Software Foundation, either version 2 of the License, or
7(at your option) any later version.
8
9This program is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12GNU General Public License for more details.
13
14You should have received a copy of the GNU General Public License
15along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/
17
18#pragma once
19
20#define UNICODE_SELECTED_MODES UC_MAC, UC_LNX
21
22#define MOUSEKEY_INTERVAL 12
23#define MOUSEKEY_MAX_SPEED 6
24#define MOUSEKEY_TIME_TO_MAX 50
25
26#define MOUSEKEY_DELAY 20
27// It makes sense to use the same delay for the mouseweel
28#define MOUSEKEY_WHEEL_DELAY 100
29// The default is 100
30#define MOUSEKEY_WHEEL_INTERVAL 50
31// The default is 40
32#define MOUSEKEY_WHEEL_TIME_TO_MAX 100
diff --git a/keyboards/a_dux/keymaps/daliusd/keymap.c b/keyboards/a_dux/keymaps/daliusd/keymap.c
new file mode 100644
index 000000000..2a65ce458
--- /dev/null
+++ b/keyboards/a_dux/keymaps/daliusd/keymap.c
@@ -0,0 +1,349 @@
1/* Copyright 2021 @daliusd
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16#include QMK_KEYBOARD_H
17
18#include "oneshot.h"
19
20// Each layer gets a name for readability, which is then used in the keymap matrix below.
21// The underscores don't mean anything - you can have a layer called STUFF or any other name.
22// Layer names don't all need to be of the same length, obviously, and you can also skip them
23// entirely and just use numbers.
24enum layers {
25 _QWERTY,
26 _SYM,
27 _NAV,
28 _NUMB,
29 _TMUX,
30 _MOUSE,
31 _MISC,
32 _FUNC,
33};
34
35enum custom_keycodes {
36 TM_NEXT = SAFE_RANGE,
37 TM_PREV,
38 TM_LEFT,
39 TM_RIGHT,
40 TM_NEW,
41 TM_SLCT,
42 TM_SRCH,
43 TM_URL,
44 OS_CTRL,
45 OS_ALT,
46 OS_GUI,
47 OS_TMUX,
48 OS_MISC,
49 OS_FUNC,
50};
51
52// Shortcut to make keymap more readable
53
54#define L_NAV MO(_NAV)
55#define L_SYM MO(_SYM)
56#define L_MOUSE TG(_MOUSE)
57
58#define K_PRINT (QK_LCTL | QK_LSFT | QK_LGUI | KC_4)
59
60enum unicode_names {
61 SNEK,
62 EURO,
63 LT_S_A,
64 LT_L_A,
65 LT_S_C,
66 LT_L_C,
67 LT_S_E1,
68 LT_L_E1,
69 LT_S_E2,
70 LT_L_E2,
71 LT_S_I,
72 LT_L_I,
73 LT_S_S,
74 LT_L_S,
75 LT_S_U1,
76 LT_L_U1,
77 LT_S_U2,
78 LT_L_U2,
79 LT_S_Z,
80 LT_L_Z,
81 LT_OB,
82 LT_CB,
83};
84
85const uint32_t PROGMEM unicode_map[] = {
86 [SNEK] = 0x1F40D, // ๐Ÿ
87 [EURO] = 0x20ac, // โ‚ฌ
88 [LT_S_A] = 0x105, // ฤ…
89 [LT_L_A] = 0x104, // ฤ„
90 [LT_S_C] = 0x10d, // ฤ
91 [LT_L_C] = 0x10c, // ฤŒ
92 [LT_S_E1] = 0x119, // ฤ™
93 [LT_L_E1] = 0x118, // ฤ˜
94 [LT_S_E2] = 0x117, // ฤ—
95 [LT_L_E2] = 0x116, // ฤ–
96 [LT_S_I] = 0x12f, // ฤฏ
97 [LT_L_I] = 0x12e, // ฤฎ
98 [LT_S_S] = 0x161, // ลก
99 [LT_L_S] = 0x160, // ล '
100 [LT_S_U1] = 0x173, // ลณ
101 [LT_L_U1] = 0x172, // ลฒ
102 [LT_S_U2] = 0x16b, // ลซ
103 [LT_L_U2] = 0x16a, // ลช
104 [LT_S_Z] = 0x17e, // ลพ
105 [LT_L_Z] = 0x17d, // ลฝ
106 [LT_OB] = 0x201e, // โ€ž
107 [LT_CB] = 0x201c, // โ€œ
108};
109
110#define K_SNEK X(SNEK)
111#define K_EURO X(EURO)
112#define K_LT_A XP(LT_S_A, LT_L_A)
113#define K_LT_C XP(LT_S_C, LT_L_C)
114#define K_LT_E1 XP(LT_S_E1, LT_L_E1)
115#define K_LT_E2 XP(LT_S_E2, LT_L_E2)
116#define K_LT_I XP(LT_S_I, LT_L_I)
117#define K_LT_S XP(LT_S_S, LT_L_S)
118#define K_LT_U1 XP(LT_S_U1, LT_L_U1)
119#define K_LT_U2 XP(LT_S_U2, LT_L_U2)
120#define K_LT_Z XP(LT_S_Z, LT_L_Z)
121#define K_LT_OB X(LT_OB)
122#define K_LT_CB X(LT_CB)
123
124const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
125
126 [_QWERTY] = LAYOUT(
127 //โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
128 KC_Q ,KC_W ,KC_E ,KC_R ,KC_T, KC_Y ,KC_U ,KC_I ,KC_O ,KC_P ,
129 //โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
130 KC_A ,KC_S ,KC_D ,KC_F ,KC_G , KC_H ,KC_J ,KC_K ,KC_L ,KC_SCLN ,
131 //โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
132 KC_Z ,KC_X ,KC_C ,KC_V ,KC_B , KC_N ,KC_M ,KC_COMM ,KC_DOT ,KC_SLSH,
133 //โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
134 L_NAV , KC_SPC , KC_LSFT , L_SYM
135 // โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
136 ),
137
138 [_SYM] = LAYOUT(
139 //โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
140 KC_EXLM ,KC_AT ,KC_HASH ,KC_DLR ,KC_PERC , KC_CIRC ,KC_AMPR ,KC_ASTR ,KC_LPRN ,KC_RPRN ,
141 //โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
142 KC_GRV ,KC_PLUS ,KC_LBRC ,KC_RBRC ,K_LT_OB , KC_MINS ,OS_ALT ,OS_CTRL ,OS_GUI ,KC_PIPE ,
143 //โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
144 K_SNEK ,KC_EQL ,KC_LCBR ,KC_RCBR ,K_LT_CB , KC_UNDS ,KC_QUOT ,KC_DQT ,K_EURO ,KC_BSLS ,
145 //โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
146 _______ , _______ , _______ , _______
147 // โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
148 ),
149
150 [_NAV] = LAYOUT(
151 //โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
152 KC_TILDE,L_MOUSE ,OS_FUNC ,OS_MISC ,OS_TMUX , K_LT_A ,K_LT_C ,K_LT_E1 ,K_LT_E2 ,K_LT_I ,
153 //โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
154 KC_TAB ,OS_GUI ,OS_CTRL ,OS_ALT ,KC_ENT , KC_LEFT ,KC_DOWN ,KC_UP ,KC_RIGHT,KC_END ,
155 //โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
156 KC_DELT ,KC_BSPC ,KC_ESC ,KC_PGDN ,KC_PGUP , KC_HOME ,K_LT_S ,K_LT_U1 ,K_LT_U2 ,K_LT_Z ,
157 //โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
158 _______ , _______ , _______ , _______
159 // โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
160 ),
161
162 [_NUMB] = LAYOUT(
163 //โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
164 KC_1 ,KC_2 ,KC_3 ,KC_4 ,KC_5 , XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,
165 //โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
166 KC_6 ,KC_7 ,KC_8 ,KC_9 ,KC_0 , XXXXXXX ,OS_ALT ,OS_CTRL ,OS_GUI ,XXXXXXX ,
167 //โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
168 KC_DELT ,KC_BSPC ,XXXXXXX ,XXXXXXX ,XXXXXXX , XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,
169 //โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
170 _______ , _______ , _______ , _______
171 // โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
172 ),
173
174 [_TMUX] = LAYOUT(
175 //โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
176 XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , XXXXXXX ,TM_URL ,XXXXXXX ,XXXXXXX ,XXXXXXX ,
177 //โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
178 XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , TM_LEFT ,TM_NEXT ,TM_PREV ,TM_RIGHT,XXXXXXX ,
179 //โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
180 XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , TM_NEW ,TM_SLCT ,XXXXXXX ,XXXXXXX ,TM_SRCH ,
181 //โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
182 XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX
183 // โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
184 ),
185
186 [_MOUSE] = LAYOUT(
187 //โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
188 XXXXXXX ,L_MOUSE ,KC_MS_U ,KC_BTN3 ,KC_WH_U , XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,
189 //โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
190 XXXXXXX ,KC_MS_L ,KC_MS_D ,KC_MS_R ,KC_WH_D , XXXXXXX ,KC_LALT ,KC_LCTL ,KC_LGUI ,XXXXXXX ,
191 //โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
192 XXXXXXX ,XXXXXXX ,KC_ESC ,XXXXXXX ,XXXXXXX , XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,
193 //โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
194 KC_BTN1 , KC_BTN2 , XXXXXXX , XXXXXXX
195 // โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
196 ),
197
198 [_MISC] = LAYOUT(
199 //โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
200 RESET ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , KC_BRID ,KC_BRIU ,XXXXXXX ,KC_PSCR ,K_PRINT ,
201 //โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
202 XXXXXXX ,XXXXXXX ,DEBUG ,XXXXXXX ,XXXXXXX , KC_MPRV ,KC_MPLY ,XXXXXXX ,KC_MNXT ,XXXXXXX ,
203 //โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
204 XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , KC_VOLD ,KC_VOLU ,XXXXXXX ,XXXXXXX ,UC_MOD ,
205 //โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
206 XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX
207 // โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
208 ),
209
210 [_FUNC] = LAYOUT(
211 //โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
212 XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 ,KC_F5 ,
213 //โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
214 XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , KC_F6 ,KC_F7 ,KC_F8 ,KC_F9 ,KC_F10 ,
215 //โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
216 XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , KC_F11 ,KC_F12 ,XXXXXXX ,XXXXXXX ,XXXXXXX ,
217 //โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
218 XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX
219 // โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
220 ),
221};
222
223#define TMUX_PREFIX SS_DOWN(X_LCTL) "b" SS_UP(X_LCTL)
224
225bool is_oneshot_cancel_key(uint16_t keycode) {
226 switch (keycode) {
227 case L_SYM:
228 case L_NAV:
229 return true;
230 default:
231 return false;
232 }
233}
234
235bool is_oneshot_layer_cancel_key(uint16_t keycode) {
236 switch (keycode) {
237 case L_SYM:
238 case L_NAV:
239 return true;
240 default:
241 return false;
242 }
243}
244
245bool is_oneshot_ignored_key(uint16_t keycode) {
246 switch (keycode) {
247 case L_SYM:
248 case L_NAV:
249 case OS_CTRL:
250 case OS_ALT:
251 case OS_GUI:
252 case OS_TMUX:
253 case OS_MISC:
254 case KC_LSFT:
255 return true;
256 default:
257 return false;
258 }
259}
260
261bool is_oneshot_mod_key(uint16_t keycode) {
262 switch (keycode) {
263 case OS_CTRL:
264 case OS_ALT:
265 case OS_GUI:
266 return true;
267 default:
268 return false;
269 }
270}
271
272oneshot_state os_ctrl_state = os_up_unqueued;
273oneshot_state os_alt_state = os_up_unqueued;
274oneshot_state os_cmd_state = os_up_unqueued;
275oneshot_state os_tmux_state = os_up_unqueued;
276oneshot_state os_misc_state = os_up_unqueued;
277oneshot_state os_func_state = os_up_unqueued;
278
279bool process_record_user(uint16_t keycode, keyrecord_t *record) {
280 update_oneshot(
281 &os_ctrl_state, KC_LCTL, OS_CTRL,
282 keycode, record
283 );
284 update_oneshot(
285 &os_alt_state, KC_LALT, OS_ALT,
286 keycode, record
287 );
288 update_oneshot(
289 &os_cmd_state, KC_LGUI, OS_GUI,
290 keycode, record
291 );
292
293 bool handled = true;
294 handled = update_oneshot_layer(
295 &os_tmux_state, _TMUX, OS_TMUX,
296 keycode, record
297 ) & handled;
298
299 handled = update_oneshot_layer(
300 &os_misc_state, _MISC, OS_MISC,
301 keycode, record
302 ) & handled;
303
304 handled = update_oneshot_layer(
305 &os_func_state, _FUNC, OS_FUNC,
306 keycode, record
307 ) & handled;
308 if (!handled) return false;
309
310 switch (keycode) {
311 case TM_LEFT:
312 if (!record->event.pressed) return true;
313 SEND_STRING(TMUX_PREFIX "<");
314 return false;
315 case TM_RIGHT:
316 if (!record->event.pressed) return true;
317 SEND_STRING(TMUX_PREFIX ">");
318 return false;
319 case TM_NEXT:
320 if (!record->event.pressed) return true;
321 SEND_STRING(TMUX_PREFIX "n");
322 return false;
323 case TM_PREV:
324 if (!record->event.pressed) return true;
325 SEND_STRING(TMUX_PREFIX "p");
326 return false;
327 case TM_NEW:
328 if (!record->event.pressed) return true;
329 SEND_STRING(TMUX_PREFIX "c");
330 return false;
331 case TM_SLCT:
332 if (!record->event.pressed) return true;
333 SEND_STRING(TMUX_PREFIX "[");
334 return false;
335 case TM_SRCH:
336 if (!record->event.pressed) return true;
337 SEND_STRING(TMUX_PREFIX "\t");
338 return false;
339 case TM_URL:
340 if (!record->event.pressed) return true;
341 SEND_STRING(TMUX_PREFIX SS_LCTL("u"));
342 return false;
343 }
344 return true;
345}
346
347layer_state_t layer_state_set_user(layer_state_t state) {
348 return update_tri_layer_state(state, _SYM, _NAV, _NUMB);
349}
diff --git a/keyboards/a_dux/keymaps/daliusd/oneshot.c b/keyboards/a_dux/keymaps/daliusd/oneshot.c
new file mode 100644
index 000000000..1e7b4d965
--- /dev/null
+++ b/keyboards/a_dux/keymaps/daliusd/oneshot.c
@@ -0,0 +1,195 @@
1/* Copyright 2021 @daliusd
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16#include "print.h"
17#include "oneshot.h"
18
19void update_oneshot(
20 oneshot_state *state,
21 uint16_t mod,
22 uint16_t trigger,
23 uint16_t keycode,
24 keyrecord_t *record
25) {
26 if (keycode == trigger) {
27 if (record->event.pressed) {
28 // Trigger keydown
29 if (*state == os_up_unqueued) {
30 register_code(mod);
31 }
32 *state = os_down_unused;
33 dprintf("trigger down (on?), mod: %d, ? -> os_down_unused\n", mod);
34 } else {
35 // Trigger keyup
36 switch (*state) {
37 case os_down_unused:
38 // If we didn't use the mod while trigger was held, queue it.
39 *state = os_up_queued;
40 dprintf("trigger up, mod: %d, os_down_unused -> os_up_queued\n", mod);
41 break;
42 case os_down_used:
43 // If we did use the mod while trigger was held, unregister it.
44 *state = os_up_unqueued;
45 unregister_code(mod);
46 dprintf("trigger up (off), mod: %d, os_down_used -> os_up_unqueued\n", mod);
47 break;
48 default:
49 break;
50 }
51 }
52 } else {
53 if (record->event.pressed) {
54 if (is_oneshot_cancel_key(keycode) && *state != os_up_unqueued) {
55 // Cancel oneshot on designated cancel keydown.
56 *state = os_up_unqueued;
57 unregister_code(mod);
58 dprintf("cancel (off), mod: %d, ? -> os_up_unqueued\n", mod);
59 }
60 if (!is_oneshot_ignored_key(keycode)) {
61 switch (*state) {
62 case os_up_queued:
63 *state = os_up_queued_used;
64 dprintf("key up (off), mod: %d, os_up_queued -> os_up_queued_used\n", mod);
65 break;
66 case os_up_queued_used:
67 *state = os_up_unqueued;
68 unregister_code(mod);
69 dprintf("key up (off), mod: %d, os_up_queued_used -> os_up_unqueued\n", mod);
70 break;
71 default:
72 break;
73 }
74 }
75 } else {
76 if (!is_oneshot_ignored_key(keycode)) {
77 // On non-ignored keyup, consider the oneshot used.
78 switch (*state) {
79 case os_down_unused:
80 *state = os_down_used;
81 dprintf("key up, mod: %d, os_down_unused -> os_down_used\n", mod);
82 break;
83 case os_up_queued:
84 *state = os_up_unqueued;
85 unregister_code(mod);
86 dprintf("key up (off), mod: %d, os_up_queued -> os_up_unqueued\n", mod);
87 break;
88 case os_up_queued_used:
89 *state = os_up_unqueued;
90 unregister_code(mod);
91 dprintf("key up (off), mod: %d, os_up_queued_used -> os_up_unqueued\n", mod);
92 break;
93 default:
94 break;
95 }
96 }
97 }
98 }
99}
100
101bool update_oneshot_layer(
102 oneshot_state *state,
103 uint16_t layer,
104 uint16_t trigger,
105 uint16_t keycode,
106 keyrecord_t *record
107) {
108 if (keycode == trigger) {
109 if (record->event.pressed) {
110 // Trigger keydown
111 if (*state == os_up_unqueued) {
112 layer_on(layer);
113 }
114 *state = os_down_unused;
115 dprintf("trigger down (on?), layer: %d, ? -> os_down_unused\n", layer);
116 return false;
117 } else {
118 // Trigger keyup
119 switch (*state) {
120 case os_down_unused:
121 // If we didn't use the layer while trigger was held, queue it.
122 *state = os_up_queued;
123 dprintf("trigger up, layer: %d, os_down_unused -> os_up_queued\n", layer);
124 return false;
125 case os_down_used:
126 // If we did use the layer while trigger was held, turn off it.
127 *state = os_up_unqueued;
128 layer_off(layer);
129 dprintf("trigger up (off), layer: %d, os_down_used -> os_up_unqueued\n", layer);
130 return false;
131 default:
132 break;
133 }
134 }
135 } else {
136 if (record->event.pressed) {
137 if (is_oneshot_layer_cancel_key(keycode) && *state != os_up_unqueued) {
138 // Cancel oneshot layer on designated cancel keydown.
139 *state = os_up_unqueued;
140 layer_off(layer);
141 dprintf("cancel (off), layer: %d, ? -> os_up_unqueued\n", layer);
142 return false;
143 }
144 uint8_t key_layer = read_source_layers_cache(record->event.key);
145 if (key_layer == layer) {
146 // On non-ignored keyup, consider the oneshot used.
147 switch (*state) {
148 case os_down_unused:
149 *state = os_down_used;
150 dprintf("key down, layer: %d, os_down_unused -> os_down_used\n", layer);
151 return true;
152 case os_up_queued:
153 if (is_oneshot_mod_key(keycode)) {
154 *state = os_up_unqueued;
155 layer_off(layer);
156 dprintf("key down, layer: %d, os_up_queued -> os_up_unqueued\n", layer);
157 return false;
158 } else {
159 *state = os_up_queued_used;
160 dprintf("key down, layer: %d, os_up_queued -> os_up_queued_used\n", layer);
161 }
162 return true;
163 case os_up_queued_used:
164 *state = os_up_unqueued;
165 layer_off(layer);
166 dprintf("key down (off), layer: %d, os_up_queued_used -> os_up_unqueued\n", layer);
167 return false;
168 default:
169 break;
170 }
171 }
172 } else {
173 // Ignore key ups from other layers
174 uint8_t key_layer = read_source_layers_cache(record->event.key);
175 if (key_layer == layer) {
176 // On non-ignored keyup, consider the oneshot used.
177 switch (*state) {
178 case os_up_queued:
179 *state = os_up_unqueued;
180 layer_off(layer);
181 dprintf("key up (off), layer: %d, os_up_queued -> os_up_unqueued\n", layer);
182 return true;
183 case os_up_queued_used:
184 *state = os_up_unqueued;
185 layer_off(layer);
186 dprintf("key up (off), layer: %d, os_up_queued_used -> os_up_unqueued\n", layer);
187 return true;
188 default:
189 break;
190 }
191 }
192 }
193 }
194 return true;
195}
diff --git a/keyboards/a_dux/keymaps/daliusd/oneshot.h b/keyboards/a_dux/keymaps/daliusd/oneshot.h
new file mode 100644
index 000000000..a4ea71b8a
--- /dev/null
+++ b/keyboards/a_dux/keymaps/daliusd/oneshot.h
@@ -0,0 +1,65 @@
1/* Copyright 2021 @daliusd
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16#pragma once
17
18#include QMK_KEYBOARD_H
19
20// Represents the four states a oneshot key can be in
21typedef enum {
22 os_up_unqueued,
23 os_up_queued,
24 os_up_queued_used,
25 os_down_unused,
26 os_down_used,
27} oneshot_state;
28
29// Custom oneshot mod implementation that doesn't rely on timers. If a mod is
30// used while it is held it will be unregistered on keyup as normal, otherwise
31// it will be queued and only released after the next non-mod keyup.
32void update_oneshot(
33 oneshot_state *state,
34 uint16_t mod,
35 uint16_t trigger,
36 uint16_t keycode,
37 keyrecord_t *record
38);
39
40// Oneshot implementation for layers
41bool update_oneshot_layer(
42 oneshot_state *state,
43 uint16_t layer,
44 uint16_t trigger,
45 uint16_t keycode,
46 keyrecord_t *record
47);
48
49// To be implemented by the consumer. Layers one shot implementation needs to
50// know which keys are used as oneshot mods
51bool is_oneshot_mod_key(
52 uint16_t keycode
53);
54
55// To be implemented by the consumer. Defines keys to cancel oneshot mods.
56bool is_oneshot_cancel_key(uint16_t keycode);
57
58// To be implemented by the consumer. Defines keys to cancel oneshot layers.
59bool is_oneshot_layer_cancel_key(uint16_t keycode);
60
61// To be implemented by the consumer. Defines keys to ignore when determining
62// whether a oneshot mod has been used. Setting this to modifiers and layer
63// change keys allows stacking multiple oneshot modifiers, and carrying them
64// between layers.
65bool is_oneshot_ignored_key(uint16_t keycode);
diff --git a/keyboards/a_dux/keymaps/daliusd/readme.md b/keyboards/a_dux/keymaps/daliusd/readme.md
new file mode 100644
index 000000000..f6e0efd0e
--- /dev/null
+++ b/keyboards/a_dux/keymaps/daliusd/readme.md
@@ -0,0 +1,21 @@
1# My 34 keys layout
2
3This are my principles for layout:
4
5* I am using Callum style layout. Here you can read explanation by
6 Callum himself and his reasoning for not using mod-tap:
7 [here](../../../../users/callum/readme.md)
8
9* There should be only one way to type key. Key can be on
10 different layer but it must maintain its physical location.
11
12* The less features are used the better.
13
14* trilayer is cool.
15
16* There is ๐Ÿ key for no reason.
17
18As well I have added one shot layers compatible with Callum's one
19shot keys.
20
21There is simple TMUX layer as well.
diff --git a/keyboards/a_dux/keymaps/daliusd/rules.mk b/keyboards/a_dux/keymaps/daliusd/rules.mk
new file mode 100644
index 000000000..0f203f004
--- /dev/null
+++ b/keyboards/a_dux/keymaps/daliusd/rules.mk
@@ -0,0 +1,5 @@
1UNICODE_ENABLE = no
2UNICODEMAP_ENABLE = yes
3#CONSOLE_ENABLE = yes
4
5SRC += oneshot.c