diff options
Diffstat (limited to 'keyboards/bandominedoni/keymaps/led/keymap.c')
-rw-r--r-- | keyboards/bandominedoni/keymaps/led/keymap.c | 227 |
1 files changed, 227 insertions, 0 deletions
diff --git a/keyboards/bandominedoni/keymaps/led/keymap.c b/keyboards/bandominedoni/keymaps/led/keymap.c new file mode 100644 index 000000000..305756b5b --- /dev/null +++ b/keyboards/bandominedoni/keymaps/led/keymap.c | |||
@@ -0,0 +1,227 @@ | |||
1 | /* Copyright 2021 3araht | ||
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 | #define DF_COLE DF(_COLEMAK) | ||
19 | |||
20 | #define _________________QWERTY_L1_________________ KC_Q, KC_W, KC_E, KC_R, KC_T | ||
21 | #define _________________QWERTY_L2_________________ KC_A, KC_S, KC_D, KC_F, KC_G | ||
22 | #define _________________QWERTY_L3_________________ KC_Z, KC_X, KC_C, KC_V, KC_B | ||
23 | |||
24 | #define _________________QWERTY_R1_________________ KC_Y, KC_U, KC_I, KC_O, KC_P | ||
25 | #define _________________QWERTY_R2_________________ KC_H, KC_J, KC_K, KC_L, KC_SCLN | ||
26 | #define _________________QWERTY_R3_________________ KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH | ||
27 | |||
28 | #define _________________COLEMAK_L1________________ KC_Q, KC_W, KC_F, KC_P, KC_G | ||
29 | #define _________________COLEMAK_L2________________ KC_A, KC_R, KC_S, KC_T, KC_D | ||
30 | #define _________________COLEMAK_L3________________ KC_Z, KC_X, KC_C, KC_V, KC_B | ||
31 | |||
32 | #define _________________COLEMAK_R1________________ KC_J, KC_L, KC_U, KC_Y, KC_SCLN | ||
33 | #define _________________COLEMAK_R2________________ KC_H, KC_N, KC_E, KC_I, KC_O | ||
34 | #define _________________COLEMAK_R3________________ KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH | ||
35 | |||
36 | #define _________________NUMBER_L__________________ KC_1, KC_2, KC_3, KC_4, KC_5 | ||
37 | // #define _________________NUMBER_R__________________ KC_6, KC_7, KC_8, KC_9, KC_0 | ||
38 | |||
39 | #define _________________FUNC__L___________________ KC_F1, KC_F2, KC_F3, KC_F4, KC_F5 | ||
40 | // #define _________________FUNC__R___________________ KC_F6, KC_F7, KC_F8, KC_F9, KC_F10 | ||
41 | |||
42 | // Defines names for use in layer keycodes and the keymap | ||
43 | enum layer_names { | ||
44 | #ifndef PEDAL_NORMALLY_CLOSED | ||
45 | _OPEN, | ||
46 | #endif | ||
47 | _CLOSE, | ||
48 | #ifdef PEDAL_NORMALLY_CLOSED | ||
49 | _OPEN, | ||
50 | #endif | ||
51 | _QWERTY, | ||
52 | _COLEMAK, | ||
53 | _MISC, | ||
54 | _FN | ||
55 | }; | ||
56 | |||
57 | // Alias layout macros that expand groups of keys. | ||
58 | #define LAYOUT_wrapper(...) LAYOUT(__VA_ARGS__) | ||
59 | |||
60 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
61 | [_OPEN] = LAYOUT( | ||
62 | MI_Gs_1, MI_As_1, MI_Cs_2, MI_F_2, MI_Gs_3, | ||
63 | MI_E_1, MI_A_1, MI_G_2, MI_Ds_2, MI_F_3, MI_As_2, MI_F_1, | ||
64 | MI_D_2, MI_A_2, MI_C_3, MI_E_3, MI_C_2, MI_G_1, TG_SWAP, | ||
65 | MI_E_2, MI_Gs_2, MI_B_2, MI_D_3, MI_Fs_3, MI_Cs_3, MI_Fs_1, | ||
66 | MI_D_1, MI_B_1, MI_G_3, MI_A_3, MI_Ds_3, MI_Fs_2, MI_Ds_1, MI_C_1, | ||
67 | |||
68 | MO_SWAP, MI_B_5, MI_Gs_5, MI_G_5, MI_F_5, FN_MUTE, | ||
69 | MI_Cs_3, MI_A_5, MI_Fs_5, MI_E_5, MI_Ds_5, KC_VOLD, KC_VOLU, | ||
70 | MI_C_3, MI_D_3, MI_G_3, MI_As_4, MI_C_5, MI_D_5, | ||
71 | TG_SWAP, MI_B_2, MI_E_3, MI_Cs_4, MI_Fs_3, MI_A_3, MI_C_4, MI_E_4, | ||
72 | MI_A_2, MI_F_3, MI_As_3, MI_Gs_3, MI_B_3, MI_D_4, MI_Gs_4, MI_B_4, | ||
73 | MI_Gs_2, MI_As_2, MI_Ds_3, MI_F_4, MI_Ds_4, MI_Fs_4, MI_A_4, MI_Cs_5, MI_G_4 | ||
74 | ), | ||
75 | |||
76 | [_CLOSE] = LAYOUT( | ||
77 | MI_Gs_1, MI_As_1, MI_Ds_2, MI_Ds_3, MI_G_3, | ||
78 | MI_D_1, MI_D_2, MI_As_2, MI_C_3, MI_Cs_2, MI_C_2, MI_Fs_1, | ||
79 | MI_G_1, MI_G_2, MI_B_2, MI_D_3, MI_F_3, MI_Fs_2, TG_SWAP, | ||
80 | MI_A_1, MI_E_2, MI_A_2, MI_Cs_3, MI_E_3, MI_Gs_2, MI_B_1, | ||
81 | MI_E_1, MI_E_2, MI_Fs_3, MI_Gs_3, MI_B_3, MI_F_2, MI_Cs_1, MI_F_1, | ||
82 | |||
83 | MO_SWAP, MI_A_5, MI_Gs_5, MI_Fs_5, MI_F_5, FN_MUTE, | ||
84 | MI_C_3, MI_G_5, MI_As_4, MI_C_5, MI_Ds_5, KC_VOLD, KC_VOLU, | ||
85 | MI_D_3, MI_Cs_3, MI_Gs_3, MI_As_3, MI_C_4, MI_D_5, | ||
86 | TG_SWAP, MI_B_2, MI_Fs_3, MI_Fs_4, MI_G_3, MI_B_3, MI_D_4, MI_G_4, | ||
87 | MI_A_2, MI_F_3, MI_E_3, MI_A_3, MI_Cs_4, MI_E_4, MI_A_4, MI_Cs_5, | ||
88 | MI_Gs_2, MI_As_2, MI_Ds_3, MI_F_4, MI_E_4, MI_Gs_4, MI_B_4, MI_E_5, MI_Ds_4 | ||
89 | ), | ||
90 | |||
91 | [_QWERTY] = LAYOUT_wrapper( | ||
92 | _________________NUMBER_L__________________, | ||
93 | KC_GESC, KC_TAB, _________________QWERTY_L1_________________, | ||
94 | KC_CAPS, _________________QWERTY_L2_________________, KC_H, | ||
95 | KC_LSFT, _________________QWERTY_L3_________________, KC_N, | ||
96 | KC_LCTL, KC_GRV, KC_LGUI, KC_LALT, MIS_EIS, KC_SPC, KC_SPC, KC_PSCR, | ||
97 | |||
98 | MO(_MISC), KC_LBRC, KC_RBRC, KC_BSLS, KC_0, _______, | ||
99 | KC_6, KC_7, KC_8, KC_9, KC_BSPC, _______, _______, | ||
100 | _________________QWERTY_R1_________________, KC_DEL, | ||
101 | KC_PGUP, KC_G, _________________QWERTY_R2_________________, KC_ENT, | ||
102 | KC_PGDN, KC_B, _________________QWERTY_R3_________________, KC_RSFT, | ||
103 | KC_HOME, KC_END, KC_SPC, MIS_KAN, KC_RALT, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT | ||
104 | ), | ||
105 | |||
106 | [_COLEMAK] = LAYOUT_wrapper( | ||
107 | _________________NUMBER_L__________________, | ||
108 | KC_GESC, KC_TAB, _________________COLEMAK_L1________________, | ||
109 | KC_LCTL, _________________COLEMAK_L2________________, KC_ENT, | ||
110 | KC_LSFT, _________________COLEMAK_L3________________, KC_M, | ||
111 | KC_CAPS, KC_GRV, KC_LGUI, KC_LALT, MIS_EIS, KC_SPC, KC_SPC, KC_PSCR, | ||
112 | |||
113 | MO(_MISC), KC_LBRC, KC_RBRC, KC_BSLS, KC_0, _______, | ||
114 | KC_6, KC_7, KC_8, KC_9, KC_BSPC, _______, _______, | ||
115 | _________________COLEMAK_R1________________, KC_DEL, | ||
116 | KC_PGUP, KC_D, _________________COLEMAK_R2________________, KC_ENT, | ||
117 | KC_PGDN, KC_B, _________________COLEMAK_R3________________, KC_RSFT, | ||
118 | KC_HOME, KC_END, KC_SPC, MIS_KAN, KC_RALT, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT | ||
119 | ), | ||
120 | |||
121 | [_MISC] = LAYOUT_wrapper( | ||
122 | _________________FUNC__L___________________, | ||
123 | _______, _______, _______, _______, _______, _______, _______, | ||
124 | _______, _______, _______, _______, _______, _______, _______, | ||
125 | _______, _______, _______, _______, _______, _______, _______, | ||
126 | _______, _______, _______, _______, _______, _______, _______, _______, | ||
127 | |||
128 | _______, _______, _______, _______, KC_F10, _______, | ||
129 | KC_F6, KC_F7, KC_F8, KC_F9, _______, _______, _______, | ||
130 | _______, _______, _______, _______, _______, _______, | ||
131 | _______, _______, _______, _______, _______, _______, KC_QUOT, _______, | ||
132 | _______, _______, _______, _______, _______, _______, _______, _______, | ||
133 | _______, _______, _______, _______, _______, _______, _______, _______, _______ | ||
134 | ), | ||
135 | |||
136 | [_FN] = LAYOUT( | ||
137 | DF_SWAP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, | ||
138 | XXXXXXX, DF_QWER, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, | ||
139 | DF_COLE, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, | ||
140 | XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, | ||
141 | XXXXXXX, XXXXXXX, AG_NORM, AG_SWAP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, | ||
142 | |||
143 | _______, MI_OCTD, MI_OCTU, MI_VELD, MI_VELU, _______, | ||
144 | XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_RMOD, RGB_MOD, | ||
145 | XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, | ||
146 | _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, | ||
147 | RGB_SAD, RGB_SAI, RGB_HUD, RGB_HUI, RGB_SPD, RGB_SPI, RGB_VAD, RGB_VAI, | ||
148 | XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_RMOD, RGB_MOD, EEP_RST, RGB_TOG | ||
149 | ) | ||
150 | }; | ||
151 | |||
152 | void my_init(void){ | ||
153 | // Set octave to MI_OCT_0 | ||
154 | midi_config.octave = MI_OCT_0 - MIDI_OCTAVE_MIN; | ||
155 | |||
156 | // avoid using 127 since it is used as a special number in some sound sources. | ||
157 | midi_config.velocity = MIDI_INITIAL_VELOCITY; | ||
158 | } | ||
159 | |||
160 | void eeconfig_init_user(void) { // EEPROM is getting reset! | ||
161 | midi_init(); | ||
162 | my_init(); | ||
163 | #ifdef RGB_MATRIX_ENABLE | ||
164 | rgb_matrix_enable(); | ||
165 | rgb_matrix_set_speed(RGB_MATRIX_STARTUP_SPD); | ||
166 | rgb_matrix_sethsv(HSV_BLUE); | ||
167 | |||
168 | rgb_matrix_mode(RGB_MATRIX_SOLID_REACTIVE); | ||
169 | // rgb_matrix_mode(RGB_MATRIX_RAINBOW_MOVING_CHEVRON); | ||
170 | #endif | ||
171 | } | ||
172 | |||
173 | void keyboard_post_init_user(void) { | ||
174 | my_init(); | ||
175 | |||
176 | // party mode (for LED soldering test. Enable rainbow color effect, and disable led_indicator to check all LEDs) | ||
177 | rgb_matrix_mode(RGB_MATRIX_RAINBOW_MOVING_CHEVRON); | ||
178 | }; | ||
179 | |||
180 | #ifdef RGB_MATRIX_ENABLE | ||
181 | void rgb_matrix_indicators_user(void) { | ||
182 | if (rgb_matrix_is_enabled()) { // turn the lights on when it is enabled. | ||
183 | uint8_t layer = biton32(layer_state); | ||
184 | switch (layer) { | ||
185 | case _CLOSE: | ||
186 | // rgb_matrix_set_color(pgm_read_byte(&convert_led_location2number[11]), RGB_RED); // RGB_TOG <- too heavy. | ||
187 | |||
188 | // Close state indicator | ||
189 | rgb_matrix_set_color( 0, RGB_DARKWHITE); // oc | ||
190 | break; | ||
191 | |||
192 | case _FN: | ||
193 | // left hand side | ||
194 | rgb_matrix_set_color( 46, RGB_DARKORANGE); // DF_OPEN | ||
195 | rgb_matrix_set_color( 48, RGB_DARKWHITE); // DF_QWER | ||
196 | rgb_matrix_set_color( 60, RGB_DARKWHITE); // DF_COLE | ||
197 | |||
198 | rgb_matrix_set_color( 73, RGB_DARKYELLOW); // AG_SWAP | ||
199 | rgb_matrix_set_color( 72, RGB_DARKYELLOW); // AG_NORM | ||
200 | |||
201 | |||
202 | // right hand side | ||
203 | rgb_matrix_set_color( 1, RGB_DARKYELLOW); // MI_OCTD | ||
204 | rgb_matrix_set_color(13, RGB_DARKGREEN); // MI_OCTU | ||
205 | rgb_matrix_set_color(14, RGB_DARKYELLOW); // MI_VELD | ||
206 | rgb_matrix_set_color(25, RGB_DARKGREEN); // MI_VELU | ||
207 | |||
208 | rgb_matrix_set_color( 6, RGB_DARKBLUE); // RGB_SAD | ||
209 | rgb_matrix_set_color( 9, RGB_DARKBLUE); // RGB_SAI | ||
210 | rgb_matrix_set_color(18, RGB_DARKBLUE); // RGB_HUD | ||
211 | rgb_matrix_set_color(21, RGB_DARKBLUE); // RGB_HUI | ||
212 | rgb_matrix_set_color(29, RGB_DARKBLUE); // RGB_SPD | ||
213 | rgb_matrix_set_color(32, RGB_DARKBLUE); // RGB_SPI | ||
214 | rgb_matrix_set_color(36, RGB_DARKBLUE); // RGB_VAD | ||
215 | rgb_matrix_set_color(39, RGB_DARKBLUE); // RGB_VAI | ||
216 | |||
217 | rgb_matrix_set_color(31, RGB_DARKBLUE); // RGB_RMOD | ||
218 | rgb_matrix_set_color(37, RGB_DARKBLUE); // RGB_MOD | ||
219 | rgb_matrix_set_color(38, RGB_DARKPINK); // EEP_RST | ||
220 | rgb_matrix_set_color(40, RGB_DARKRED); // RGB_TOG | ||
221 | |||
222 | rgb_matrix_set_color(41, RGB_DARKORANGE); // _FN | ||
223 | break; | ||
224 | } | ||
225 | } | ||
226 | } | ||
227 | #endif | ||