diff options
| author | Nick Brassel <nick@tzarc.org> | 2024-08-27 10:52:23 +1000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-08-27 10:52:23 +1000 |
| commit | 70cbf08b673c2cc59e603503e834ac460040ecc1 (patch) | |
| tree | 3843e6c36e6564a1a6842cc15adc276cd29ce0d2 /quantum/process_keycode | |
| parent | ecf725b356e999799f30f0fcaa9e0848cc3163ca (diff) | |
Add new connection keycodes for Bluetooth, 2.4GHz. (#24251)
Diffstat (limited to 'quantum/process_keycode')
| -rw-r--r-- | quantum/process_keycode/process_connection.c | 36 | ||||
| -rw-r--r-- | quantum/process_keycode/process_connection.h | 9 |
2 files changed, 45 insertions, 0 deletions
diff --git a/quantum/process_keycode/process_connection.c b/quantum/process_keycode/process_connection.c new file mode 100644 index 0000000000..b0e230d680 --- /dev/null +++ b/quantum/process_keycode/process_connection.c | |||
| @@ -0,0 +1,36 @@ | |||
| 1 | // Copyright 2024 Nick Brassel (@tzarc) | ||
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | ||
| 3 | #include "outputselect.h" | ||
| 4 | #include "process_connection.h" | ||
| 5 | |||
| 6 | bool process_connection(uint16_t keycode, keyrecord_t *record) { | ||
| 7 | if (record->event.pressed) { | ||
| 8 | switch (keycode) { | ||
| 9 | case QK_OUTPUT_NEXT: | ||
| 10 | set_output(OUTPUT_AUTO); // This should cycle through the outputs going forward. Ensure `docs/keycodes.md`, `docs/features/bluetooth.md` are updated when it does. | ||
| 11 | return false; | ||
| 12 | case QK_OUTPUT_USB: | ||
| 13 | set_output(OUTPUT_USB); | ||
| 14 | return false; | ||
| 15 | case QK_OUTPUT_BLUETOOTH: | ||
| 16 | set_output(OUTPUT_BLUETOOTH); | ||
| 17 | return false; | ||
| 18 | |||
| 19 | case QK_OUTPUT_PREV: | ||
| 20 | case QK_OUTPUT_NONE: | ||
| 21 | case QK_OUTPUT_2P4GHZ: | ||
| 22 | case QK_BLUETOOTH_PROFILE_NEXT: | ||
| 23 | case QK_BLUETOOTH_PROFILE_PREV: | ||
| 24 | case QK_BLUETOOTH_UNPAIR: | ||
| 25 | case QK_BLUETOOTH_PROFILE1: | ||
| 26 | case QK_BLUETOOTH_PROFILE2: | ||
| 27 | case QK_BLUETOOTH_PROFILE3: | ||
| 28 | case QK_BLUETOOTH_PROFILE4: | ||
| 29 | case QK_BLUETOOTH_PROFILE5: | ||
| 30 | // As-yet unimplemented. | ||
| 31 | // When implementation is done, ensure `docs/keycodes.md`, `docs/features/bluetooth.md` are updated accordingly. | ||
| 32 | return false; | ||
| 33 | } | ||
| 34 | } | ||
| 35 | return true; | ||
| 36 | } | ||
diff --git a/quantum/process_keycode/process_connection.h b/quantum/process_keycode/process_connection.h new file mode 100644 index 0000000000..cc58011bb7 --- /dev/null +++ b/quantum/process_keycode/process_connection.h | |||
| @@ -0,0 +1,9 @@ | |||
| 1 | // Copyright 2024 Nick Brassel (@tzarc) | ||
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | ||
| 3 | #pragma once | ||
| 4 | |||
| 5 | #include <stdint.h> | ||
| 6 | #include <stdbool.h> | ||
| 7 | #include "action.h" | ||
| 8 | |||
| 9 | bool process_connection(uint16_t keycode, keyrecord_t *record); | ||
