diff options
author | Gabriel Young <gabeplaysdrums@live.com> | 2017-02-19 17:18:05 -0800 |
---|---|---|
committer | Gabriel Young <gabeplaysdrums@live.com> | 2017-02-19 17:18:05 -0800 |
commit | d1fe24ad9f85768774ae50465c71f3757a33cc00 (patch) | |
tree | ab8468e72a016382a0cc6958b8b9abd179c4b13e /quantum/quantum_keycodes.h | |
parent | ae0752dff552a07fb52e08c7057979959959d247 (diff) | |
download | qmk_firmware-d1fe24ad9f85768774ae50465c71f3757a33cc00.tar.gz qmk_firmware-d1fe24ad9f85768774ae50465c71f3757a33cc00.zip |
Allow customization of the number of tone keycodes and add example keymap
Diffstat (limited to 'quantum/quantum_keycodes.h')
-rw-r--r-- | quantum/quantum_keycodes.h | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/quantum/quantum_keycodes.h b/quantum/quantum_keycodes.h index 30cc9abdb..6d1438051 100644 --- a/quantum/quantum_keycodes.h +++ b/quantum/quantum_keycodes.h | |||
@@ -2,6 +2,12 @@ | |||
2 | #ifndef QUANTUM_KEYCODES_H | 2 | #ifndef QUANTUM_KEYCODES_H |
3 | #define QUANTUM_KEYCODES_H | 3 | #define QUANTUM_KEYCODES_H |
4 | 4 | ||
5 | #ifdef MIDI_ENABLE | ||
6 | #ifndef MIDI_TONE_KEYCODE_OCTAVES | ||
7 | #define MIDI_TONE_KEYCODE_OCTAVES 3 | ||
8 | #endif | ||
9 | #endif | ||
10 | |||
5 | enum quantum_keycodes { | 11 | enum quantum_keycodes { |
6 | // Ranges used in shortucuts - not to be used directly | 12 | // Ranges used in shortucuts - not to be used directly |
7 | QK_TMK = 0x0000, | 13 | QK_TMK = 0x0000, |
@@ -112,6 +118,7 @@ enum quantum_keycodes { | |||
112 | 118 | ||
113 | MIDI_TONE_MIN, | 119 | MIDI_TONE_MIN, |
114 | 120 | ||
121 | #if MIDI_TONE_KEYCODE_OCTAVES > 0 | ||
115 | MI_C = MIDI_TONE_MIN, | 122 | MI_C = MIDI_TONE_MIN, |
116 | MI_Cs, | 123 | MI_Cs, |
117 | MI_Db = MI_Cs, | 124 | MI_Db = MI_Cs, |
@@ -129,7 +136,9 @@ enum quantum_keycodes { | |||
129 | MI_As, | 136 | MI_As, |
130 | MI_Bb = MI_As, | 137 | MI_Bb = MI_As, |
131 | MI_B, | 138 | MI_B, |
139 | #endif | ||
132 | 140 | ||
141 | #if MIDI_TONE_KEYCODE_OCTAVES > 1 | ||
133 | MI_C_1, | 142 | MI_C_1, |
134 | MI_Cs_1, | 143 | MI_Cs_1, |
135 | MI_Db_1 = MI_Cs_1, | 144 | MI_Db_1 = MI_Cs_1, |
@@ -147,7 +156,9 @@ enum quantum_keycodes { | |||
147 | MI_As_1, | 156 | MI_As_1, |
148 | MI_Bb_1 = MI_As_1, | 157 | MI_Bb_1 = MI_As_1, |
149 | MI_B_1, | 158 | MI_B_1, |
159 | #endif | ||
150 | 160 | ||
161 | #if MIDI_TONE_KEYCODE_OCTAVES > 2 | ||
151 | MI_C_2, | 162 | MI_C_2, |
152 | MI_Cs_2, | 163 | MI_Cs_2, |
153 | MI_Db_2 = MI_Cs_2, | 164 | MI_Db_2 = MI_Cs_2, |
@@ -165,8 +176,81 @@ enum quantum_keycodes { | |||
165 | MI_As_2, | 176 | MI_As_2, |
166 | MI_Bb_2 = MI_As_2, | 177 | MI_Bb_2 = MI_As_2, |
167 | MI_B_2, | 178 | MI_B_2, |
179 | #endif | ||
168 | 180 | ||
181 | #if MIDI_TONE_KEYCODE_OCTAVES > 3 | ||
182 | MI_C_3, | ||
183 | MI_Cs_3, | ||
184 | MI_Db_3 = MI_Cs_3, | ||
185 | MI_D_3, | ||
186 | MI_Ds_3, | ||
187 | MI_Eb_3 = MI_Ds_3, | ||
188 | MI_E_3, | ||
189 | MI_F_3, | ||
190 | MI_Fs_3, | ||
191 | MI_Gb_3 = MI_Fs_3, | ||
192 | MI_G_3, | ||
193 | MI_Gs_3, | ||
194 | MI_Ab_3 = MI_Gs_3, | ||
195 | MI_A_3, | ||
196 | MI_As_3, | ||
197 | MI_Bb_3 = MI_As_3, | ||
198 | MI_B_3, | ||
199 | #endif | ||
200 | |||
201 | #if MIDI_TONE_KEYCODE_OCTAVES > 4 | ||
202 | MI_C_4, | ||
203 | MI_Cs_4, | ||
204 | MI_Db_4 = MI_Cs_4, | ||
205 | MI_D_4, | ||
206 | MI_Ds_4, | ||
207 | MI_Eb_4 = MI_Ds_4, | ||
208 | MI_E_4, | ||
209 | MI_F_4, | ||
210 | MI_Fs_4, | ||
211 | MI_Gb_4 = MI_Fs_4, | ||
212 | MI_G_4, | ||
213 | MI_Gs_4, | ||
214 | MI_Ab_4 = MI_Gs_4, | ||
215 | MI_A_4, | ||
216 | MI_As_4, | ||
217 | MI_Bb_4 = MI_As_4, | ||
218 | MI_B_4, | ||
219 | #endif | ||
220 | |||
221 | #if MIDI_TONE_KEYCODE_OCTAVES > 5 | ||
222 | MI_C_5, | ||
223 | MI_Cs_5, | ||
224 | MI_Db_5 = MI_Cs_5, | ||
225 | MI_D_5, | ||
226 | MI_Ds_5, | ||
227 | MI_Eb_5 = MI_Ds_5, | ||
228 | MI_E_5, | ||
229 | MI_F_5, | ||
230 | MI_Fs_5, | ||
231 | MI_Gb_5 = MI_Fs_5, | ||
232 | MI_G_5, | ||
233 | MI_Gs_5, | ||
234 | MI_Ab_5 = MI_Gs_5, | ||
235 | MI_A_5, | ||
236 | MI_As_5, | ||
237 | MI_Bb_5 = MI_As_5, | ||
238 | MI_B_5, | ||
239 | #endif | ||
240 | |||
241 | #if MIDI_TONE_KEYCODE_OCTAVES > 5 | ||
242 | MIDI_TONE_MAX = MI_B_5, | ||
243 | #elif MIDI_TONE_KEYCODE_OCTAVES > 4 | ||
244 | MIDI_TONE_MAX = MI_B_4, | ||
245 | #elif MIDI_TONE_KEYCODE_OCTAVES > 3 | ||
246 | MIDI_TONE_MAX = MI_B_3, | ||
247 | #elif MIDI_TONE_KEYCODE_OCTAVES > 2 | ||
169 | MIDI_TONE_MAX = MI_B_2, | 248 | MIDI_TONE_MAX = MI_B_2, |
249 | #elif MIDI_TONE_KEYCODE_OCTAVES > 1 | ||
250 | MIDI_TONE_MAX = MI_B_1, | ||
251 | #elif MIDI_TONE_KEYCODE_OCTAVES > 0 | ||
252 | MIDI_TONE_MAX = MI_B, | ||
253 | #endif | ||
170 | 254 | ||
171 | MIDI_OCTAVE_MIN, | 255 | MIDI_OCTAVE_MIN, |
172 | MI_OCT_N2 = MIDI_OCTAVE_MIN, | 256 | MI_OCT_N2 = MIDI_OCTAVE_MIN, |