]> git.donarmstrong.com Git - qmk_firmware.git/commitdiff
Add layer switcher keycodes: OUT_AUTO, OUT_USB, OUT_BT, OUT_BLE
authorPriyadi Iman Nurcahyo <priyadi@priyadi.net>
Wed, 1 Feb 2017 08:35:21 +0000 (15:35 +0700)
committerPriyadi Iman Nurcahyo <priyadi@priyadi.net>
Wed, 1 Feb 2017 08:35:21 +0000 (15:35 +0700)
quantum/quantum.c
quantum/quantum_keycodes.h

index 63ffe2074e78773adb277707e33bb450194d51a5..1d1a691e243de7efe1ede7b7e26afd2f673d6fdc 100644 (file)
@@ -1,4 +1,5 @@
 #include "quantum.h"
+#include "outputselect.h"
 
 #ifndef TAPPING_TERM
 #define TAPPING_TERM 200
@@ -212,6 +213,34 @@ bool process_record_quantum(keyrecord_t *record) {
          return false;
       break;
        #endif
+    case OUT_AUTO:
+      if (record->event.pressed) {
+        set_output(OUTPUT_AUTO);
+      }
+      return false;
+      break;
+    case OUT_USB:
+      if (record->event.pressed) {
+        set_output(OUTPUT_USB);
+      }
+      return false;
+      break;
+    #ifdef BLUETOOTH_ENABLE
+    case OUT_BT:
+      if (record->event.pressed) {
+        set_output(OUTPUT_BLUETOOTH);
+      }
+      return false;
+      break;
+    #endif
+    #ifdef ADAFRUIT_BLE_ENABLE
+    case OUT_BLE:
+      if (record->event.pressed) {
+        set_output(OUTPUT_ADAFRUIT_BLE);
+      }
+      return false;
+      break;
+    #endif
     case MAGIC_SWAP_CONTROL_CAPSLOCK ... MAGIC_TOGGLE_NKRO:
       if (record->event.pressed) {
         // MAGIC actions (BOOTMAGIC without the boot)
index 4853655f9560ea3b6f4e56a5d676b25f9424f1a5..4f1345b49fdfc3e2fbc565015a2a2af027d37ecc 100644 (file)
@@ -141,6 +141,16 @@ enum quantum_keycodes {
     PRINT_ON,
     PRINT_OFF,
 
+    // output selection
+    OUT_AUTO,
+    OUT_USB,
+#ifdef BLUETOOTH_ENABLE
+    OUT_BT,
+#endif
+#ifdef ADAFRUIT_BLE_ENABLE
+    OUT_BLE,
+#endif
+
     // always leave at the end
     SAFE_RANGE
 };