]> git.donarmstrong.com Git - qmk_firmware.git/blobdiff - quantum/quantum_keycodes.h
Merge pull request #1 from qmk/master
[qmk_firmware.git] / quantum / quantum_keycodes.h
index 6d1438051e9cd69c107c55f67189b14fe3a0521d..7354ae0da1c61a27f6d9e87f1b94c966aafea53f 100644 (file)
@@ -1,8 +1,26 @@
-
+/* Copyright 2016-2017 Jack Humbert
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
 #ifndef QUANTUM_KEYCODES_H
 #define QUANTUM_KEYCODES_H
 
-#ifdef MIDI_ENABLE
+#ifndef MIDI_ENABLE_STRICT
+#define MIDI_ENABLE_STRICT 0
+#endif
+
+#if !MIDI_ENABLE_STRICT || (defined(MIDI_ENABLE) && defined(MIDI_ADVANCED))
 #ifndef MIDI_TONE_KEYCODE_OCTAVES
 #define MIDI_TONE_KEYCODE_OCTAVES 3
 #endif
@@ -113,12 +131,16 @@ enum quantum_keycodes {
     MUV_IN,
     MUV_DE,
 
-#ifdef MIDI_ENABLE
     // Midi
+#if !MIDI_ENABLE_STRICT || (defined(MIDI_ENABLE) && defined(MIDI_BASIC))
+    MI_ON,  // send midi notes when music mode is enabled
+    MI_OFF, // don't send midi notes when music mode is enabled
+#endif
 
+#if !MIDI_ENABLE_STRICT || (defined(MIDI_ENABLE) && defined(MIDI_ADVANCED))
     MIDI_TONE_MIN,
 
-#if MIDI_TONE_KEYCODE_OCTAVES > 0
+#if !MIDI_ENABLE_STRICT || MIDI_TONE_KEYCODE_OCTAVES > 0
     MI_C = MIDI_TONE_MIN,
     MI_Cs,
     MI_Db = MI_Cs,
@@ -138,7 +160,7 @@ enum quantum_keycodes {
     MI_B,
 #endif
 
-#if MIDI_TONE_KEYCODE_OCTAVES > 1
+#if !MIDI_ENABLE_STRICT || MIDI_TONE_KEYCODE_OCTAVES > 1
     MI_C_1,
     MI_Cs_1,
     MI_Db_1 = MI_Cs_1,
@@ -158,7 +180,7 @@ enum quantum_keycodes {
     MI_B_1,
 #endif
 
-#if MIDI_TONE_KEYCODE_OCTAVES > 2
+#if !MIDI_ENABLE_STRICT || MIDI_TONE_KEYCODE_OCTAVES > 2
     MI_C_2,
     MI_Cs_2,
     MI_Db_2 = MI_Cs_2,
@@ -178,7 +200,7 @@ enum quantum_keycodes {
     MI_B_2,
 #endif
 
-#if MIDI_TONE_KEYCODE_OCTAVES > 3
+#if !MIDI_ENABLE_STRICT || MIDI_TONE_KEYCODE_OCTAVES > 3
     MI_C_3,
     MI_Cs_3,
     MI_Db_3 = MI_Cs_3,
@@ -198,7 +220,7 @@ enum quantum_keycodes {
     MI_B_3,
 #endif
 
-#if MIDI_TONE_KEYCODE_OCTAVES > 4
+#if !MIDI_ENABLE_STRICT || MIDI_TONE_KEYCODE_OCTAVES > 4
     MI_C_4,
     MI_Cs_4,
     MI_Db_4 = MI_Cs_4,
@@ -218,7 +240,7 @@ enum quantum_keycodes {
     MI_B_4,
 #endif
 
-#if MIDI_TONE_KEYCODE_OCTAVES > 5
+#if !MIDI_ENABLE_STRICT || MIDI_TONE_KEYCODE_OCTAVES > 5
     MI_C_5,
     MI_Cs_5,
     MI_Db_5 = MI_Cs_5,
@@ -238,7 +260,7 @@ enum quantum_keycodes {
     MI_B_5,
 #endif
 
-#if MIDI_TONE_KEYCODE_OCTAVES > 5
+#if !MIDI_ENABLE_STRICT || MIDI_TONE_KEYCODE_OCTAVES > 5
     MIDI_TONE_MAX = MI_B_5,
 #elif MIDI_TONE_KEYCODE_OCTAVES > 4
     MIDI_TONE_MAX = MI_B_4,
@@ -321,7 +343,7 @@ enum quantum_keycodes {
     MI_CHD, // previous channel
     MI_CHU, // next channel
 
-    MI_OFF, // all notes off
+    MI_ALLOFF, // all notes off
 
     MI_SUS, // sustain
     MI_PORT, // portamento
@@ -332,7 +354,7 @@ enum quantum_keycodes {
     MI_MOD, // modulation
     MI_MODSD, // decrease modulation speed
     MI_MODSU, // increase modulation speed
-#endif
+#endif // MIDI_ADVANCED
 
     // Backlight functionality
     BL_0,
@@ -382,9 +404,6 @@ enum quantum_keycodes {
 #ifdef BLUETOOTH_ENABLE
     OUT_BT,
 #endif
-#ifdef ADAFRUIT_BLE_ENABLE
-    OUT_BLE,
-#endif
 
     // always leave at the end
     SAFE_RANGE
@@ -406,6 +425,7 @@ enum quantum_keycodes {
 #define ALTG(kc) (kc | QK_RCTL | QK_RALT)
 #define SCMD(kc) (kc | QK_LGUI | QK_LSFT)
 #define SWIN(kc) SCMD(kc)
+#define LCA(kc) (kc | QK_LCTL | QK_LALT)
 
 #define MOD_HYPR 0xf
 #define MOD_MEH 0x7
@@ -559,6 +579,7 @@ enum quantum_keycodes {
 #define ALL_T(kc) MT((MOD_LCTL | MOD_LSFT | MOD_LALT | MOD_LGUI), kc) // see http://brettterpstra.com/2012/12/08/a-useful-caps-lock-key/
 #define SCMD_T(kc) MT((MOD_LGUI | MOD_LSFT), kc)
 #define SWIN_T(kc) SCMD_T(kc)
+#define LCA_T(kc) MT((MOD_LCTL | MOD_LALT), kc) // Left control and left alt
 
 // Dedicated keycode versions for Hyper and Meh, if you want to use them as standalone keys rather than mod-tap
 #define KC_HYPR HYPR(KC_NO)