diff options
| author | Priyadi Iman Nurcahyo <priyadi@priyadi.net> | 2017-02-01 15:35:21 +0700 |
|---|---|---|
| committer | Priyadi Iman Nurcahyo <priyadi@priyadi.net> | 2017-02-01 15:35:21 +0700 |
| commit | c17070eca545f654f91cf3dcba6c6c611e0f8d03 (patch) | |
| tree | 4dc59b9274f2d8799587a6fff486f0bd0b50ea51 /quantum | |
| parent | d8a9c63c265869822a77ad5c5cb7c8dfa4ff1f6c (diff) | |
| download | qmk_firmware-c17070eca545f654f91cf3dcba6c6c611e0f8d03.tar.gz qmk_firmware-c17070eca545f654f91cf3dcba6c6c611e0f8d03.zip | |
Add layer switcher keycodes: OUT_AUTO, OUT_USB, OUT_BT, OUT_BLE
Diffstat (limited to 'quantum')
| -rw-r--r-- | quantum/quantum.c | 29 | ||||
| -rw-r--r-- | quantum/quantum_keycodes.h | 10 |
2 files changed, 39 insertions, 0 deletions
diff --git a/quantum/quantum.c b/quantum/quantum.c index 63ffe2074..1d1a691e2 100644 --- a/quantum/quantum.c +++ b/quantum/quantum.c | |||
| @@ -1,4 +1,5 @@ | |||
| 1 | #include "quantum.h" | 1 | #include "quantum.h" |
| 2 | #include "outputselect.h" | ||
| 2 | 3 | ||
| 3 | #ifndef TAPPING_TERM | 4 | #ifndef TAPPING_TERM |
| 4 | #define TAPPING_TERM 200 | 5 | #define TAPPING_TERM 200 |
| @@ -212,6 +213,34 @@ bool process_record_quantum(keyrecord_t *record) { | |||
| 212 | return false; | 213 | return false; |
| 213 | break; | 214 | break; |
| 214 | #endif | 215 | #endif |
| 216 | case OUT_AUTO: | ||
| 217 | if (record->event.pressed) { | ||
| 218 | set_output(OUTPUT_AUTO); | ||
| 219 | } | ||
| 220 | return false; | ||
| 221 | break; | ||
| 222 | case OUT_USB: | ||
| 223 | if (record->event.pressed) { | ||
| 224 | set_output(OUTPUT_USB); | ||
| 225 | } | ||
| 226 | return false; | ||
| 227 | break; | ||
| 228 | #ifdef BLUETOOTH_ENABLE | ||
| 229 | case OUT_BT: | ||
| 230 | if (record->event.pressed) { | ||
| 231 | set_output(OUTPUT_BLUETOOTH); | ||
| 232 | } | ||
| 233 | return false; | ||
| 234 | break; | ||
| 235 | #endif | ||
| 236 | #ifdef ADAFRUIT_BLE_ENABLE | ||
| 237 | case OUT_BLE: | ||
| 238 | if (record->event.pressed) { | ||
| 239 | set_output(OUTPUT_ADAFRUIT_BLE); | ||
| 240 | } | ||
| 241 | return false; | ||
| 242 | break; | ||
| 243 | #endif | ||
| 215 | case MAGIC_SWAP_CONTROL_CAPSLOCK ... MAGIC_TOGGLE_NKRO: | 244 | case MAGIC_SWAP_CONTROL_CAPSLOCK ... MAGIC_TOGGLE_NKRO: |
| 216 | if (record->event.pressed) { | 245 | if (record->event.pressed) { |
| 217 | // MAGIC actions (BOOTMAGIC without the boot) | 246 | // MAGIC actions (BOOTMAGIC without the boot) |
diff --git a/quantum/quantum_keycodes.h b/quantum/quantum_keycodes.h index 4853655f9..4f1345b49 100644 --- a/quantum/quantum_keycodes.h +++ b/quantum/quantum_keycodes.h | |||
| @@ -141,6 +141,16 @@ enum quantum_keycodes { | |||
| 141 | PRINT_ON, | 141 | PRINT_ON, |
| 142 | PRINT_OFF, | 142 | PRINT_OFF, |
| 143 | 143 | ||
| 144 | // output selection | ||
| 145 | OUT_AUTO, | ||
| 146 | OUT_USB, | ||
| 147 | #ifdef BLUETOOTH_ENABLE | ||
| 148 | OUT_BT, | ||
| 149 | #endif | ||
| 150 | #ifdef ADAFRUIT_BLE_ENABLE | ||
| 151 | OUT_BLE, | ||
| 152 | #endif | ||
| 153 | |||
| 144 | // always leave at the end | 154 | // always leave at the end |
| 145 | SAFE_RANGE | 155 | SAFE_RANGE |
| 146 | }; | 156 | }; |
