Parent directory

process_connection.c

1390 bytes
 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
 6bool 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}