diff options
Diffstat (limited to 'keyboards/dumbo/keymaps')
-rw-r--r-- | keyboards/dumbo/keymaps/default/config.h | 21 | ||||
-rw-r--r-- | keyboards/dumbo/keymaps/default/keymap.c | 232 | ||||
-rw-r--r-- | keyboards/dumbo/keymaps/default/rules.mk | 3 | ||||
-rw-r--r-- | keyboards/dumbo/keymaps/trip-trap/config.h | 27 | ||||
-rw-r--r-- | keyboards/dumbo/keymaps/trip-trap/keymap.c | 430 | ||||
-rw-r--r-- | keyboards/dumbo/keymaps/trip-trap/rules.mk | 4 |
6 files changed, 717 insertions, 0 deletions
diff --git a/keyboards/dumbo/keymaps/default/config.h b/keyboards/dumbo/keymaps/default/config.h new file mode 100644 index 000000000..3b330ce54 --- /dev/null +++ b/keyboards/dumbo/keymaps/default/config.h | |||
@@ -0,0 +1,21 @@ | |||
1 | /* Copyright 2020 Adam Naldal <[email protected]> | ||
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 | |||
17 | #pragma once | ||
18 | |||
19 | // If you are using an Elite C rev3 on the slave side, uncomment the lines below: | ||
20 | // #define SPLIT_USB_DETECT | ||
21 | // #define NO_USB_STARTUP_CHECK | ||
diff --git a/keyboards/dumbo/keymaps/default/keymap.c b/keyboards/dumbo/keymaps/default/keymap.c new file mode 100644 index 000000000..7fc3ffc2c --- /dev/null +++ b/keyboards/dumbo/keymaps/default/keymap.c | |||
@@ -0,0 +1,232 @@ | |||
1 | /* Copyright 2020 Adam Naldal <[email protected]> | ||
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 | enum layers { | ||
19 | _QWERTY = 0, | ||
20 | _NN, | ||
21 | _MS, | ||
22 | _SP | ||
23 | }; | ||
24 | |||
25 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
26 | /* | ||
27 | * Base Layer: QWERTY | ||
28 | * | ||
29 | * ,-------------------------------------------. ,-------------------------------------------. | ||
30 | * | TAB | Q | W | E | R | T | | Y | U | I | O | P | ESC | | ||
31 | * |--------+------+------+------+------+------| |------+------+------+------+------+--------| | ||
32 | * | CTRL | A | S | D | F | G | | H | J | K | L | ; : | ' " | | ||
33 | * |--------+------+------+------+------+------| |------+------+------+------+------+--------| | ||
34 | * | LShift | Z | X | C | V | B | | N | M | , < | . > | / ? | SHIFT | | ||
35 | * `------------------------⫟------⫟------⫟------⫟------. ,-----⫟------⫟------⫟------⫟-------------------------' | ||
36 | * | GUI | Caps | Space| Nav +| |Media+| Bksp | Enter| AltGr| | ||
37 | * | | | |Number| |symbol| | | | | ||
38 | * `---------------------------' `---------------------------' | ||
39 | */ | ||
40 | [_QWERTY] = LAYOUT_split_3x6_4( | ||
41 | //,-----------------------------------------------------. ,-----------------------------------------------------. | ||
42 | KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_ESC, | ||
43 | //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| | ||
44 | KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, | ||
45 | //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| | ||
46 | KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, | ||
47 | //|--------+--------+-----------⫟--------⫟--------⫟--------⫟--------. .--------⫟--------⫟--------⫟--------⫟-----------+--------+--------| | ||
48 | KC_LGUI, KC_CAPS, KC_SPC, MO(_NN), MO(_MS), KC_BSPC, KC_ENT, KC_RALT | ||
49 | //`------------------------------------' '------------------------------------' | ||
50 | ), | ||
51 | /* | ||
52 | * Navigation and Numbers: _NN | ||
53 | * | ||
54 | * ,-------------------------------------------. ,-------------------------------------------. | ||
55 | * | TAB | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | ESC | | ||
56 | * |--------+------+------+------+------+------| |------+------+------+------+------+--------| | ||
57 | * | CTRL | F1 | F2 | F3 | F4 | F5 | | left | down | up | right| | | | ||
58 | * |--------+------+------+------+------+------| |------+------+------+------+------+--------| | ||
59 | * | LShift | F6 | F7 | F8 | F9 | F10 | | home | pgdn | pgup | end | | SHIFT | | ||
60 | * `------------------------⫟------⫟------⫟------⫟------. ,-----⫟------⫟------⫟------⫟-------------------------' | ||
61 | * | GUI | Del | Space| Nav +| |Media+|Back- | Enter| AltGr| | ||
62 | * | | | |Number| |symbol|space | | | | ||
63 | * `---------------------------' `---------------------------' | ||
64 | */ | ||
65 | [_NN] = LAYOUT_split_3x6_4( | ||
66 | //,-----------------------------------------------------. ,-----------------------------------------------------. | ||
67 | KC_TAB, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_ESC, | ||
68 | //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| | ||
69 | KC_LCTL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_LEFT, KC_DOWN, KC_UP,KC_RIGHT, XXXXXXX, XXXXXXX, | ||
70 | //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| | ||
71 | KC_LSFT, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_HOME, KC_PGDN, KC_PGUP, KC_END, XXXXXXX, KC_RSFT, | ||
72 | //|--------+--------+-----------⫟--------⫟--------⫟--------⫟--------. .--------⫟--------⫟--------⫟--------⫟-----------+--------+--------| | ||
73 | KC_LGUI, KC_DEL, KC_SPC, _______, _______, KC_BSPC, KC_ENT, KC_RALT | ||
74 | //`------------------------------------' '------------------------------------' | ||
75 | ), | ||
76 | /* | ||
77 | * Media and Symbols: _MS | ||
78 | * | ||
79 | * ,-------------------------------------------. ,-------------------------------------------. | ||
80 | * | TAB | ! | @ | # | $ | % | | ^ | & | * | ( | ) | ESC | | ||
81 | * |--------+------+------+------+------+------| |------+------+------+------+------+--------| | ||
82 | * | CTRL | | prev | play | next | vol+ | | - | = | { | } | | | ´ | | ||
83 | * |--------+------+------+------+------+------| |------+------+------+------+------+--------| | ||
84 | * | LShift | |brght-|brght+| mute | vol- | | _ | + | [ | ] | \ | ~ | | ||
85 | * `------------------------⫟------⫟------⫟------⫟------. ,-----⫟------⫟------⫟------⫟-------------------------' | ||
86 | * | GUI | Del | Space| Nav +| |Media+| Bksp | Enter| AltGr| | ||
87 | * | | | |Number| |symbol| | | | | ||
88 | * `---------------------------' `---------------------------' | ||
89 | */ | ||
90 | [_MS] = LAYOUT_split_3x6_4( | ||
91 | //,-----------------------------------------------------. ,-----------------------------------------------------. | ||
92 | KC_TAB, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_ESC, | ||
93 | //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| | ||
94 | KC_LCTL, XXXXXXX, KC_MRWD, KC_MPLY, KC_MFFD, KC_VOLU, KC_MINS, KC_EQL, KC_LCBR, KC_RCBR, KC_PIPE, KC_GRV, | ||
95 | //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| | ||
96 | KC_LSFT, XXXXXXX, KC_BRID, KC_BRIU, KC_MUTE, KC_VOLD, KC_UNDS, KC_PLUS, KC_LBRC, KC_RBRC, KC_BSLS, KC_TILD, | ||
97 | //|--------+--------+-----------⫟--------⫟--------⫟--------⫟--------. .--------⫟--------⫟--------⫟--------⫟-----------+--------+--------| | ||
98 | KC_LGUI, KC_DEL, KC_SPC, _______, _______, KC_BSPC, KC_ENT, KC_RALT | ||
99 | //`------------------------------------' '------------------------------------' | ||
100 | ), | ||
101 | /* | ||
102 | * Special functions: _SP | ||
103 | * | ||
104 | * ,-------------------------------------------. ,-------------------------------------------. | ||
105 | * | TAB | | | | RESET| | | | | | | | ESC | | ||
106 | * |--------+------+------+------+------+------| |------+------+------+------+------+--------| | ||
107 | * | CTRL | | | DEBUG| | | | | | | | | | | ||
108 | * |--------+------+------+------+------+------| |------+------+------+------+------+--------| | ||
109 | * | LShift | | | | | | | | | | | | SHIFT | | ||
110 | * `------------------------⫟------⫟------⫟------⫟------. ,-----⫟------⫟------⫟------⫟-------------------------' | ||
111 | * | GUI | Del | Space| Nav +| |Media+| Bksp | Enter| AltGr| | ||
112 | * | | | |Number| |symbol| | | | | ||
113 | * `---------------------------' `---------------------------' | ||
114 | */ | ||
115 | [_SP] = LAYOUT_split_3x6_4( | ||
116 | //,-----------------------------------------------------. ,-----------------------------------------------------. | ||
117 | KC_TAB, XXXXXXX, XXXXXXX, XXXXXXX, RESET, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_ESC, | ||
118 | //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| | ||
119 | KC_LCTL, XXXXXXX, XXXXXXX, DEBUG, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, | ||
120 | //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| | ||
121 | KC_LSFT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_RSFT, | ||
122 | //|--------+--------+-----------⫟--------⫟--------⫟--------⫟--------. .--------⫟--------⫟--------⫟--------⫟-----------+--------+--------| | ||
123 | KC_LGUI, KC_DEL, KC_SPC, _______, _______, KC_BSPC, KC_ENT, KC_RALT | ||
124 | //`------------------------------------' '------------------------------------' | ||
125 | ), | ||
126 | |||
127 | }; | ||
128 | |||
129 | layer_state_t layer_state_set_user(layer_state_t state) { | ||
130 | return update_tri_layer_state(state, _NN, _MS, _SP); | ||
131 | } | ||
132 | |||
133 | #ifdef OLED_ENABLE | ||
134 | |||
135 | static void render_logo(void) { | ||
136 | static const char PROGMEM qmk_logo[] = { | ||
137 | 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F, 0x90, 0x91, 0x92, 0x93, 0x94, | ||
138 | 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, 0xB0, 0xB1, 0xB2, 0xB3, 0xB4, | ||
139 | 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0x00 | ||
140 | }; | ||
141 | |||
142 | oled_write_P(qmk_logo, false); | ||
143 | } | ||
144 | |||
145 | static void print_status_narrow(void) { | ||
146 | // Print current mode | ||
147 | oled_write_P(PSTR("\n"), false); | ||
148 | oled_write_ln_P(PSTR("MODE"), false); | ||
149 | oled_write_ln_P(PSTR(""), false); | ||
150 | |||
151 | oled_write_P(PSTR("\n\n"), false); | ||
152 | // Print current layer | ||
153 | oled_write_ln_P(PSTR("LAYER"), false); | ||
154 | switch (get_highest_layer(layer_state)) { | ||
155 | case _QWERTY: | ||
156 | oled_write_P(PSTR("Base\n"), false); | ||
157 | break; | ||
158 | case _NN: | ||
159 | oled_write_P(PSTR("Nums\n"), false); | ||
160 | break; | ||
161 | case _MS: | ||
162 | oled_write_P(PSTR("Sym\n"), false); | ||
163 | break; | ||
164 | case _SP: | ||
165 | oled_write_P(PSTR("Spec\n"), false); | ||
166 | break; | ||
167 | default: | ||
168 | oled_write_ln_P(PSTR("Undef\n"), false); | ||
169 | } | ||
170 | oled_write_P(PSTR("\n\n"), false); | ||
171 | led_t led_usb_state = host_keyboard_led_state(); | ||
172 | oled_write_ln_P(PSTR("CPSLK"), led_usb_state.caps_lock); | ||
173 | } | ||
174 | |||
175 | oled_rotation_t oled_init_user(oled_rotation_t rotation) { | ||
176 | if (is_keyboard_master()) { | ||
177 | return OLED_ROTATION_270; | ||
178 | } | ||
179 | return rotation; | ||
180 | } | ||
181 | |||
182 | bool oled_task_user(void) { | ||
183 | if (is_keyboard_master()) { | ||
184 | print_status_narrow(); | ||
185 | } else { | ||
186 | render_logo(); | ||
187 | } | ||
188 | return false; | ||
189 | } | ||
190 | #endif | ||
191 | |||
192 | #ifdef ENCODER_ENABLE | ||
193 | bool encoder_update_user(uint8_t index, bool clockwise) { | ||
194 | if (index == 0) { | ||
195 | // master side thumb encoder | ||
196 | // Volume control | ||
197 | if (clockwise) { | ||
198 | tap_code(KC_VOLU); | ||
199 | } else { | ||
200 | tap_code(KC_VOLD); | ||
201 | } | ||
202 | } | ||
203 | else if (index == 1) { | ||
204 | // master side pinky encoder | ||
205 | // Page down / Page up | ||
206 | if (clockwise) { | ||
207 | tap_code(KC_PGDN); | ||
208 | } else { | ||
209 | tap_code(KC_PGUP); | ||
210 | } | ||
211 | } | ||
212 | else if (index == 2) { | ||
213 | // minion side thumb encoder | ||
214 | // Next track / Previous track | ||
215 | if (clockwise) { | ||
216 | tap_code(KC_MFFD); | ||
217 | } else { | ||
218 | tap_code(KC_MRWD); | ||
219 | } | ||
220 | } | ||
221 | else if (index == 3) { | ||
222 | // minion side pinky encoder | ||
223 | // Page end / Page home | ||
224 | if (clockwise) { | ||
225 | tap_code(KC_END); | ||
226 | } else { | ||
227 | tap_code(KC_HOME); | ||
228 | } | ||
229 | } | ||
230 | return true; | ||
231 | } | ||
232 | #endif | ||
diff --git a/keyboards/dumbo/keymaps/default/rules.mk b/keyboards/dumbo/keymaps/default/rules.mk new file mode 100644 index 000000000..a2d6e788f --- /dev/null +++ b/keyboards/dumbo/keymaps/default/rules.mk | |||
@@ -0,0 +1,3 @@ | |||
1 | OLED_ENABLE = yes | ||
2 | OLED_DRIVER = SSD1306 # Enables the use of OLED displays | ||
3 | ENCODER_ENABLE = yes # Enables the use of one or more encoders | ||
diff --git a/keyboards/dumbo/keymaps/trip-trap/config.h b/keyboards/dumbo/keymaps/trip-trap/config.h new file mode 100644 index 000000000..7f713e4a3 --- /dev/null +++ b/keyboards/dumbo/keymaps/trip-trap/config.h | |||
@@ -0,0 +1,27 @@ | |||
1 | /* Copyright 2020 Adam Naldal <[email protected]> | ||
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 | |||
17 | #pragma once | ||
18 | |||
19 | // Tapping term is ever so slightly lowered from the 200ms default to make layer and mod usage more snappy. | ||
20 | #define TAPPING_TERM 200 | ||
21 | |||
22 | // Prevent normal rollover on alphas from accidentally triggering mods. | ||
23 | #define IGNORE_MOD_TAP_INTERRUPT | ||
24 | |||
25 | // If you are using an Elite C rev3 on the slave side, uncomment the lines below: | ||
26 | // #define SPLIT_USB_DETECT | ||
27 | // #define NO_USB_STARTUP_CHECK | ||
diff --git a/keyboards/dumbo/keymaps/trip-trap/keymap.c b/keyboards/dumbo/keymaps/trip-trap/keymap.c new file mode 100644 index 000000000..73042f5f5 --- /dev/null +++ b/keyboards/dumbo/keymaps/trip-trap/keymap.c | |||
@@ -0,0 +1,430 @@ | |||
1 | /* Copyright 2020 Adam Naldal <[email protected]> | ||
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 | #include "keymap_danish.h" | ||
18 | #include <stdio.h> | ||
19 | |||
20 | enum layers { | ||
21 | _QWERTY = 0, | ||
22 | _COLEMAK, | ||
23 | _NN, | ||
24 | _MS, | ||
25 | _SP | ||
26 | }; | ||
27 | |||
28 | // Default layer switching | ||
29 | #define QWERT DF(_QWERTY) | ||
30 | #define COLEM DF(_COLEMAK) | ||
31 | |||
32 | // Layer tap codes | ||
33 | #define LT_SPC LT(_NN, KC_SPC) | ||
34 | #define LT_TAB LT(_MS, KC_TAB) | ||
35 | #define LT_ENT LT(_MS, KC_ENT) | ||
36 | #define LT_BSPC LT(_NN, KC_BSPC) | ||
37 | |||
38 | // Qwerty homerow mods | ||
39 | #define A_CTL LCTL_T(KC_A) | ||
40 | #define S_ALT LALT_T(KC_S) | ||
41 | #define D_GUI LGUI_T(KC_D) | ||
42 | #define F_SFT LSFT_T(KC_F) | ||
43 | #define J_SFT RSFT_T(KC_J) | ||
44 | #define K_GUI RGUI_T(KC_K) | ||
45 | #define L_ALT RALT_T(KC_L) | ||
46 | #define AE_CTL RCTL_T(DK_AE) | ||
47 | |||
48 | // Colemak homerow mods | ||
49 | #define R_ALT LALT_T(KC_R) | ||
50 | #define S_GUI LGUI_T(KC_S) | ||
51 | #define T_SFT LSFT_T(KC_T) | ||
52 | #define N_SFT RSFT_T(KC_N) | ||
53 | #define E_GUI RGUI_T(KC_E) | ||
54 | #define I_ALT RALT_T(KC_I) | ||
55 | #define O_CTL RCTL_T(KC_O) | ||
56 | |||
57 | // Navigation and numbers homerow mods | ||
58 | #define RGHT_SFT LSFT_T(KC_RGHT) | ||
59 | #define DOWN_GUI LGUI_T(KC_DOWN) | ||
60 | #define LEFT_ALT LALT_T(KC_LEFT) | ||
61 | #define N4_SFT RSFT_T(KC_4) | ||
62 | #define N5_GUI RGUI_T(KC_5) | ||
63 | #define N6_ALT RALT_T(KC_6) | ||
64 | #define OE_CTL RCTL_T(DK_OSTR) | ||
65 | |||
66 | // Undefined or wrong symbols (homebrew) | ||
67 | #define HB_LCBR S(A(KC_8)) // { | ||
68 | #define HB_RCBR S(A(KC_9)) // } | ||
69 | #define HB_LABR KC_GRV // < | ||
70 | #define HB_RABR S(KC_GRV) // > | ||
71 | #define HB_USD KC_NUBS // $ | ||
72 | #define HB_PRGF S(KC_NUBS) // § | ||
73 | #define HB_AT A(KC_NUHS) // @ | ||
74 | #define HB_EUR S(KC_4) // € | ||
75 | |||
76 | |||
77 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
78 | /* | ||
79 | * Base Layer: QWERTY | ||
80 | * | ||
81 | * ,-------------------------------------------. ,-------------------------------------------. | ||
82 | * | | Q | W | E | R | T | | Y | U | I | O | P | Å | | ||
83 | * |--------+------+------+------+------+------| |------+------+------+------+------+--------| | ||
84 | * | | A | S | D | F | G | | H | J | K | L | Æ | Ø | | ||
85 | * |--------+------+------+------+------+------| |------+------+------+------+------+--------| | ||
86 | * | | Z | X | C | V | B | | N | M | , ; | . : | - _ | | | ||
87 | * `------------------------⫟------⫟------⫟------⫟------. ,-----⫟------⫟------⫟------⫟-------------------------' | ||
88 | * | MUTE | Esc | Space| Tab | | Enter| Bksp | Caps| PLAY| | ||
89 | * |(enc) | | _NN | _MS | | _MS | _NN | |(enc)| | ||
90 | * `---------------------------' `---------------------------' | ||
91 | */ | ||
92 | [_QWERTY] = LAYOUT_split_3x6_4( | ||
93 | //,-----------------------------------------------------. ,-----------------------------------------------------. | ||
94 | XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, DK_ARNG, | ||
95 | //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| | ||
96 | XXXXXXX, A_CTL, S_ALT, D_GUI, F_SFT, KC_G, KC_H, J_SFT, K_GUI, L_ALT, AE_CTL, DK_OSTR, | ||
97 | //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| | ||
98 | XXXXXXX, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, DK_MINS, XXXXXXX, | ||
99 | //|--------+--------+-----------⫟--------⫟--------⫟--------⫟--------. .--------⫟--------⫟--------⫟--------⫟-----------+--------+--------| | ||
100 | KC_MUTE, KC_ESC, LT_SPC, LT_TAB, LT_ENT, LT_BSPC, KC_CAPS, KC_MPLY | ||
101 | //`------------------------------------' '------------------------------------' | ||
102 | ), | ||
103 | /* | ||
104 | * Base Layer: COLEMAK | ||
105 | * | ||
106 | * ,-------------------------------------------. ,-------------------------------------------. | ||
107 | * | | Q | W | F | P | B | | J | L | U | Y | Å | | | ||
108 | * |--------+------+------+------+------+------| |------+------+------+------+------+--------| | ||
109 | * | | A | R | S | T | G | | M | N | E | I | O | | | ||
110 | * |--------+------+------+------+------+------| |------+------+------+------+------+--------| | ||
111 | * | | Z | X | C | D | V | | K | H | , ; | . : | Æ | | | ||
112 | * `------------------------⫟------⫟------⫟------⫟------. ,-----⫟------⫟------⫟------⫟-------------------------' | ||
113 | * | MUTE | Esc | Space| Tab | | Enter| Bksp | Caps | PLAY| | ||
114 | * |(enc) | | _NN | _MS | | _MS | _NN | | (enc)| | ||
115 | * `---------------------------' `---------------------------' | ||
116 | */ | ||
117 | [_COLEMAK] = LAYOUT_split_3x6_4( | ||
118 | //,-----------------------------------------------------. ,-----------------------------------------------------. | ||
119 | XXXXXXX, KC_Q, KC_W, KC_F, KC_P, KC_B, KC_J, KC_L, KC_U, KC_Y, DK_ARNG, XXXXXXX, | ||
120 | //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| | ||
121 | XXXXXXX, A_CTL, R_ALT, S_GUI, T_SFT, KC_G, KC_M, N_SFT, E_GUI, I_ALT, O_CTL, XXXXXXX, | ||
122 | //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| | ||
123 | XXXXXXX, KC_Z, KC_X, KC_C, KC_D, KC_V, KC_K, KC_H, KC_COMM, KC_DOT, DK_AE, XXXXXXX, | ||
124 | //|--------+--------+-----------⫟--------⫟--------⫟--------⫟--------. .--------⫟--------⫟--------⫟--------⫟-----------+--------+--------| | ||
125 | KC_MUTE, KC_ESC, LT_SPC, LT_TAB, LT_ENT, LT_BSPC, KC_CAPS, KC_MPLY | ||
126 | //`------------------------------------' '------------------------------------' | ||
127 | ), | ||
128 | /* | ||
129 | * Navigation and Numbers: _NN | ||
130 | * | ||
131 | * ,-------------------------------------------. ,-------------------------------------------. | ||
132 | * | | | Home | Up | End | pgUp | | * | 7 | 8 | 9 | + | | | ||
133 | * |--------+------+------+------+------+------| |------+------+------+------+------+--------| | ||
134 | * | | | Left | Down | Right| pgDwn| | / | 4 | 5 | 6 | Ø | | | ||
135 | * |--------+------+------+------+------+------| |------+------+------+------+------+--------| | ||
136 | * | | | Cut | Copy | | Paste| | = | 1 | 2 | 3 | - | | | ||
137 | * `------------------------⫟------⫟------⫟------⫟------. ,-----⫟------⫟------⫟------⫟-------------------------' | ||
138 | * | MUTE | Del | Space| Tab | | Enter| Bksp | 0 | PLAY | | ||
139 | * |(enc) | | _NN | _MS | | _MS | _NN | |(enc) | | ||
140 | * `---------------------------' `---------------------------' | ||
141 | */ | ||
142 | [_NN] = LAYOUT_split_3x6_4( | ||
143 | //,-----------------------------------------------------. ,-----------------------------------------------------. | ||
144 | XXXXXXX, XXXXXXX, KC_HOME, KC_UP, KC_END, KC_PGUP, DK_ASTR, KC_7, KC_8, KC_9, DK_PLUS, XXXXXXX, | ||
145 | //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| | ||
146 | XXXXXXX, KC_LCTL,LEFT_ALT,DOWN_GUI,RGHT_SFT, KC_PGDN, DK_SLSH, N4_SFT, N5_GUI, N6_ALT, OE_CTL, XXXXXXX, | ||
147 | //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| | ||
148 | XXXXXXX, XXXXXXX, G(KC_X), G(KC_C), XXXXXXX, G(KC_V), DK_EQL, KC_1, KC_2, KC_3, DK_MINS, XXXXXXX, | ||
149 | //|--------+--------+-----------⫟--------⫟--------⫟--------⫟--------. .--------⫟--------⫟--------⫟--------⫟-----------+--------+--------| | ||
150 | KC_MUTE, KC_DEL, _______, _______, _______, _______, KC_0, KC_MPLY | ||
151 | //`------------------------------------' '------------------------------------' | ||
152 | ), | ||
153 | /* | ||
154 | * Media and Symbols: _MS | ||
155 | * | ||
156 | * ,-------------------------------------------. ,-------------------------------------------. | ||
157 | * | | | | [ | ] | F1 | | $ | / | ( | ) | ? | | | ||
158 | * |--------+------+------+------+------+------| |------+------+------+------+------+--------| | ||
159 | * | |brght-|brght+| { | } | F2 | | @ | € | % | & | ' | | | ||
160 | * |--------+------+------+------+------+------| |------+------+------+------+------+--------| | ||
161 | * | | | | < | > | F3 | | § | ! | " | # | _ | | | ||
162 | * `------------------------⫟------⫟------⫟------⫟------. ,-----⫟------⫟------⫟------⫟-------------------------' | ||
163 | * | MUTE | Esc | Space| Tab | | Enter| Bksp | Caps | PLAY| | ||
164 | * |(enc) | | _NN | _MS | | _MS | _NN | | (enc)| | ||
165 | * `---------------------------' `---------------------------' | ||
166 | */ | ||
167 | [_MS] = LAYOUT_split_3x6_4( | ||
168 | //,-----------------------------------------------------. ,-----------------------------------------------------. | ||
169 | XXXXXXX, XXXXXXX, XXXXXXX, DK_LBRC, DK_RBRC, KC_F1, HB_USD, DK_SLSH, DK_LPRN, DK_RPRN, DK_QUES, XXXXXXX, | ||
170 | //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| | ||
171 | XXXXXXX, KC_BRID, KC_BRIU, HB_LCBR, HB_RCBR, KC_F2, HB_AT, HB_EUR, DK_PERC, DK_AMPR, DK_QUOT, XXXXXXX, | ||
172 | //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| | ||
173 | XXXXXXX, XXXXXXX, XXXXXXX, HB_LABR, HB_RABR, KC_F3, HB_PRGF, DK_EXLM, DK_DQUO, DK_HASH, DK_UNDS, XXXXXXX, | ||
174 | //|--------+--------+-----------⫟--------⫟--------⫟--------⫟--------. .--------⫟--------⫟--------⫟--------⫟-----------+--------+--------| | ||
175 | KC_MUTE, KC_ESC, _______, _______, _______, _______, KC_CAPS, KC_MPLY | ||
176 | //`------------------------------------' '------------------------------------' | ||
177 | ), | ||
178 | /* | ||
179 | * Special functions: _SP | ||
180 | * | ||
181 | * ,-------------------------------------------. ,-------------------------------------------. | ||
182 | * | |QWERTY| | | RESET| | | | | | | | | | ||
183 | * |--------+------+------+------+------+------| |------+------+------+------+------+--------| | ||
184 | * | | | | DEBUG| | | | | | | | | | | ||
185 | * |--------+------+------+------+------+------| |------+------+------+------+------+--------| | ||
186 | * | | | |COLEMK| | | | | | | | | | | ||
187 | * `------------------------⫟------⫟------⫟------⫟------. ,-----⫟------⫟------⫟------⫟-------------------------' | ||
188 | * | GUI | Del | Space| Nav +| |Media+| Bksp | Enter| AltGr| | ||
189 | * | | | |Number| |symbol| | | | | ||
190 | * `---------------------------' `---------------------------' | ||
191 | */ | ||
192 | [_SP] = LAYOUT_split_3x6_4( | ||
193 | //,-----------------------------------------------------. ,-----------------------------------------------------. | ||
194 | XXXXXXX, QWERT, XXXXXXX, XXXXXXX, RESET, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, | ||
195 | //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| | ||
196 | XXXXXXX, XXXXXXX, XXXXXXX, DEBUG, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, | ||
197 | //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| | ||
198 | XXXXXXX, XXXXXXX, XXXXXXX, COLEM, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, | ||
199 | //|--------+--------+-----------⫟--------⫟--------⫟--------⫟--------. .--------⫟--------⫟--------⫟--------⫟-----------+--------+--------| | ||
200 | KC_MUTE, KC_ESC, _______, _______, _______, _______, KC_CAPS, KC_MPLY | ||
201 | //`------------------------------------' '------------------------------------' | ||
202 | ), | ||
203 | |||
204 | }; | ||
205 | |||
206 | layer_state_t layer_state_set_user(layer_state_t state) { | ||
207 | return update_tri_layer_state(state, _NN, _MS, _SP); | ||
208 | } | ||
209 | |||
210 | #ifdef OLED_ENABLE | ||
211 | char wpm_str[10]; | ||
212 | |||
213 | // static void render_logo(void) { | ||
214 | // static const char PROGMEM qmk_logo[] = { | ||
215 | // 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F, 0x90, 0x91, 0x92, 0x93, 0x94, | ||
216 | // 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, 0xB0, 0xB1, 0xB2, 0xB3, 0xB4, | ||
217 | // 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0x00 | ||
218 | // }; | ||
219 | // | ||
220 | // oled_write_P(qmk_logo, false); | ||
221 | // } | ||
222 | |||
223 | static void print_status_narrow(void) { | ||
224 | // Print current mode | ||
225 | oled_write_P(PSTR("\n"), false); | ||
226 | oled_write_ln_P(PSTR("MODE"), false); | ||
227 | oled_write_ln_P(PSTR(""), false); | ||
228 | |||
229 | switch (get_highest_layer(default_layer_state)) { | ||
230 | case _QWERTY: | ||
231 | oled_write_ln_P(PSTR("Qwrt"), false); | ||
232 | break; | ||
233 | case _COLEMAK: | ||
234 | oled_write_ln_P(PSTR("Clmk"), false); | ||
235 | break; | ||
236 | default: | ||
237 | oled_write_P(PSTR("Undef"), false); | ||
238 | } | ||
239 | oled_write_P(PSTR("\n\n"), false); | ||
240 | // Print current layer | ||
241 | oled_write_ln_P(PSTR("LAYER"), false); | ||
242 | switch (get_highest_layer(layer_state)) { | ||
243 | case _QWERTY: | ||
244 | oled_write_P(PSTR("Base\n"), false); | ||
245 | break; | ||
246 | case _NN: | ||
247 | oled_write_P(PSTR("Nums\n"), false); | ||
248 | break; | ||
249 | case _MS: | ||
250 | oled_write_P(PSTR("Sym\n"), false); | ||
251 | break; | ||
252 | case _SP: | ||
253 | oled_write_P(PSTR("Spec\n"), false); | ||
254 | break; | ||
255 | default: | ||
256 | oled_write_ln_P(PSTR("Undef\n"), false); | ||
257 | } | ||
258 | oled_write_P(PSTR("\n\n"), false); | ||
259 | led_t led_usb_state = host_keyboard_led_state(); | ||
260 | oled_write_ln_P(PSTR("CPSLK"), led_usb_state.caps_lock); | ||
261 | } | ||
262 | |||
263 | #define ANIM_NUM_FRAMES 2 // number of frames in the animation | ||
264 | #define MAX_DURATION 10000 | ||
265 | #define ANIM_BEGIN 30 | ||
266 | uint16_t anim_frame_duration = 100; // how long each frame lasts | ||
267 | // #define ANIM_REVERSE // define this if you want the animation to run backwards at the end | ||
268 | |||
269 | #ifdef ANIM_REVERSE | ||
270 | #define ANIM_TOTAL_FRAMES (2*((ANIM_NUM_FRAMES)-1)) | ||
271 | #else | ||
272 | #define ANIM_TOTAL_FRAMES ANIM_NUM_FRAMES | ||
273 | #endif | ||
274 | |||
275 | uint16_t anim_timer = 0; | ||
276 | uint8_t current_anim_frame = 0; | ||
277 | |||
278 | static void render_anim(void) { | ||
279 | static const char PROGMEM frame[ANIM_NUM_FRAMES][512] = { | ||
280 | { | ||
281 | // 'pokemon experiment frame 1', 32x128px | ||
282 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
283 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
284 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x60, 0x10, 0x08, 0x04, 0x04, 0x02, 0x02, 0x02, | ||
285 | 0x02, 0x02, 0x02, 0x02, 0x04, 0x04, 0x04, 0x08, 0x30, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
286 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x1f, 0x3c, 0xf2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
287 | 0x04, 0xf2, 0x3a, 0x1c, 0x3c, 0xf8, 0xe0, 0x00, 0x00, 0x01, 0x1e, 0xe0, 0x00, 0x00, 0x00, 0x00, | ||
288 | 0x00, 0x00, 0x00, 0x70, 0x8c, 0x03, 0x41, 0x82, 0x02, 0x03, 0x80, 0x40, 0x00, 0x00, 0x00, 0x00, | ||
289 | 0x00, 0x07, 0x04, 0x84, 0x84, 0xc7, 0x63, 0x00, 0x00, 0x00, 0xe0, 0x1f, 0x00, 0x00, 0x00, 0x00, | ||
290 | 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x04, 0x1c, 0x28, 0x58, 0xa4, 0xa4, 0x44, 0x42, 0x42, | ||
291 | 0x23, 0x97, 0x91, 0x48, 0x24, 0x23, 0x10, 0x08, 0x04, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
292 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, | ||
293 | 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
294 | 0x00, 0x00, 0x80, 0x70, 0x08, 0x04, 0x04, 0x08, 0x08, 0x50, 0x20, 0x10, 0x10, 0x10, 0x90, 0x90, | ||
295 | 0x90, 0x10, 0x10, 0x10, 0x10, 0x10, 0x20, 0x10, 0x08, 0x08, 0x04, 0x04, 0x08, 0xf0, 0x00, 0x00, | ||
296 | 0x80, 0x78, 0x1f, 0x3a, 0xf2, 0xc4, 0x00, 0x00, 0x30, 0x60, 0x00, 0x06, 0x8f, 0xcf, 0xe7, 0x03, | ||
297 | 0x01, 0x00, 0x04, 0xf2, 0x3a, 0x1c, 0x1c, 0x78, 0xf0, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xf0, | ||
298 | 0x1f, 0x64, 0xb4, 0x64, 0xa7, 0x23, 0x40, 0x48, 0x50, 0x40, 0x80, 0x80, 0x91, 0x89, 0x80, 0x80, | ||
299 | 0x80, 0x40, 0x40, 0x47, 0x44, 0x44, 0xa4, 0x64, 0x27, 0x13, 0x08, 0x00, 0x00, 0x80, 0x60, 0x1f, | ||
300 | 0x00, 0x00, 0x00, 0x01, 0x01, 0x03, 0x02, 0x06, 0x04, 0x0c, 0x0c, 0x0c, 0x08, 0x08, 0x08, 0x0c, | ||
301 | 0x0c, 0x0c, 0x0a, 0x0a, 0x09, 0x05, 0x04, 0x04, 0x04, 0x02, 0x02, 0x02, 0x01, 0x00, 0x00, 0x00, | ||
302 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
303 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
304 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x20, 0x10, 0x10, 0x08, 0x08, 0x08, 0x04, 0x04, 0x04, | ||
305 | 0x04, 0x04, 0x04, 0x04, 0x04, 0x08, 0x08, 0x08, 0x10, 0x10, 0x20, 0x40, 0x80, 0x00, 0x00, 0x00, | ||
306 | 0x00, 0x00, 0x00, 0xfc, 0x1b, 0x3c, 0xfc, 0xf9, 0x01, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
307 | 0x00, 0x00, 0x00, 0x02, 0xf1, 0x39, 0x1c, 0x3c, 0xfc, 0xf8, 0xf0, 0x00, 0x00, 0x03, 0x0c, 0xf0, | ||
308 | 0x00, 0xf8, 0x06, 0x01, 0x32, 0x02, 0x03, 0x31, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
309 | 0x00, 0x00, 0x00, 0x00, 0x07, 0x04, 0x84, 0x84, 0x47, 0xe3, 0x01, 0x00, 0x00, 0x00, 0xc0, 0x3f, | ||
310 | 0x00, 0x00, 0x01, 0x02, 0x06, 0x0a, 0x14, 0x28, 0x48, 0x44, 0x44, 0xc2, 0xc2, 0xc2, 0xa2, 0xa2, | ||
311 | 0xa1, 0x91, 0x91, 0x89, 0x49, 0x45, 0x44, 0x22, 0x21, 0x10, 0x10, 0x08, 0x04, 0x02, 0x01, 0x00, | ||
312 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
313 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
314 | |||
315 | }, | ||
316 | { | ||
317 | // 'pokemon experiment frame 2', 32x128px | ||
318 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, | ||
319 | 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
320 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x18, 0x84, 0x02, 0x01, 0x01, 0x00, 0x00, 0x00, | ||
321 | 0x00, 0x80, 0x80, 0x00, 0x01, 0x01, 0x01, 0x02, 0x0c, 0x70, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
322 | 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0x87, 0x8f, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
323 | 0x01, 0xfc, 0x0e, 0x07, 0x0f, 0xfe, 0xf8, 0x00, 0x00, 0x00, 0x07, 0xf8, 0x00, 0x00, 0x00, 0x00, | ||
324 | 0x00, 0x00, 0x00, 0x1c, 0x63, 0x80, 0x10, 0x20, 0x00, 0x00, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, | ||
325 | 0x00, 0x81, 0x81, 0x41, 0x41, 0x21, 0x10, 0x00, 0x80, 0x60, 0x18, 0x07, 0x00, 0x00, 0x00, 0x00, | ||
326 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x06, 0x04, 0x04, 0x0a, 0x0a, 0x0a, 0x0a, 0x09, | ||
327 | 0x05, 0x07, 0x04, 0x02, 0x02, 0x02, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
328 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
329 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
330 | 0x00, 0x00, 0x00, 0xe0, 0x10, 0x08, 0x08, 0x10, 0x10, 0xa0, 0x40, 0x20, 0x20, 0x20, 0x20, 0x20, | ||
331 | 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x40, 0x20, 0x10, 0x10, 0x08, 0x08, 0x10, 0xe0, 0x00, 0x00, | ||
332 | 0x00, 0xf0, 0x3f, 0x72, 0xe2, 0x80, 0x00, 0x00, 0x60, 0xc0, 0x00, 0x0c, 0x1e, 0x9e, 0xcf, 0x07, | ||
333 | 0x03, 0x00, 0x00, 0xe2, 0x72, 0x38, 0x38, 0xf0, 0xe0, 0x80, 0x00, 0x00, 0x00, 0x01, 0x1e, 0xe0, | ||
334 | 0x3f, 0xc8, 0x68, 0x48, 0x8f, 0x87, 0x00, 0x20, 0x40, 0x00, 0x00, 0x00, 0x43, 0x23, 0x01, 0x00, | ||
335 | 0x00, 0x00, 0x00, 0x0f, 0x08, 0x88, 0x88, 0x48, 0x4f, 0x27, 0x10, 0x00, 0x00, 0x00, 0xc0, 0x3f, | ||
336 | 0x00, 0x00, 0x01, 0x02, 0x02, 0x06, 0x05, 0x09, 0x09, 0x09, 0x12, 0x12, 0x12, 0x12, 0x11, 0x11, | ||
337 | 0x11, 0x11, 0x11, 0x09, 0x09, 0x09, 0x08, 0x08, 0x08, 0x04, 0x04, 0x04, 0x02, 0x01, 0x00, 0x00, | ||
338 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
339 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
340 | 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x20, 0x90, 0x88, 0x88, 0x04, 0x04, 0x04, 0x02, 0x02, 0x02, | ||
341 | 0x02, 0x02, 0x02, 0x82, 0x82, 0x84, 0x04, 0x04, 0x08, 0x08, 0x10, 0x20, 0x40, 0x80, 0x00, 0x00, | ||
342 | 0x00, 0x00, 0x00, 0xfe, 0x0d, 0x1e, 0xfe, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
343 | 0x00, 0x00, 0x00, 0x00, 0xf8, 0x1c, 0x0e, 0x1e, 0xfe, 0xfc, 0xf8, 0x00, 0x00, 0x01, 0x06, 0xf8, | ||
344 | 0x00, 0x78, 0x87, 0x00, 0x31, 0x01, 0x01, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
345 | 0x00, 0x00, 0x00, 0x00, 0x03, 0x02, 0x82, 0x82, 0x43, 0x61, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x1f, | ||
346 | 0x00, 0x00, 0x00, 0x01, 0x01, 0x02, 0x04, 0x0c, 0x08, 0x14, 0x12, 0x12, 0x12, 0x22, 0x22, 0x22, | ||
347 | 0x21, 0x21, 0x21, 0x21, 0x11, 0x11, 0x10, 0x08, 0x08, 0x08, 0x04, 0x04, 0x02, 0x01, 0x00, 0x00, | ||
348 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
349 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 | ||
350 | } | ||
351 | }; | ||
352 | |||
353 | if (get_current_wpm() > ANIM_BEGIN){ | ||
354 | if(timer_elapsed(anim_timer) > anim_frame_duration) { | ||
355 | anim_timer = timer_read(); | ||
356 | current_anim_frame = (current_anim_frame + 1) % ANIM_TOTAL_FRAMES; | ||
357 | oled_clear(); | ||
358 | oled_write_raw_P(frame[abs((ANIM_NUM_FRAMES-1)-current_anim_frame)], 512); | ||
359 | if (get_current_wpm() > ANIM_BEGIN){ | ||
360 | anim_frame_duration = MAX_DURATION/get_current_wpm(); | ||
361 | } | ||
362 | } | ||
363 | } else { | ||
364 | oled_write_raw_P(frame[0],512); | ||
365 | } | ||
366 | } | ||
367 | |||
368 | oled_rotation_t oled_init_user(oled_rotation_t rotation) { | ||
369 | if (is_keyboard_master()) { | ||
370 | return OLED_ROTATION_270; | ||
371 | } | ||
372 | if (is_keyboard_master() != true){ | ||
373 | return OLED_ROTATION_270; | ||
374 | } | ||
375 | return rotation; | ||
376 | } | ||
377 | |||
378 | bool oled_task_user(void) { | ||
379 | if (is_keyboard_master()) { | ||
380 | print_status_narrow(); | ||
381 | sprintf(wpm_str, "%03d", get_current_wpm()); | ||
382 | oled_write(wpm_str, false); | ||
383 | } else { | ||
384 | render_anim(); | ||
385 | } | ||
386 | return false; | ||
387 | } | ||
388 | #endif | ||
389 | |||
390 | #ifdef ENCODER_ENABLE | ||
391 | bool encoder_update_user(uint8_t index, bool clockwise) { | ||
392 | if (index == 0) { | ||
393 | // master side thumb encoder | ||
394 | // Volume control | ||
395 | if (clockwise) { | ||
396 | tap_code(KC_VOLU); | ||
397 | } else { | ||
398 | tap_code(KC_VOLD); | ||
399 | } | ||
400 | } | ||
401 | else if (index == 1) { | ||
402 | // master side pinky encoder | ||
403 | // Page down / Page up | ||
404 | if (clockwise) { | ||
405 | tap_code(KC_PGDN); | ||
406 | } else { | ||
407 | tap_code(KC_PGUP); | ||
408 | } | ||
409 | } | ||
410 | else if (index == 2) { | ||
411 | // minion side thumb encoder | ||
412 | // Next track / Previous track | ||
413 | if (clockwise) { | ||
414 | tap_code(KC_MFFD); | ||
415 | } else { | ||
416 | tap_code(KC_MRWD); | ||
417 | } | ||
418 | } | ||
419 | else if (index == 3) { | ||
420 | // minion side pinky encoder | ||
421 | // Page end / Page home | ||
422 | if (clockwise) { | ||
423 | tap_code(KC_END); | ||
424 | } else { | ||
425 | tap_code(KC_HOME); | ||
426 | } | ||
427 | } | ||
428 | return true; | ||
429 | } | ||
430 | #endif | ||
diff --git a/keyboards/dumbo/keymaps/trip-trap/rules.mk b/keyboards/dumbo/keymaps/trip-trap/rules.mk new file mode 100644 index 000000000..1913e10c4 --- /dev/null +++ b/keyboards/dumbo/keymaps/trip-trap/rules.mk | |||
@@ -0,0 +1,4 @@ | |||
1 | OLED_ENABLE = yes | ||
2 | OLED_DRIVER = SSD1306 # Enables the use of OLED displays | ||
3 | ENCODER_ENABLE = yes # Enables the use of one or more encoders | ||
4 | WPM_ENABLE = yes | ||