diff options
-rw-r--r-- | keyboards/handwired/dactyl_manuform/5x6/keymaps/uqs/config.h | 11 | ||||
-rw-r--r-- | keyboards/handwired/dactyl_manuform/5x6/keymaps/uqs/keymap.c | 170 | ||||
-rw-r--r-- | keyboards/handwired/dactyl_manuform/5x6/keymaps/uqs/rules.mk | 1 | ||||
-rw-r--r-- | keyboards/ploopyco/mouse/keymaps/uqs/keymap.c | 36 | ||||
-rw-r--r-- | keyboards/ploopyco/mouse/keymaps/uqs/rules.mk | 1 | ||||
-rw-r--r-- | keyboards/preonic/keymaps/uqs/keymap.c | 117 | ||||
-rw-r--r-- | keyboards/preonic/keymaps/uqs/rules.mk | 14 | ||||
-rw-r--r-- | keyboards/splitkb/kyria/keymaps/uqs/config.h | 13 | ||||
-rw-r--r-- | keyboards/splitkb/kyria/keymaps/uqs/keymap.c | 158 | ||||
-rw-r--r-- | keyboards/splitkb/kyria/keymaps/uqs/rules.mk | 1 | ||||
-rw-r--r-- | users/uqs/config.h | 40 | ||||
-rw-r--r-- | users/uqs/rules.mk | 24 | ||||
-rw-r--r-- | users/uqs/uqs.c | 584 | ||||
-rw-r--r-- | users/uqs/uqs.h | 77 |
14 files changed, 1247 insertions, 0 deletions
diff --git a/keyboards/handwired/dactyl_manuform/5x6/keymaps/uqs/config.h b/keyboards/handwired/dactyl_manuform/5x6/keymaps/uqs/config.h new file mode 100644 index 000000000..4eca68c54 --- /dev/null +++ b/keyboards/handwired/dactyl_manuform/5x6/keymaps/uqs/config.h | |||
@@ -0,0 +1,11 @@ | |||
1 | // Copyright 2022 Ulrich Spörlein (@uqs) | ||
2 | // SPDX-License-Identifier: GPL-2.0-or-later | ||
3 | #pragma once | ||
4 | |||
5 | #define USE_SERIAL | ||
6 | |||
7 | #define RGBLED_NUM 12 | ||
8 | #define RGBLED_SPLIT {6,6} | ||
9 | #define RGBLIGHT_LIMIT_VAL 127 | ||
10 | |||
11 | #define EE_HANDS | ||
diff --git a/keyboards/handwired/dactyl_manuform/5x6/keymaps/uqs/keymap.c b/keyboards/handwired/dactyl_manuform/5x6/keymaps/uqs/keymap.c new file mode 100644 index 000000000..211cd91e1 --- /dev/null +++ b/keyboards/handwired/dactyl_manuform/5x6/keymaps/uqs/keymap.c | |||
@@ -0,0 +1,170 @@ | |||
1 | // Copyright 2022 Ulrich Spörlein (@uqs) | ||
2 | // SPDX-License-Identifier: GPL-2.0-or-later | ||
3 | // vi:et sw=4 cc=5,15,25,35,45,55,65: | ||
4 | |||
5 | #include "uqs.h" | ||
6 | |||
7 | /* | ||
8 | * My custom layout macro that allows for easy diff(1) operations between | ||
9 | * various keyboards. It probably doesn't make sense to you. | ||
10 | */ | ||
11 | #define LAYOUT_uqs( \ | ||
12 | L00, L01, L02, L03, L04, L05, \ | ||
13 | L10, L11, L12, L13, L14, L15, \ | ||
14 | L20, L21, L22, L23, L24, L25, \ | ||
15 | L30, L31, L32, L33, L34, L35, \ | ||
16 | L42, L43, \ | ||
17 | L44, L45, L54, \ | ||
18 | L55, L52, L53, \ | ||
19 | R00, R01, R02, R03, R04, R05, \ | ||
20 | R10, R11, R12, R13, R14, R15, \ | ||
21 | R20, R21, R22, R23, R24, R25, \ | ||
22 | R30, R31, R32, R33, R34, R35, \ | ||
23 | R42, R43, \ | ||
24 | R51, R40, R41, \ | ||
25 | R50, R52, R53 \ | ||
26 | ) \ | ||
27 | LAYOUT_5x6( \ | ||
28 | L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ | ||
29 | L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ | ||
30 | L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \ | ||
31 | L30, L31, L32, L33, L34, L35, R30, R31, R32, R33, R34, R35, \ | ||
32 | L42, L43, R42, R43, \ | ||
33 | L44, L45, R40, R41, \ | ||
34 | L54, L55, R50, R51, \ | ||
35 | L52, L53, R52, R53 \ | ||
36 | ) | ||
37 | |||
38 | // clang-format off | ||
39 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
40 | [L_QWER] = LAYOUT_uqs( | ||
41 | KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, | ||
42 | KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, | ||
43 | KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, | ||
44 | KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, | ||
45 | KC_LBRC, KC_RBRC, | ||
46 | /*thumb*/ LT_EXTD_ESC, KC_SPC, LT_MOUSE_ALT_SHIFT_INS, | ||
47 | /*aux*/ KC_LEAD, OSM_GUI, KC_LALT, | ||
48 | KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS, | ||
49 | KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, | ||
50 | KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, | ||
51 | KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, RSFT_T(KC_GRV), | ||
52 | KC_MINS, KC_EQL, | ||
53 | /*thumb*/ LT_FUNC_SHIFT_INS, KC_ENT, LT_NUM_BSPC, | ||
54 | /*aux*/ KC_RALT, KC_APP, KC_LEAD | ||
55 | ), | ||
56 | |||
57 | [L_WASD] = LAYOUT_uqs( | ||
58 | KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, | ||
59 | KC_T, KC_TAB, KC_Q, KC_W, KC_E, KC_R, | ||
60 | KC_G, KC_LSFT, KC_A, KC_S, KC_D, KC_F, | ||
61 | KC_B, KC_GRV, KC_Z, KC_X, KC_C, KC_V, | ||
62 | KC_LBRC, KC_RBRC, | ||
63 | /*thumb*/ KC_LCTL, KC_SPC, KC_R, | ||
64 | /*aux*/ A(KC_M), KC_LGUI, KC_LALT, | ||
65 | KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, | ||
66 | KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, | ||
67 | KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, | ||
68 | KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, RSFT_T(KC_GRV), | ||
69 | KC_MINS, KC_EQL, | ||
70 | /*thumb*/ DF(L_COLM), KC_ENT, KC_BSPC, | ||
71 | /*aux*/ KC_F5, KC_RALT, KC_APP | ||
72 | ), | ||
73 | |||
74 | [L_COLM] = LAYOUT_uqs( | ||
75 | KC_NO, KC_NO, KC_BTN2, KC_BTN3, KC_BTN1, KC_NO, | ||
76 | KC_BTN2, KC_Q, KC_W, KC_F, KC_P, KC_B, | ||
77 | KC_BTN1, KC_G_A, KC_A_R, KC_S_S, KC_C_T, KC_G, | ||
78 | KC_BTN3, KC_Z, KC_X, KC_C, KC_D, KC_V, | ||
79 | MS_WHUP, MS_WHDN, | ||
80 | /*thumb*/ LT_EXTD_ESC, SFT_T(KC_SPC), LT(L_MOUSE, KC_TAB), | ||
81 | /*aux*/ KC_LEAD, OSM_GUI, KC_LALT, | ||
82 | KC_NO, KC_BTN1, KC_BTN2, KC_BTN3, KC_NO, KC_NO, | ||
83 | KC_J, KC_L, KC_U, KC_Y, KC_QUOT, KC_NO, | ||
84 | KC_M, KC_C_N, KC_S_E, KC_A_I, KC_G_O, KC_NO, | ||
85 | KC_K, KC_H, KC_COMM, KC_DOT, KC_SLSH, KC_NO, | ||
86 | KC_NO, KC_NO, | ||
87 | /*thumb*/ LT_FUNC_SHIFT_INS, KC_ENT, LT_NUM_BSPC, | ||
88 | /*aux*/ KC_LEAD, KC_RALT, KC_APP | ||
89 | ), | ||
90 | |||
91 | // Updated with inspiration from https://forum.colemak.com/topic/2014-extend-extra-extreme/ | ||
92 | // I like the AltGr trick from https://stevep99.github.io/seniply/ and should probably incorporate some stuff from it. | ||
93 | [L_EXTD] = LAYOUT_uqs( | ||
94 | _______, _______, _______, _______, _______, _______, | ||
95 | _______, KC_BTN1, KC_SCTAB, KC_PGUP, KC_CTAB, KC_LEAD, | ||
96 | _______, OSM_GUI, OSM_ALT, OSM_SFT, OSM_CTL, KC_RALT, | ||
97 | _______, ALT_TAB, MS_WHUP, MS_WHDN, KC_PGDN, INS_HARD, | ||
98 | _______, _______, | ||
99 | /*thumb*/ _______, _______, _______, | ||
100 | /*aux*/ _______, _______, _______, | ||
101 | /* ^^^^ can't be used */ | ||
102 | _______, _______, _______, _______, _______, _______, | ||
103 | KC_HOME, KC_PGDN, KC_PGUP, KC_END, KC_INS, KC_NO, | ||
104 | KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_DEL, KC_NO, | ||
105 | WIN_LEFT, WIN_DN, WIN_UP, WIN_RGHT, KC_PSTE, KC_NO, // KC_PSTE works in XTerm to emulate middle-click | ||
106 | _______, _______, | ||
107 | /*thumb*/ _______, _______, KC_BSPC, | ||
108 | /*aux*/ _______, _______, _______ | ||
109 | /* ^^^^ use these */ | ||
110 | ), | ||
111 | |||
112 | // TODO: maybe swap # with ;, that way I can roll :w or :wq which I need | ||
113 | // often ... probably better to add a combo? | ||
114 | [L_NUM] = LAYOUT_uqs( | ||
115 | _______, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, | ||
116 | _______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, | ||
117 | _______, KC_SCLN, KC_COLN, KC_LCBR, KC_LPRN, KC_LBRC, | ||
118 | _______, KC_CIRC, KC_AMPR, KC_RCBR, KC_RPRN, KC_RBRC, | ||
119 | KC_GRV, KC_TILDE, | ||
120 | /*thumb*/ KC_ESC, KC_SPC, KC_0, | ||
121 | /*aux*/ _______, _______, _______, | ||
122 | /* ^^^^ use these */ | ||
123 | KC_NUMLOCK,KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, | ||
124 | KC_EQUAL, KC_7, KC_8, KC_9, KC_KP_PLUS,_______, | ||
125 | KC_KP_ASTERISK,KC_4,KC_5, KC_6, MINS_UNDSCR,_______, | ||
126 | KC_COMM, KC_1, KC_2, KC_3, KC_KP_SLASH,KC_KP_ENTER, // Enter here, because thumb is occupied | ||
127 | KC_0, KC_KP_DOT, | ||
128 | /*thumb*/ _______, _______, _______, | ||
129 | /*aux*/ _______, _______, _______ | ||
130 | /* ^^^^ can't be used */ | ||
131 | ), | ||
132 | |||
133 | [L_FUNC] = LAYOUT_uqs( | ||
134 | _______, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, | ||
135 | _______, KC_NO, KC_MUTE, KC_VOLD, KC_VOLU, DF(L_WASD), | ||
136 | _______, KC_LGUI, KC_LALT, KC_LSFT, KC_LCTL, DF(L_QWER), | ||
137 | _______, KC_NO, KC_NO, KC_NO, KC_NO, DF(L_COLM), | ||
138 | KC_NO, KC_NO, | ||
139 | /*thumb*/ _______, _______, _______, | ||
140 | /*aux*/ _______, _______, _______, | ||
141 | /* ^^^^ use these */ | ||
142 | KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, | ||
143 | KC_PSCR, KC_F7, KC_F8, KC_F9, KC_F10, KC_NO, | ||
144 | KC_SLCK, KC_F4, KC_F5, KC_F6, KC_F11, KC_NO, | ||
145 | KC_PAUS, KC_F1, KC_F2, KC_F3, KC_F12, KC_NO, | ||
146 | KC_NO, KC_NO, | ||
147 | /*thumb*/ _______, _______, _______, | ||
148 | /*aux*/ _______, _______, _______ | ||
149 | /* ^^^^ can't be used */ | ||
150 | ), | ||
151 | |||
152 | [L_MOUSE] = LAYOUT_uqs( | ||
153 | _______, _______, _______, _______, _______, _______, | ||
154 | _______, KC_NO, KC_BTN2, KC_BTN3, KC_BTN1, KC_VOLU, | ||
155 | _______, KC_NO, KC_ACL0, KC_ACL1, KC_ACL2, KC_VOLD, | ||
156 | _______, KC_NO, KC_NO, KC_NO, KC_NO, KC_MUTE, | ||
157 | KC_NO, KC_NO, | ||
158 | /*thumb*/ _______, _______, _______, | ||
159 | /*aux*/ _______, _______, _______, | ||
160 | /* ^^^^ can't be used */ | ||
161 | _______, _______, _______, _______, _______, _______, | ||
162 | _______, _______, KC_MS_UP, MS_WHUP, _______, _______, | ||
163 | MS_WHLEFT,KC_MS_L, KC_MS_D, KC_MS_R, MS_WHRGHT,_______, | ||
164 | _______, MS_WHDN, KC_BTN3, KC_BTN4, KC_BTN5, _______, | ||
165 | KC_NO, KC_NO, | ||
166 | /*thumb*/ KC_NO, KC_BTN1, KC_BTN2, | ||
167 | /*aux*/ _______, _______, _______ | ||
168 | /* use these ^^^^ */ | ||
169 | ), | ||
170 | }; | ||
diff --git a/keyboards/handwired/dactyl_manuform/5x6/keymaps/uqs/rules.mk b/keyboards/handwired/dactyl_manuform/5x6/keymaps/uqs/rules.mk new file mode 100644 index 000000000..2cd3745fa --- /dev/null +++ b/keyboards/handwired/dactyl_manuform/5x6/keymaps/uqs/rules.mk | |||
@@ -0,0 +1 @@ | |||
#VIA_ENABLE = yes # doesn't fit with 7 layers :/ | |||
diff --git a/keyboards/ploopyco/mouse/keymaps/uqs/keymap.c b/keyboards/ploopyco/mouse/keymaps/uqs/keymap.c new file mode 100644 index 000000000..564dad13d --- /dev/null +++ b/keyboards/ploopyco/mouse/keymaps/uqs/keymap.c | |||
@@ -0,0 +1,36 @@ | |||
1 | // Copyright 2022 Ulrich Spörlein (@uqs) | ||
2 | // SPDX-License-Identifier: GPL-2.0-or-later | ||
3 | // vi:et sw=4: | ||
4 | |||
5 | #include QMK_KEYBOARD_H | ||
6 | |||
7 | enum custom_keycodes { | ||
8 | DBL_CLK_NO = SAFE_RANGE, | ||
9 | }; | ||
10 | |||
11 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | ||
12 | switch (keycode) { | ||
13 | // This works fine in xev(1) or a browser, but not in the game where I | ||
14 | // would want it. Maybe need to increase the delay? Also needs to be | ||
15 | // rewritten to use Deferred Execution. | ||
16 | case DBL_CLK_NO: | ||
17 | if (record->event.pressed) { | ||
18 | tap_code(KC_BTN2); | ||
19 | wait_ms(150); | ||
20 | tap_code(KC_BTN2); | ||
21 | wait_ms(300); | ||
22 | tap_code(KC_N); | ||
23 | } | ||
24 | return false; | ||
25 | } | ||
26 | return true; | ||
27 | } | ||
28 | |||
29 | |||
30 | // Layout is: | ||
31 | // left-most, M1, M3, M2, right-most, fwd, back (on side), tiny middle one | ||
32 | |||
33 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
34 | [0] = LAYOUT(KC_E, KC_BTN1, KC_BTN3, KC_BTN2, KC_LSFT, KC_BTN4, KC_BTN5, DF(1)), // shooters | ||
35 | [1] = LAYOUT(KC_1, KC_BTN1, KC_Y, KC_BTN2, DBL_CLK_NO, KC_N, KC_Y, DF(0)), // stardew valley, sword on 1 | ||
36 | }; | ||
diff --git a/keyboards/ploopyco/mouse/keymaps/uqs/rules.mk b/keyboards/ploopyco/mouse/keymaps/uqs/rules.mk new file mode 100644 index 000000000..59222a688 --- /dev/null +++ b/keyboards/ploopyco/mouse/keymaps/uqs/rules.mk | |||
@@ -0,0 +1 @@ | |||
#VIA_ENABLE = yes | |||
diff --git a/keyboards/preonic/keymaps/uqs/keymap.c b/keyboards/preonic/keymaps/uqs/keymap.c new file mode 100644 index 000000000..ec2289038 --- /dev/null +++ b/keyboards/preonic/keymaps/uqs/keymap.c | |||
@@ -0,0 +1,117 @@ | |||
1 | // Copyright 2022 Ulrich Spörlein (@uqs) | ||
2 | // SPDX-License-Identifier: GPL-2.0-or-later | ||
3 | // vi:et sw=4 cc=5,15,25,35,45,55,65: | ||
4 | |||
5 | #include "uqs.h" | ||
6 | |||
7 | /* | ||
8 | * My custom layout macro that allows for easy diff(1) operations between | ||
9 | * various keyboards. It probably doesn't make sense to you. | ||
10 | */ | ||
11 | #define LAYOUT_uqs( \ | ||
12 | k00, k01, k02, k03, k04, k05, \ | ||
13 | k10, k11, k12, k13, k14, k15, \ | ||
14 | k20, k21, k22, k23, k24, k25, \ | ||
15 | k30, k31, k32, k33, k34, k35, \ | ||
16 | k43, k44, \ | ||
17 | k40, k41, k42, \ | ||
18 | k06, k07, k08, k09, k0a, k0b, \ | ||
19 | k16, k17, k18, k19, k1a, k1b, \ | ||
20 | k26, k27, k28, k29, k2a, k2b, \ | ||
21 | k36, k37, k38, k39, k3a, k3b, \ | ||
22 | k46, k48, \ | ||
23 | k49, k4a, k4b \ | ||
24 | ) \ | ||
25 | LAYOUT_preonic_2x2u( \ | ||
26 | k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ | ||
27 | k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ | ||
28 | k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ | ||
29 | k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, \ | ||
30 | k40, k41, k42, k43, k44, k46, k48, k49, k4a, k4b \ | ||
31 | ) | ||
32 | |||
33 | // clang-format off | ||
34 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
35 | [L_QWER] = LAYOUT_uqs( | ||
36 | KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, | ||
37 | KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, | ||
38 | KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, | ||
39 | KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, | ||
40 | |||
41 | /*thumb*/ LT_EXTD_ESC, KC_SPC, | ||
42 | /*aux*/ KC_NO, KC_LGUI, KC_LALT, | ||
43 | KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS, | ||
44 | KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, | ||
45 | KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, | ||
46 | KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, | ||
47 | /*thumb*/ KC_ENT, LT_NUM_BSPC, | ||
48 | /*aux*/ MO(L_FUNC), KC_NO, KC_NO | ||
49 | ), | ||
50 | [L_EXTD] = LAYOUT_uqs( | ||
51 | KC_F11, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, | ||
52 | _______, KC_BTN1, KC_SCTAB, KC_PGUP, KC_CTAB, KC_LEAD, | ||
53 | _______, OSM_GUI, OSM_ALT, OSM_SFT, OSM_CTL, KC_RALT, | ||
54 | _______, ALT_TAB, MS_WHUP, MS_WHDN, KC_PGDN, INS_HARD, | ||
55 | /*thumb*/ _______, _______, | ||
56 | /*aux*/ _______, _______, _______, | ||
57 | /* ^^^^ can't be used */ | ||
58 | KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F12, | ||
59 | KC_HOME, KC_PGDN, KC_PGUP, KC_END, KC_INS, KC_NO, | ||
60 | KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_DEL, KC_NO, | ||
61 | WIN_LEFT, WIN_DN, WIN_UP, WIN_RGHT, KC_PSTE, KC_NO, | ||
62 | /*thumb*/ _______, KC_BSPC, | ||
63 | /*aux*/ _______, _______, KC_ENTER | ||
64 | /* ^^^^ use these */ | ||
65 | ), | ||
66 | |||
67 | [L_NUM] = LAYOUT_uqs( | ||
68 | KC_F11, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, | ||
69 | _______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, | ||
70 | _______, KC_SCLN, KC_COLN, KC_LCBR, KC_LPRN, KC_LBRC, | ||
71 | _______, KC_CIRC, KC_AMPR, KC_RCBR, KC_RPRN, KC_RBRC, | ||
72 | /*thumb*/ KC_ESC, _______, | ||
73 | /*aux*/ _______, _______, _______, | ||
74 | /* ^^^^ use these */ | ||
75 | KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F12, | ||
76 | KC_EQUAL, KC_7, KC_8, KC_9, KC_KP_PLUS,_______, | ||
77 | KC_KP_ASTERISK,KC_4,KC_5, KC_6, MINS_UNDSCR,_______, | ||
78 | KC_COMM, KC_1, KC_2, KC_3, KC_KP_SLASH,KC_KP_ENTER, // Enter here, because thumb is occupied | ||
79 | /*thumb*/ _______, _______, | ||
80 | /*aux*/ KC_0, KC_KP_DOT, _______ | ||
81 | /* ^^^^ can't be used */ | ||
82 | ), | ||
83 | |||
84 | [L_FUNC] = LAYOUT_uqs( | ||
85 | _______, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, | ||
86 | _______, KC_NO, KC_MUTE, KC_VOLD, KC_VOLU, KC_NO, | ||
87 | _______, KC_LGUI, KC_LALT, KC_LSFT, KC_LCTL, KC_NO, | ||
88 | _______, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, | ||
89 | /*thumb*/ _______, _______, | ||
90 | /*aux*/ _______, _______, _______, | ||
91 | /* ^^^^ use these */ | ||
92 | KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, | ||
93 | KC_PSCR, KC_F7, KC_F8, KC_F9, KC_F10, KC_NO, | ||
94 | KC_SLCK, KC_F4, KC_F5, KC_F6, KC_F11, KC_NO, | ||
95 | KC_PAUS, KC_F1, KC_F2, KC_F3, KC_F12, KC_NO, | ||
96 | /*thumb*/ _______, _______, | ||
97 | /*aux*/ _______, _______, _______ | ||
98 | /* ^^^^ can't be used */ | ||
99 | ), | ||
100 | |||
101 | [L_MOUSE] = LAYOUT_uqs( | ||
102 | KC_NO, _______, _______, _______, _______, _______, | ||
103 | KC_NO, KC_NO, KC_BTN2, KC_BTN3, KC_BTN1, KC_VOLU, | ||
104 | KC_NO, KC_NO, KC_ACL0, KC_ACL1, KC_ACL2, KC_VOLD, | ||
105 | KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_MUTE, | ||
106 | /*thumb*/ _______, _______, | ||
107 | /*aux*/ _______, _______, _______, | ||
108 | /* ^^^^ can't be used */ | ||
109 | _______, _______, _______, _______, _______, _______, | ||
110 | _______, _______, KC_MS_UP, MS_WHUP, _______, _______, | ||
111 | MS_WHLEFT,KC_MS_L, KC_MS_D, KC_MS_R, MS_WHRGHT,_______, | ||
112 | _______, MS_WHDN, KC_BTN3, KC_BTN4, KC_BTN5, _______, | ||
113 | /*thumb*/ KC_BTN1, KC_BTN2, | ||
114 | /*aux*/ KC_NO, KC_NO, KC_NO | ||
115 | /* use these ^^^^ */ | ||
116 | ), | ||
117 | }; | ||
diff --git a/keyboards/preonic/keymaps/uqs/rules.mk b/keyboards/preonic/keymaps/uqs/rules.mk new file mode 100644 index 000000000..ca99fa107 --- /dev/null +++ b/keyboards/preonic/keymaps/uqs/rules.mk | |||
@@ -0,0 +1,14 @@ | |||
1 | LTO_ENABLE=no | ||
2 | AUDIO_ENABLE=no | ||
3 | ENCODER_ENABLE=no | ||
4 | |||
5 | # Broken with gcc >6, see https://github.com/qmk/qmk_firmware/issues/6753 | ||
6 | # (yes, different option, but I suspect the code has moved around) | ||
7 | # This produces working firmware on Arch Linux with GCC 11, but is still broken | ||
8 | # on Debian with 8.3.1 | ||
9 | RGBLIGHT_ENABLE=no | ||
10 | RGB_MATRIX_ENABLE=no | ||
11 | |||
12 | # not required, but helps on debian where there is a soft/hard float confusion. | ||
13 | # but see above, gcc 8.3.1 still fucks up the firmware. | ||
14 | USE_FPU=no | ||
diff --git a/keyboards/splitkb/kyria/keymaps/uqs/config.h b/keyboards/splitkb/kyria/keymaps/uqs/config.h new file mode 100644 index 000000000..ae34b0e04 --- /dev/null +++ b/keyboards/splitkb/kyria/keymaps/uqs/config.h | |||
@@ -0,0 +1,13 @@ | |||
1 | // Copyright 2022 Ulrich Spörlein (@uqs) | ||
2 | // SPDX-License-Identifier: GPL-2.0-or-later | ||
3 | #pragma once | ||
4 | |||
5 | #ifdef RGBLIGHT_ENABLE | ||
6 | //#define RGBLIGHT_ANIMATIONS | ||
7 | #define RGBLIGHT_HUE_STEP 8 | ||
8 | #define RGBLIGHT_SAT_STEP 8 | ||
9 | #define RGBLIGHT_VAL_STEP 8 | ||
10 | #define RGBLIGHT_LIMIT_VAL 150 | ||
11 | #endif | ||
12 | |||
13 | #define EE_HANDS | ||
diff --git a/keyboards/splitkb/kyria/keymaps/uqs/keymap.c b/keyboards/splitkb/kyria/keymaps/uqs/keymap.c new file mode 100644 index 000000000..53b6ee77b --- /dev/null +++ b/keyboards/splitkb/kyria/keymaps/uqs/keymap.c | |||
@@ -0,0 +1,158 @@ | |||
1 | // Copyright 2022 Ulrich Spörlein (@uqs) | ||
2 | // SPDX-License-Identifier: GPL-2.0-or-later | ||
3 | // vi:et sw=4 cc=5,15,25,35,45,55,65: | ||
4 | |||
5 | #include "uqs.h" | ||
6 | |||
7 | /* | ||
8 | * My custom layout macro that allows for easy diff(1) operations between | ||
9 | * various keyboards. It probably doesn't make sense to you. | ||
10 | */ | ||
11 | #define LAYOUT_uqs( \ | ||
12 | L00, L01, L02, L03, L04, L05, \ | ||
13 | L12, L13, L14, L15, L16, L17, \ | ||
14 | L24, L25, L26, L27, L28, L29, \ | ||
15 | L40, L41, \ | ||
16 | L42, L43, L44, \ | ||
17 | L30, L31, \ | ||
18 | R06, R07, R08, R09, R10, R11, \ | ||
19 | R18, R19, R20, R21, R22, R23, \ | ||
20 | R34, R35, R36, R37, R38, R39, \ | ||
21 | R48, R49, \ | ||
22 | R45, R46, R47, \ | ||
23 | R32, R33 \ | ||
24 | ) \ | ||
25 | LAYOUT_stack( \ | ||
26 | L00, L01, L02, L03, L04, L05, \ | ||
27 | L12, L13, L14, L15, L16, L17, \ | ||
28 | L24, L25, L26, L27, L28, L29, L30, L31, \ | ||
29 | L40, L41, L42, L43, L44, \ | ||
30 | \ | ||
31 | R06, R07, R08, R09, R10, R11, \ | ||
32 | R18, R19, R20, R21, R22, R23, \ | ||
33 | R32, R33, R34, R35, R36, R37, R38, R39, \ | ||
34 | R45, R46, R47, R48, R49 \ | ||
35 | ) | ||
36 | |||
37 | // clang-format off | ||
38 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
39 | [L_QWER] = LAYOUT_uqs( | ||
40 | KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, | ||
41 | KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, | ||
42 | KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, | ||
43 | KC_LBRC, KC_RBRC, | ||
44 | /*thumb*/ LT_EXTD_ESC, KC_SPC, LT_MOUSE_ALT_SHIFT_INS, | ||
45 | /*aux*/ OSM_GUI, KC_LALT, | ||
46 | KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, | ||
47 | KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, | ||
48 | KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, RSFT_T(KC_GRV), | ||
49 | KC_MINS, KC_EQL, | ||
50 | /*thumb*/ LT_FUNC_SHIFT_INS, KC_ENT, LT_NUM_BSPC, | ||
51 | /*aux*/ KC_RALT, KC_APP | ||
52 | ), | ||
53 | |||
54 | [L_WASD] = LAYOUT_uqs( | ||
55 | KC_T, KC_TAB, KC_Q, KC_W, KC_E, KC_R, | ||
56 | KC_G, KC_LSFT, KC_A, KC_S, KC_D, KC_F, | ||
57 | KC_B, KC_GRV, KC_Z, KC_X, KC_C, KC_V, | ||
58 | KC_LBRC, KC_RBRC, | ||
59 | /*thumb*/ KC_LCTL, KC_SPC, KC_R, | ||
60 | /*aux*/ OSM_GUI, KC_LALT, | ||
61 | KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, | ||
62 | KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, | ||
63 | KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, RSFT_T(KC_GRV), | ||
64 | KC_MINS, KC_EQL, | ||
65 | /*thumb*/ DF(L_COLM), KC_ENT, KC_BSPC, | ||
66 | /*aux*/ KC_RALT, KC_APP | ||
67 | ), | ||
68 | |||
69 | [L_COLM] = LAYOUT_uqs( | ||
70 | KC_BTN2, KC_Q, KC_W, KC_F, KC_P, KC_B, | ||
71 | KC_BTN1, KC_G_A, KC_A_R, KC_S_S, KC_C_T, KC_G, | ||
72 | KC_BTN3, KC_Z, KC_X, KC_C, KC_D, KC_V, | ||
73 | MS_WHUP, MS_WHDN, | ||
74 | /*thumb*/ LT_EXTD_ESC, SFT_T(KC_SPC), LT(L_MOUSE, KC_TAB), | ||
75 | /*aux*/ OSM_GUI, KC_LALT, | ||
76 | KC_J, KC_L, KC_U, KC_Y, KC_QUOT, KC_NO, | ||
77 | KC_M, KC_C_N, KC_S_E, KC_A_I, KC_G_O, KC_NO, | ||
78 | KC_K, KC_H, KC_COMM, KC_DOT, KC_SLSH, KC_NO, | ||
79 | KC_NO, KC_NO, | ||
80 | /*thumb*/ LT_FUNC_SHIFT_INS, KC_ENT, LT_NUM_BSPC, | ||
81 | /*aux*/ KC_RALT, KC_APP | ||
82 | ), | ||
83 | |||
84 | // Updated with inspiration from https://forum.colemak.com/topic/2014-extend-extra-extreme/ | ||
85 | // I like the AltGr trick from https://stevep99.github.io/seniply/ and should probably incorporate some stuff from it. | ||
86 | [L_EXTD] = LAYOUT_uqs( | ||
87 | _______, KC_BTN1, KC_SCTAB, KC_PGUP, KC_CTAB, KC_LEAD, | ||
88 | _______, OSM_GUI, OSM_ALT, OSM_SFT, OSM_CTL, KC_RALT, | ||
89 | _______, ALT_TAB, MS_WHUP, MS_WHDN, KC_PGDN, INS_HARD, | ||
90 | _______, _______, | ||
91 | /*thumb*/ _______, _______, _______, | ||
92 | /*aux*/ _______, _______, | ||
93 | /* ^^^^ can't be used */ | ||
94 | KC_HOME, KC_PGDN, KC_PGUP, KC_END, KC_INS, KC_NO, | ||
95 | KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_DEL, KC_NO, | ||
96 | WIN_LEFT, WIN_DN, WIN_UP, WIN_RGHT, KC_PSTE, KC_NO, // KC_PSTE works in XTerm to emulate middle-click | ||
97 | _______, _______, | ||
98 | /*thumb*/ _______, _______, KC_BSPC, | ||
99 | /*aux*/ _______, _______ | ||
100 | /* ^^^^ use these */ | ||
101 | ), | ||
102 | |||
103 | // TODO: maybe swap # with ;, that way I can roll :w or :wq which I need | ||
104 | // often ... probably better to add a combo? | ||
105 | [L_NUM] = LAYOUT_uqs( | ||
106 | _______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, | ||
107 | _______, KC_SCLN, KC_COLN, KC_LCBR, KC_LPRN, KC_LBRC, | ||
108 | _______, KC_CIRC, KC_AMPR, KC_RCBR, KC_RPRN, KC_RBRC, | ||
109 | KC_GRV, KC_TILDE, | ||
110 | /*thumb*/ KC_ESC, KC_SPC, KC_0, | ||
111 | /*aux*/ _______,_______, | ||
112 | /* ^^^^ use these */ | ||
113 | |||
114 | KC_EQUAL, KC_7, KC_8, KC_9, KC_KP_PLUS,_______, | ||
115 | KC_KP_ASTERISK,KC_4,KC_5, KC_6, MINS_UNDSCR,_______, | ||
116 | KC_COMM, KC_1, KC_2, KC_3, KC_KP_SLASH,KC_KP_ENTER, // Enter here, because thumb is occupied | ||
117 | KC_0, KC_KP_DOT, | ||
118 | /*thumb*/ _______, _______, _______, | ||
119 | /*aux*/ _______, _______ | ||
120 | /* ^^^^ can't be used */ | ||
121 | ), | ||
122 | |||
123 | [L_FUNC] = LAYOUT_uqs( | ||
124 | _______, KC_NO, KC_MUTE, KC_VOLD, KC_VOLU, DF(L_WASD), | ||
125 | _______, KC_LGUI, KC_LALT, KC_LSFT, KC_LCTL, DF(L_QWER), | ||
126 | _______, KC_NO, KC_NO, KC_NO, KC_NO, DF(L_COLM), | ||
127 | KC_NO, KC_NO, | ||
128 | /*thumb*/ KC_NO, KC_NO, KC_NO, | ||
129 | /*aux*/ _______, _______, | ||
130 | /* ^^^^ use these */ | ||
131 | |||
132 | KC_PSCR, KC_F7, KC_F8, KC_F9, KC_F10, KC_NO, | ||
133 | KC_SLCK, KC_F4, KC_F5, KC_F6, KC_F11, KC_NO, | ||
134 | KC_PAUS, KC_F1, KC_F2, KC_F3, KC_F12, KC_NO, | ||
135 | KC_NO, KC_NO, | ||
136 | /*thumb*/ _______, _______, _______, | ||
137 | /*aux*/ _______, _______ | ||
138 | /* ^^^^ can't be used */ | ||
139 | ), | ||
140 | |||
141 | [L_MOUSE] = LAYOUT_uqs( | ||
142 | _______, KC_NO, KC_BTN2, KC_BTN3, KC_BTN1, KC_VOLU, | ||
143 | _______, KC_NO, KC_ACL0, KC_ACL1, KC_ACL2, KC_VOLD, | ||
144 | _______, KC_NO, KC_NO, KC_NO, KC_NO, KC_MUTE, | ||
145 | KC_NO, KC_NO, | ||
146 | /*thumb*/ _______, _______, _______, | ||
147 | /*aux*/ _______, _______, | ||
148 | /* ^^^^ can't be used */ | ||
149 | |||
150 | _______, _______, KC_MS_UP, MS_WHUP, _______, _______, | ||
151 | MS_WHLEFT,KC_MS_L, KC_MS_D, KC_MS_R, MS_WHRGHT,_______, | ||
152 | _______, MS_WHDN, KC_BTN3, KC_BTN4, KC_BTN5, _______, | ||
153 | KC_NO, KC_NO, | ||
154 | /*thumb*/ KC_NO, KC_BTN1, KC_BTN2, | ||
155 | /*aux*/ _______, _______ | ||
156 | /* use these ^^^^ */ | ||
157 | ), | ||
158 | }; | ||
diff --git a/keyboards/splitkb/kyria/keymaps/uqs/rules.mk b/keyboards/splitkb/kyria/keymaps/uqs/rules.mk new file mode 100644 index 000000000..517f469b6 --- /dev/null +++ b/keyboards/splitkb/kyria/keymaps/uqs/rules.mk | |||
@@ -0,0 +1 @@ | |||
OLED_ENABLE = no | |||
diff --git a/users/uqs/config.h b/users/uqs/config.h new file mode 100644 index 000000000..b8a140fe8 --- /dev/null +++ b/users/uqs/config.h | |||
@@ -0,0 +1,40 @@ | |||
1 | // Copyright 2022 Ulrich Spörlein (@uqs) | ||
2 | // SPDX-License-Identifier: GPL-2.0-or-later | ||
3 | #pragma once | ||
4 | |||
5 | #ifdef RGBLIGHT_ENABLE | ||
6 | # define RGBLIGHT_SLEEP | ||
7 | //# define RGBLIGHT_ANIMATIONS // disabled to save space | ||
8 | # define RGBLIGHT_LAYERS | ||
9 | # define RGBLIGHT_MAX_LAYERS 8 // default is 16 | ||
10 | # define RGBLIGHT_DISABLE_KEYCODES // RGB_foo keys no longer work, saves 600 bytes | ||
11 | # define RGBLIGHT_DEFAULT_HUE 15 | ||
12 | #endif | ||
13 | |||
14 | #define DYNAMIC_KEYMAP_LAYER_COUNT 6 // default is 4 for VIA builds | ||
15 | |||
16 | #define TAPPING_TOGGLE 2 // number of taps for a toggle-on-tap | ||
17 | #define TAPPING_TERM 170 // ms to trigger tap | ||
18 | // https://precondition.github.io/home-row-mods | ||
19 | #define TAPPING_FORCE_HOLD // make tap-then-hold _not_ do key auto repeat | ||
20 | #define IGNORE_MOD_TAP_INTERRUPT | ||
21 | #define PERMISSIVE_HOLD // I don't think this works for me, hence I rolled my own implementation. | ||
22 | |||
23 | #define LEADER_TIMEOUT 400 | ||
24 | #define LEADER_PER_KEY_TIMING | ||
25 | |||
26 | #define UNICODE_SELECTED_MODES UC_LNX | ||
27 | |||
28 | // make KC_ACL0 et al work when held. | ||
29 | #define MK_COMBINED | ||
30 | #define MOUSEKEY_WHEEL_INTERVAL 40 // default is 50, lower means more scroll events, 40 works ok. | ||
31 | |||
32 | // From https://michael.stapelberg.ch/posts/2021-05-08-keyboard-input-latency-qmk-kinesis/ | ||
33 | #define USB_POLLING_INTERVAL_MS 1 | ||
34 | |||
35 | #ifdef KEYBOARD_preonic_rev3 | ||
36 | // Some games seem to not register Esc otherwise when tapped, maybe try with this delay? | ||
37 | # define TAP_CODE_DELAY 30 | ||
38 | #else | ||
39 | # define TAP_CODE_DELAY 10 | ||
40 | #endif | ||
diff --git a/users/uqs/rules.mk b/users/uqs/rules.mk new file mode 100644 index 000000000..605036295 --- /dev/null +++ b/users/uqs/rules.mk | |||
@@ -0,0 +1,24 @@ | |||
1 | # don't include for keyboards/ploopyco/mouse/keymaps/uqs | ||
2 | ifeq ($(filter $(strip $(KEYBOARD)),ploopyco/mouse),) | ||
3 | SRC += uqs.c | ||
4 | |||
5 | RGBLIGHT_ENABLE ?= yes # Enable keyboard RGB underglow | ||
6 | LTO_ENABLE ?= yes # disables the legacy TMK Macros and Functions features | ||
7 | |||
8 | UCIS_ENABLE = yes | ||
9 | LEADER_ENABLE = yes | ||
10 | COMBO_ENABLE = yes | ||
11 | MOUSEKEY_ENABLE = yes | ||
12 | |||
13 | # Disable all the unused stuff. | ||
14 | SPACE_CADET_ENABLE = no | ||
15 | COMMAND_ENABLE = no | ||
16 | MAGIC_ENABLE = no | ||
17 | endif | ||
18 | |||
19 | # From https://michael.stapelberg.ch/posts/2021-05-08-keyboard-input-latency-qmk-kinesis/ | ||
20 | # adds about 900 bytes! Don't use it on puny AVR though. | ||
21 | # ifeq (,$(filter $(MCU), atmega16u2 atmega32u2 at90usb162)) # doesn't work MCU not set yet | ||
22 | ifneq (,$(filter $(KEYBOARD),ploopyco/mouse preonic/rev3)) | ||
23 | DEBOUNCE_TYPE = asym_eager_defer_pk | ||
24 | endif | ||
diff --git a/users/uqs/uqs.c b/users/uqs/uqs.c new file mode 100644 index 000000000..72284143c --- /dev/null +++ b/users/uqs/uqs.c | |||
@@ -0,0 +1,584 @@ | |||
1 | // Copyright 2022 Ulrich Spörlein (@uqs) | ||
2 | // SPDX-License-Identifier: GPL-2.0-or-later | ||
3 | // vi:et sw=4: | ||
4 | |||
5 | #include "uqs.h" | ||
6 | |||
7 | // LOG: | ||
8 | // late Jan 2020, got Ohkeycaps Dactyl Manuform 5x6 | ||
9 | // https://play.typeracer.com shows about 75-80wpm (en) or ~400cpm (de) on my classic keeb. | ||
10 | // Never did proper touch typing, basically didn't use ring finger much, mostly index/middle and pinky (only to hold down modifiers, really). | ||
11 | // Feb 2020, switching to Colemak DH after 30 years of Qwerty, uh oh... | ||
12 | // mid Feb, 20wpm/87% on monkeytype.com (no punct, numbers) | ||
13 | // early March, 28wpm/90% on MT (plus punct./numbers from here on); 25wpm on typeracer | ||
14 | // early April, 35wpm/92% on MT; 41wpm on typeracer | ||
15 | // early May, 45wpm/96% on MT; 46wpm on typeracer; my qwerty is deteriorating, I need to look at the keys more and more o_O | ||
16 | // early June, 49wpm/95% on MT (sigh ...); 50wpm on typeracer; | ||
17 | // early July, 50wpm/96% on MT (...); 52wpm/96% on typeracer; | ||
18 | // early August, 55wpm/96% on MT; 55wpm/98% on typeracer; | ||
19 | // early September, 57wpm/97% on MT; 58wpm/97% on typeracer; | ||
20 | // early October, 59wpm/96% on MT; 61wpm/97% on typeracer; | ||
21 | // November, 56wpm/97% on MT; 62wpm/98% on typeracer; | ||
22 | // December, 62wpm/96% on MT; 66wpm/98% on typeracer; | ||
23 | // January, 61wpm/97% on MT; 65wpm/98% on typeracer; | ||
24 | // February, 64wpm/97% on MT; 67wpm/98% on typeracer; my qwerty on the laptop is still fine, but I miss my shortcuts badly. | ||
25 | // | ||
26 | // So that's one year on Colemak. Was it worth the switch? Probably not, though | ||
27 | // I also had to first learn proper technique, but that was actually swift, as | ||
28 | // the keyboard nicely forces that on you. I really like home row mods though, | ||
29 | // they are so comfy. Need to rethink my combos some more, still. | ||
30 | |||
31 | |||
32 | #ifdef RGBLIGHT_LAYERS | ||
33 | layer_state_t default_layer_state_set_user(layer_state_t state) { | ||
34 | rgblight_set_layer_state(L_QWER, layer_state_cmp(state, L_QWER)); | ||
35 | rgblight_set_layer_state(L_WASD, layer_state_cmp(state, L_WASD)); | ||
36 | rgblight_set_layer_state(L_COLM, layer_state_cmp(state, L_COLM)); | ||
37 | return state; | ||
38 | } | ||
39 | #endif | ||
40 | |||
41 | layer_state_t layer_state_set_user(layer_state_t state) { | ||
42 | #if 0 | ||
43 | // defining layer L_FUNC when both keys are pressed | ||
44 | state = update_tri_layer_state(state, L_EXTD, L_NUM, L_FUNC); | ||
45 | #endif | ||
46 | #ifdef RGBLIGHT_LAYERS | ||
47 | rgblight_set_layer_state(L_EXTD, layer_state_cmp(state, L_EXTD)); | ||
48 | rgblight_set_layer_state(L_NUM, layer_state_cmp(state, L_NUM)); | ||
49 | rgblight_set_layer_state(L_FUNC, layer_state_cmp(state, L_FUNC)); | ||
50 | rgblight_set_layer_state(L_MOUSE, layer_state_cmp(state, L_MOUSE)); | ||
51 | #else | ||
52 | #endif | ||
53 | return state; | ||
54 | } | ||
55 | |||
56 | #ifdef RGBLIGHT_LAYERS | ||
57 | // NOTE: at most 2 elements, last one needs to be RGBLIGHT_END_SEGMENTS | ||
58 | typedef rgblight_segment_t rgblight_layer_t[3]; | ||
59 | |||
60 | const rgblight_layer_t PROGMEM my_rgb_segments[] = { | ||
61 | [L_QWER] = {{0, RGBLED_NUM, HSV_WHITE}, RGBLIGHT_END_SEGMENTS}, | ||
62 | [L_WASD] = {{0, RGBLED_NUM/2, HSV_RED}, {RGBLED_NUM/2, RGBLED_NUM/2, HSV_OFF}, RGBLIGHT_END_SEGMENTS}, | ||
63 | [L_COLM] = {{0, RGBLED_NUM, HSV_GREEN}, RGBLIGHT_END_SEGMENTS}, | ||
64 | [L_EXTD] = {{0, RGBLED_NUM, HSV_BLUE}, RGBLIGHT_END_SEGMENTS}, | ||
65 | [L_NUM] = {{0, RGBLED_NUM, HSV_ORANGE}, RGBLIGHT_END_SEGMENTS}, | ||
66 | [L_FUNC] = {{0, RGBLED_NUM, HSV_YELLOW}, RGBLIGHT_END_SEGMENTS}, | ||
67 | [L_MOUSE]= {{0, RGBLED_NUM, HSV_PURPLE}, RGBLIGHT_END_SEGMENTS}, | ||
68 | }; | ||
69 | |||
70 | // This array needs pointers, :/ | ||
71 | const rgblight_segment_t* const PROGMEM my_rgb_layers[] = { | ||
72 | my_rgb_segments[L_QWER], | ||
73 | my_rgb_segments[L_WASD], | ||
74 | my_rgb_segments[L_COLM], | ||
75 | my_rgb_segments[L_EXTD], | ||
76 | my_rgb_segments[L_NUM], | ||
77 | my_rgb_segments[L_FUNC], | ||
78 | my_rgb_segments[L_MOUSE], | ||
79 | }; | ||
80 | |||
81 | _Static_assert(sizeof(my_rgb_layers) / sizeof(my_rgb_layers[0]) == | ||
82 | sizeof(my_rgb_segments) / sizeof(my_rgb_segments[0]), | ||
83 | "Number of rgb_segment definitions does not match up!"); | ||
84 | #endif | ||
85 | |||
86 | #ifdef COMBO_ENABLE | ||
87 | enum combo_events { | ||
88 | C_AUML, | ||
89 | C_OUML, | ||
90 | C_UUML, | ||
91 | C_SZ, | ||
92 | C_CBR, | ||
93 | C_PRN, | ||
94 | C_BRC, | ||
95 | }; | ||
96 | |||
97 | // Maybe use this? | ||
98 | // #define COMBO_ONLY_FROM_LAYER L_COLM | ||
99 | |||
100 | // The official way has way too much duplication and intermediate names for my taste... | ||
101 | const uint16_t PROGMEM my_action_combos[][3] = { | ||
102 | [C_AUML] = {KC_G_A, KC_W, COMBO_END}, | ||
103 | [C_OUML] = {KC_G_O, KC_Y, COMBO_END}, | ||
104 | [C_UUML] = {KC_C_N, KC_U, COMBO_END}, | ||
105 | [C_SZ] = {KC_S_S, KC_Z, COMBO_END}, | ||
106 | [C_CBR] = {KC_COLN, KC_LCBR, COMBO_END}, | ||
107 | [C_PRN] = {KC_LCBR, KC_LPRN, COMBO_END}, | ||
108 | [C_BRC] = {KC_LPRN, KC_LBRC, COMBO_END}, | ||
109 | }; | ||
110 | const uint16_t PROGMEM my_combos[][4] = { | ||
111 | {KC_LPRN, KC_F, KC_P, COMBO_END}, | ||
112 | {KC_RPRN, KC_C, KC_D, COMBO_END}, | ||
113 | {KC_LCBR, KC_W, KC_F, COMBO_END}, | ||
114 | {KC_RCBR, KC_X, KC_C, COMBO_END}, | ||
115 | {KC_TAB, KC_G_A, KC_A_R, COMBO_END}, | ||
116 | {KC_BSLS, KC_B, KC_J, COMBO_END}, // remove this? | ||
117 | {KC_BSLS, KC_F, KC_U, COMBO_END}, | ||
118 | {LSFT(KC_BSLS), KC_P, KC_L, COMBO_END}, | ||
119 | {KC_MINUS, KC_C_T, KC_C_N, COMBO_END}, | ||
120 | {LSFT(KC_MINUS), KC_D, KC_H, COMBO_END}, | ||
121 | {KC_GRV, KC_Q, KC_W, COMBO_END}, // remove this? | ||
122 | {KC_GRV, KC_C, KC_COMM, COMBO_END}, | ||
123 | {LSFT(KC_GRV), KC_G, KC_M, COMBO_END}, | ||
124 | {KC_BTN3, KC_BTN1, KC_BTN2, COMBO_END}, | ||
125 | {KC_BTN1, KC_BTN2, KC_BTN3, COMBO_END}, | ||
126 | }; | ||
127 | |||
128 | const uint16_t COMBO_LEN = sizeof(my_action_combos) / sizeof(my_action_combos[0]) + sizeof(my_combos) / sizeof(my_combos[0]); | ||
129 | |||
130 | #define MY_ACTION_COMBO(ck) \ | ||
131 | [ck] = { .keys = &(my_action_combos[ck][0]) } | ||
132 | #define MY_COMBO(ck) \ | ||
133 | { .keys = &(my_combos[ck][1]), .keycode = my_combos[ck][0] } | ||
134 | |||
135 | // NOTE: while my_combos can live in PROGMEM, the key_combos data also | ||
136 | // contains state that is tweaked at runtime, so we need to indirect. Ugh. | ||
137 | #define COMBO_STATICALLY | ||
138 | #ifdef COMBO_STATICALLY | ||
139 | // TODO: fill this at runtime with a loop? | ||
140 | combo_t key_combos[] = { | ||
141 | MY_ACTION_COMBO(0), | ||
142 | MY_ACTION_COMBO(1), | ||
143 | MY_ACTION_COMBO(2), | ||
144 | MY_ACTION_COMBO(3), | ||
145 | MY_ACTION_COMBO(4), | ||
146 | MY_ACTION_COMBO(5), | ||
147 | MY_ACTION_COMBO(6), | ||
148 | MY_COMBO(0), | ||
149 | MY_COMBO(1), | ||
150 | MY_COMBO(2), | ||
151 | MY_COMBO(3), | ||
152 | MY_COMBO(4), | ||
153 | MY_COMBO(5), | ||
154 | MY_COMBO(6), | ||
155 | MY_COMBO(7), | ||
156 | MY_COMBO(8), | ||
157 | MY_COMBO(9), | ||
158 | MY_COMBO(10), | ||
159 | MY_COMBO(11), | ||
160 | MY_COMBO(12), | ||
161 | MY_COMBO(13), | ||
162 | MY_COMBO(14), | ||
163 | }; | ||
164 | |||
165 | _Static_assert(sizeof(key_combos) / sizeof(key_combos[0]) == | ||
166 | (sizeof(my_action_combos) / sizeof(my_action_combos[0]) + sizeof(my_combos) / sizeof(my_combos[0])), | ||
167 | "Number of combo definitions does not match up!"); | ||
168 | #else | ||
169 | combo_t key_combos[sizeof(my_action_combos) / sizeof(my_action_combos[0]) + sizeof(my_combos) / sizeof(my_combos[0])]; | ||
170 | #endif | ||
171 | |||
172 | void process_combo_event(uint16_t combo_index, bool pressed) { | ||
173 | switch (combo_index) { | ||
174 | case C_AUML: | ||
175 | if (pressed) { | ||
176 | tap_code16(KC_RALT); | ||
177 | tap_code16(LSFT(KC_QUOT)); | ||
178 | tap_code16(KC_A); | ||
179 | } | ||
180 | break; | ||
181 | case C_OUML: | ||
182 | if (pressed) { | ||
183 | tap_code16(KC_RALT); | ||
184 | tap_code16(LSFT(KC_QUOT)); | ||
185 | tap_code16(KC_O); | ||
186 | } | ||
187 | break; | ||
188 | case C_UUML: | ||
189 | if (pressed) { | ||
190 | tap_code16(KC_RALT); | ||
191 | tap_code16(LSFT(KC_QUOT)); | ||
192 | tap_code16(KC_U); | ||
193 | } | ||
194 | break; | ||
195 | case C_SZ: | ||
196 | if (pressed) { | ||
197 | tap_code16(KC_RALT); | ||
198 | tap_code16(KC_S); | ||
199 | tap_code16(KC_S); | ||
200 | } | ||
201 | break; | ||
202 | case C_CBR: | ||
203 | if (pressed) { | ||
204 | tap_code16(KC_LCBR); | ||
205 | tap_code16(KC_RCBR); | ||
206 | tap_code16(KC_LEFT); | ||
207 | } | ||
208 | break; | ||
209 | case C_PRN: | ||
210 | if (pressed) { | ||
211 | tap_code16(KC_LPRN); | ||
212 | tap_code16(KC_RPRN); | ||
213 | tap_code16(KC_LEFT); | ||
214 | } | ||
215 | break; | ||
216 | case C_BRC: | ||
217 | if (pressed) { | ||
218 | tap_code16(KC_LBRC); | ||
219 | tap_code16(KC_RBRC); | ||
220 | tap_code16(KC_LEFT); | ||
221 | } | ||
222 | break; | ||
223 | } | ||
224 | } | ||
225 | #endif | ||
226 | |||
227 | void keyboard_post_init_user(void) { | ||
228 | #ifndef KEYBOARD_preonic_rev3 | ||
229 | default_layer_set(1ul << L_COLM); | ||
230 | #endif | ||
231 | #ifdef RGBLIGHT_LAYERS | ||
232 | // Enable the LED layers | ||
233 | rgblight_layers = my_rgb_layers; | ||
234 | rgblight_set_layer_state(0, true); | ||
235 | #endif | ||
236 | #if defined(COMBO_ENABLE) && !defined(COMBO_STATICALLY) | ||
237 | uint8_t i = 0; | ||
238 | for (; i < sizeof(my_action_combos) / sizeof(my_action_combos[0]); i++) { | ||
239 | key_combos[i].keys = &(my_action_combos[i][0]); | ||
240 | } | ||
241 | for (uint8_t j = 0; j < sizeof(my_combos) / sizeof(my_combos[0]); j++, i++) { | ||
242 | key_combos[i].keycode = my_combos[j][0]; | ||
243 | key_combos[i].keys = &(my_combos[j][1]); | ||
244 | } | ||
245 | #endif | ||
246 | } | ||
247 | |||
248 | uint16_t key_timer; | ||
249 | bool delkey_registered; | ||
250 | bool num_layer_was_used; | ||
251 | bool extd_layer_was_used; | ||
252 | // These keep state about the long-press-means-umlaut keys. | ||
253 | bool auml_pressed; | ||
254 | bool ouml_pressed; | ||
255 | bool uuml_pressed; | ||
256 | |||
257 | void maybe_send_umlaut(uint16_t keycode, bool *is_pressed) { | ||
258 | // Some other key did _not_ already re-arm this key, so now we need to do | ||
259 | // that ourselves. | ||
260 | if (*is_pressed) { | ||
261 | *is_pressed = false; | ||
262 | // If released within the timer, then just KC_A, KC_O, KC_U | ||
263 | if (timer_elapsed(key_timer) < TAPPING_TERM) { | ||
264 | tap_code16(keycode); | ||
265 | } else { | ||
266 | tap_code16(KC_RALT); | ||
267 | tap_code16(LSFT(KC_QUOT)); | ||
268 | tap_code16(keycode); | ||
269 | } | ||
270 | } | ||
271 | } | ||
272 | |||
273 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | ||
274 | // TODO: why not use key_timer here? is it dynamic or not? | ||
275 | static uint16_t extd_layer_timer; | ||
276 | if (layer_state_is(L_EXTD) && record->event.pressed) { | ||
277 | extd_layer_was_used = true; | ||
278 | } | ||
279 | if (layer_state_is(L_NUM) && record->event.pressed) { | ||
280 | num_layer_was_used = true; | ||
281 | } | ||
282 | |||
283 | // An umlaut key was pressed previously (but will only emit the key on | ||
284 | // release), but we've pressed a different key now, so fire the regular key, | ||
285 | // re-arm it and continue with whatever actual key was pressed just now. | ||
286 | if (record->event.pressed) { | ||
287 | if (auml_pressed) { | ||
288 | tap_code16(KC_A); | ||
289 | auml_pressed = false; | ||
290 | } | ||
291 | if (ouml_pressed) { | ||
292 | tap_code16(KC_O); | ||
293 | ouml_pressed = false; | ||
294 | } | ||
295 | if (uuml_pressed) { | ||
296 | tap_code16(KC_U); | ||
297 | uuml_pressed = false; | ||
298 | } | ||
299 | } | ||
300 | |||
301 | switch (keycode) { | ||
302 | // From https://github.com/qmk/qmk_firmware/issues/6053 | ||
303 | case LT_EXTD_ESC: | ||
304 | if (record->event.pressed) { | ||
305 | extd_layer_was_used = false; | ||
306 | extd_layer_timer = timer_read(); | ||
307 | layer_on(L_EXTD); | ||
308 | } else { | ||
309 | layer_off(L_EXTD); | ||
310 | unregister_mods(MOD_BIT(KC_LALT)); // undo what ALT_TAB might've set | ||
311 | // NOTE: need to track whether we made use of the extd layer and | ||
312 | // that all happened within the tapping term. Otherwise we'd emit | ||
313 | // that layer key code _plus_ an extra Esc. | ||
314 | if (timer_elapsed(extd_layer_timer) < TAPPING_TERM && !extd_layer_was_used) { | ||
315 | tap_code(KC_ESC); | ||
316 | } | ||
317 | } | ||
318 | return true; | ||
319 | case LT_NUM_BSPC: | ||
320 | if (record->event.pressed){ | ||
321 | num_layer_was_used = false; | ||
322 | extd_layer_timer = timer_read(); | ||
323 | layer_on(L_NUM); | ||
324 | } else { | ||
325 | layer_off(L_NUM); | ||
326 | // NOTE: Custom LT method so that any press of a key on that layer will prevent the backspace. | ||
327 | if (timer_elapsed(extd_layer_timer) < TAPPING_TERM && !num_layer_was_used) { | ||
328 | tap_code(KC_BSPC); | ||
329 | } | ||
330 | } | ||
331 | return true; | ||
332 | case LT_MOUSE_ALT_SHIFT_INS: | ||
333 | if (record->event.pressed) { | ||
334 | key_timer = timer_read(); | ||
335 | layer_on(L_MOUSE); | ||
336 | } else { | ||
337 | layer_off(L_MOUSE); | ||
338 | if (timer_elapsed(key_timer) < TAPPING_TERM) { | ||
339 | tap_code16(LALT(LSFT(KC_INS))); | ||
340 | } | ||
341 | } | ||
342 | return true; | ||
343 | case LT_FUNC_SHIFT_INS: | ||
344 | if (record->event.pressed) { | ||
345 | key_timer = timer_read(); | ||
346 | layer_on(L_FUNC); | ||
347 | } else { | ||
348 | layer_off(L_FUNC); | ||
349 | if (timer_elapsed(key_timer) < TAPPING_TERM) { | ||
350 | tap_code16(LSFT(KC_INS)); | ||
351 | } | ||
352 | } | ||
353 | return true; | ||
354 | #if 1 | ||
355 | /* Looks like PERMISSIVE_HOLD on LT and OSM doesn't work properly. This | ||
356 | * is probaby https://github.com/qmk/qmk_firmware/issues/8971 | ||
357 | */ | ||
358 | case OSM_GUI: | ||
359 | /* OSM(MOD_LGUI) is delaying the event, but I need immediate triggering | ||
360 | * of the modifier to move windows around with the mouse. If only | ||
361 | * tapped, however, have it be a win OSM */ | ||
362 | if (record->event.pressed) { | ||
363 | key_timer = timer_read(); | ||
364 | register_mods(MOD_BIT(KC_LGUI)); | ||
365 | } else { | ||
366 | unregister_mods(MOD_BIT(KC_LGUI)); | ||
367 | if (timer_elapsed(key_timer) < TAPPING_TERM) { | ||
368 | add_oneshot_mods(MOD_BIT(KC_LGUI)); | ||
369 | } else { | ||
370 | del_oneshot_mods(MOD_BIT(KC_LGUI)); | ||
371 | } | ||
372 | } | ||
373 | return true; | ||
374 | // Why do I have to roll my own? It seems the original ones work on | ||
375 | // keyrelease, at which time I might have let go of the layer tap | ||
376 | // already, so I cannot roll them fast... | ||
377 | case OSM_SFT: | ||
378 | if (record->event.pressed) { | ||
379 | key_timer = timer_read(); | ||
380 | register_mods(MOD_BIT(KC_LSFT)); | ||
381 | } else { | ||
382 | unregister_mods(MOD_BIT(KC_LSFT)); | ||
383 | if (timer_elapsed(key_timer) < TAPPING_TERM) { | ||
384 | add_oneshot_mods(MOD_BIT(KC_LSFT)); | ||
385 | } /*else { | ||
386 | del_oneshot_mods(MOD_BIT(KC_LSFT)); | ||
387 | }*/ | ||
388 | } | ||
389 | return true; | ||
390 | case OSM_CTL: | ||
391 | if (record->event.pressed) { | ||
392 | key_timer = timer_read(); | ||
393 | register_mods(MOD_BIT(KC_LCTL)); | ||
394 | } else { | ||
395 | unregister_mods(MOD_BIT(KC_LCTL)); | ||
396 | if (timer_elapsed(key_timer) < TAPPING_TERM) { | ||
397 | add_oneshot_mods(MOD_BIT(KC_LCTL)); | ||
398 | } /*else { | ||
399 | del_oneshot_mods(MOD_BIT(KC_LCTL)); | ||
400 | }*/ | ||
401 | } | ||
402 | return true; | ||
403 | case OSM_ALT: | ||
404 | if (record->event.pressed) { | ||
405 | key_timer = timer_read(); | ||
406 | register_mods(MOD_BIT(KC_LALT)); | ||
407 | } else { | ||
408 | unregister_mods(MOD_BIT(KC_LALT)); | ||
409 | if (timer_elapsed(key_timer) < TAPPING_TERM) { | ||
410 | add_oneshot_mods(MOD_BIT(KC_LALT)); | ||
411 | } /*else { | ||
412 | del_oneshot_mods(MOD_BIT(KC_LALT)); | ||
413 | }*/ | ||
414 | } | ||
415 | return true; | ||
416 | #else | ||
417 | #define OSM_ALT OSM(MOD_LALT) | ||
418 | #define OSM_CTL OSM(MOD_LCTL) | ||
419 | #define OSM_GUI OSM(MOD_LGUI) | ||
420 | #define OSM_SFT OSM(MOD_LSFT) | ||
421 | #endif | ||
422 | // Obsoleted by using combos for umlauts now. | ||
423 | case KC_A_AE: | ||
424 | if (record->event.pressed) { | ||
425 | key_timer = timer_read(); | ||
426 | auml_pressed = true; | ||
427 | } else { | ||
428 | maybe_send_umlaut(KC_A, ä_pressed); | ||
429 | } | ||
430 | break; | ||
431 | case KC_O_OE: | ||
432 | if (record->event.pressed) { | ||
433 | key_timer = timer_read(); | ||
434 | ouml_pressed = true; | ||
435 | } else { | ||
436 | maybe_send_umlaut(KC_O, ö_pressed); | ||
437 | } | ||
438 | break; | ||
439 | case KC_U_UE: | ||
440 | if (record->event.pressed) { | ||
441 | key_timer = timer_read(); | ||
442 | uuml_pressed = true; | ||
443 | } else { | ||
444 | maybe_send_umlaut(KC_U, ü_pressed); | ||
445 | } | ||
446 | break; | ||
447 | case MINS_UNDSCR: | ||
448 | if (record->event.pressed) { | ||
449 | key_timer = timer_read(); | ||
450 | } else { | ||
451 | if (timer_elapsed(key_timer) < TAPPING_TERM) { | ||
452 | // Can't send KC_KP_MINUS, it doesn't compose to, say → | ||
453 | tap_code16(KC_MINUS); | ||
454 | } else { | ||
455 | tap_code16(KC_UNDERSCORE); | ||
456 | } | ||
457 | } | ||
458 | break; | ||
459 | case ALT_TAB: | ||
460 | if (record->event.pressed) { | ||
461 | register_mods(MOD_BIT(KC_LALT)); | ||
462 | tap_code16(KC_TAB); | ||
463 | } | ||
464 | break; | ||
465 | case INS_HARD: | ||
466 | // Do Alt-Shift-Ins first to have xdotool copy from SELECTION to CLIPBOARD, then Shift-Ins to paste. | ||
467 | if (record->event.pressed) { | ||
468 | tap_code16(LSFT(LALT(KC_INS))); | ||
469 | } else { | ||
470 | tap_code16(LSFT(KC_INS)); | ||
471 | } | ||
472 | break; | ||
473 | case SHIFT_INS: | ||
474 | if (record->event.pressed) { | ||
475 | // when keycode is pressed | ||
476 | key_timer = timer_read(); | ||
477 | // Shift when held ... | ||
478 | register_mods(MOD_BIT(KC_RSFT)); | ||
479 | } else { | ||
480 | // If released within the timer, then Shift+Ins | ||
481 | if (timer_elapsed(key_timer) < TAPPING_TERM) { | ||
482 | tap_code16(KC_INS); | ||
483 | } | ||
484 | unregister_mods(MOD_BIT(KC_RSFT)); | ||
485 | } | ||
486 | break; | ||
487 | case ALT_SHIFT_INS: | ||
488 | if (record->event.pressed) { | ||
489 | key_timer = timer_read(); | ||
490 | // Shift when held ... | ||
491 | register_mods(MOD_BIT(KC_LSFT)); | ||
492 | } else { | ||
493 | // If released within the timer, then Shift+Alt+Ins | ||
494 | if (timer_elapsed(key_timer) < TAPPING_TERM) { | ||
495 | register_mods(MOD_BIT(KC_LALT)); | ||
496 | tap_code16(KC_INS); | ||
497 | } | ||
498 | // Note: this makes xev(1) see KeyPress for Meta_L but KeyRelease for Alt_L | ||
499 | unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_LALT)); | ||
500 | } | ||
501 | break; | ||
502 | /* | ||
503 | * Obsoleted by making tmux understand Ctrl-(Shift)-Tab natively. | ||
504 | case TM_NEXT: | ||
505 | if (record->event.pressed) SEND_STRING(SS_LCTRL("a") "n"); | ||
506 | break; | ||
507 | case TM_PREV: | ||
508 | if (record->event.pressed) SEND_STRING(SS_LCTRL("a") "p"); | ||
509 | break; | ||
510 | */ | ||
511 | // TODO: use key overrides to turn, e.g. Win+Ctrl-Tab into VIM_NEXT. | ||
512 | // Not sure why Ctrl-Pgup works in vim, but not in vim-inside-tmux. | ||
513 | case VIM_NEXT: | ||
514 | if (record->event.pressed) SEND_STRING(SS_TAP(X_ESC) SS_TAP(X_G) SS_TAP(X_T)); | ||
515 | break; | ||
516 | case VIM_PREV: | ||
517 | if (record->event.pressed) SEND_STRING(SS_TAP(X_ESC) SS_TAP(X_G) SS_LSFT("t")); | ||
518 | break; | ||
519 | case WIN_LEFT: | ||
520 | if (record->event.pressed) SEND_STRING(SS_LCTRL("w") SS_TAP(X_H)); | ||
521 | break; | ||
522 | case WIN_DN: | ||
523 | if (record->event.pressed) SEND_STRING(SS_LCTRL("w") SS_TAP(X_J)); | ||
524 | break; | ||
525 | case WIN_UP: | ||
526 | if (record->event.pressed) SEND_STRING(SS_LCTRL("w") SS_TAP(X_K)); | ||
527 | break; | ||
528 | case WIN_RGHT: | ||
529 | if (record->event.pressed) SEND_STRING(SS_LCTRL("w") SS_TAP(X_L)); | ||
530 | break; | ||
531 | } | ||
532 | |||
533 | return true; | ||
534 | } | ||
535 | |||
536 | #ifdef LEADER_ENABLE | ||
537 | LEADER_EXTERNS(); | ||
538 | |||
539 | void matrix_scan_user(void) { | ||
540 | LEADER_DICTIONARY() { | ||
541 | leading = false; | ||
542 | leader_end(); | ||
543 | |||
544 | #ifdef UCIS_ENABLE | ||
545 | SEQ_ONE_KEY(KC_U) { | ||
546 | qk_ucis_start(); | ||
547 | } | ||
548 | #endif | ||
549 | SEQ_ONE_KEY(KC_H) { | ||
550 | send_unicode_string("ᕕ( ᐛ )ᕗ"); // happy | ||
551 | } | ||
552 | SEQ_ONE_KEY(KC_D) { | ||
553 | send_unicode_string("ಠ_ಠ"); // disapproval | ||
554 | } | ||
555 | SEQ_ONE_KEY(KC_L) { | ||
556 | send_unicode_string("( ͡° ͜ʖ ͡°)"); // lenny | ||
557 | } | ||
558 | SEQ_ONE_KEY(KC_S) { | ||
559 | send_unicode_string("¯\\_(ツ)_/¯"); // shrug | ||
560 | } | ||
561 | // tableflip (LEADER - TF) | ||
562 | SEQ_TWO_KEYS(KC_T, KC_F) { | ||
563 | //set_unicode_input_mode(UC_LNX); | ||
564 | //send_unicode_hex_string("0028 30CE 0CA0 75CA 0CA0 0029 30CE 5F61 253B 2501 253B"); | ||
565 | send_unicode_string("(╯°□°)╯︵ ┻━┻"); | ||
566 | } | ||
567 | // untableflip | ||
568 | SEQ_THREE_KEYS(KC_U, KC_T, KC_F) { | ||
569 | //set_unicode_input_mode(UC_LNX); | ||
570 | //send_unicode_hex_string("0028 30CE 0CA0 75CA 0CA0 0029 30CE 5F61 253B 2501 253B"); | ||
571 | send_unicode_string("┬─┬ノ( º _ ºノ)"); | ||
572 | } | ||
573 | } | ||
574 | } | ||
575 | #endif | ||
576 | |||
577 | #ifdef UCIS_ENABLE | ||
578 | // 3 codepoints at most, otherwise increase UCIS_MAX_CODE_POINTS | ||
579 | const qk_ucis_symbol_t ucis_symbol_table[] = UCIS_TABLE( | ||
580 | UCIS_SYM("poop", 0x1F4A9), // 💩 | ||
581 | UCIS_SYM("rofl", 0x1F923), // 🤣 | ||
582 | UCIS_SYM("look", 0x0CA0, 0x005F, 0x0CA0) // ಠ_ಠ | ||
583 | ); | ||
584 | #endif | ||
diff --git a/users/uqs/uqs.h b/users/uqs/uqs.h new file mode 100644 index 000000000..f8b30caf7 --- /dev/null +++ b/users/uqs/uqs.h | |||
@@ -0,0 +1,77 @@ | |||
1 | // Copyright 2022 Ulrich Spörlein (@uqs) | ||
2 | // SPDX-License-Identifier: GPL-2.0-or-later | ||
3 | // vi:et sw=4: | ||
4 | #pragma once | ||
5 | |||
6 | #include QMK_KEYBOARD_H | ||
7 | |||
8 | enum layers { | ||
9 | L_QWER = 0, | ||
10 | L_WASD, // wasd gaming | ||
11 | L_COLM, // Colemak DHm | ||
12 | L_EXTD, | ||
13 | L_NUM, | ||
14 | L_FUNC, | ||
15 | L_MOUSE, | ||
16 | L_LAST, // unused | ||
17 | }; | ||
18 | |||
19 | #ifdef VIA_ENABLE | ||
20 | _Static_assert(DYNAMIC_KEYMAP_LAYER_COUNT >= L_LAST, "VIA enabled, but not enough DYNAMIC_KEYMAP_LAYER_COUNT for all layers"); | ||
21 | #endif | ||
22 | |||
23 | #define KC_CTAB LCTL(KC_TAB) | ||
24 | #define KC_SCTAB LCTL(LSFT(KC_TAB)) | ||
25 | |||
26 | // Custom single-key codes, see uqs.c for the combos. | ||
27 | enum custom_keycodes { | ||
28 | SHIFT_INS = SAFE_RANGE, | ||
29 | ALT_SHIFT_INS, | ||
30 | INS_HARD, | ||
31 | KC_A_AE, | ||
32 | KC_O_OE, | ||
33 | KC_U_UE, | ||
34 | MINS_UNDSCR, // obsoleted by combos, remove this! | ||
35 | TM_NEXT, | ||
36 | TM_PREV, | ||
37 | VIM_NEXT, | ||
38 | VIM_PREV, | ||
39 | WIN_LEFT, | ||
40 | WIN_RGHT, | ||
41 | WIN_UP, | ||
42 | WIN_DN, | ||
43 | LT_EXTD_ESC, | ||
44 | LT_NUM_BSPC, | ||
45 | LT_MOUSE_ALT_SHIFT_INS, | ||
46 | LT_FUNC_SHIFT_INS, | ||
47 | OSM_GUI, | ||
48 | OSM_SFT, | ||
49 | OSM_CTL, | ||
50 | OSM_ALT, | ||
51 | ALT_TAB, | ||
52 | }; | ||
53 | |||
54 | #ifndef LEADER_ENABLE | ||
55 | #define KC_LEAD KC_NO | ||
56 | #endif | ||
57 | |||
58 | // Shorter names | ||
59 | #define MS_WHDN KC_MS_WH_DOWN | ||
60 | #define MS_WHUP KC_MS_WH_UP | ||
61 | #define MS_WHLEFT KC_MS_WH_LEFT | ||
62 | #define MS_WHRGHT KC_MS_WH_RIGHT | ||
63 | |||
64 | // GASC/◆⎇⇧⎈ home row mod, read all about it here: | ||
65 | // https://precondition.github.io/home-row-mods | ||
66 | // Left-hand home row mods | ||
67 | #define KC_G_A LGUI_T(KC_A) | ||
68 | #define KC_A_R LALT_T(KC_R) | ||
69 | #define KC_S_S LSFT_T(KC_S) | ||
70 | #define KC_C_T LCTL_T(KC_T) | ||
71 | |||
72 | // Right-hand home row mods | ||
73 | #define KC_C_N RCTL_T(KC_N) | ||
74 | #define KC_S_E RSFT_T(KC_E) | ||
75 | #define KC_A_I LALT_T(KC_I) // RALT is special, it's AltGr and my compose key under Win (layout UScmpse) and *nix (setxkbmap -option compose:ralt) | ||
76 | #define KC_G_O RGUI_T(KC_O) | ||
77 | |||