forked from qmk/qmk_firmware
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add new connection keycodes for Bluetooth, 2.4GHz. (qmk#24251)
- Loading branch information
Showing
11 changed files
with
226 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
109 changes: 109 additions & 0 deletions
109
data/constants/keycodes/keycodes_0.0.5_connection.hjson
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
{ | ||
"ranges": { | ||
"0x7780/0x003F": { | ||
"define": "QK_CONNECTION" | ||
} | ||
} | ||
"keycodes": { | ||
"0x7780": { | ||
"group": "connection", | ||
"key": "QK_OUTPUT_NEXT", | ||
"aliases": [ | ||
"OU_NEXT", | ||
"OU_AUTO" | ||
] | ||
}, | ||
"0x7781": { | ||
"group": "connection", | ||
"key": "QK_OUTPUT_PREV", | ||
"aliases": [ | ||
"OU_PREV" | ||
] | ||
}, | ||
"0x7782": { | ||
"group": "connection", | ||
"key": "QK_OUTPUT_NONE", | ||
"aliases": [ | ||
"OU_NONE" | ||
] | ||
}, | ||
"0x7783": { | ||
"group": "connection", | ||
"key": "QK_OUTPUT_USB", | ||
"aliases": [ | ||
"OU_USB" | ||
] | ||
}, | ||
"0x7784": { | ||
"group": "connection", | ||
"key": "QK_OUTPUT_2P4GHZ", | ||
"aliases": [ | ||
"OU_2P4G" | ||
] | ||
}, | ||
"0x7785": { | ||
"group": "connection", | ||
"key": "QK_OUTPUT_BLUETOOTH", | ||
"aliases": [ | ||
"OU_BT" | ||
] | ||
}, | ||
|
||
"0x7790": { | ||
"group": "connection", | ||
"key": "QK_BLUETOOTH_PROFILE_NEXT", | ||
"aliases": [ | ||
"BT_NEXT" | ||
] | ||
}, | ||
"0x7791": { | ||
"group": "connection", | ||
"key": "QK_BLUETOOTH_PROFILE_PREV", | ||
"aliases": [ | ||
"BT_PREV" | ||
] | ||
}, | ||
"0x7792": { | ||
"group": "connection", | ||
"key": "QK_BLUETOOTH_UNPAIR", | ||
"aliases": [ | ||
"BT_UNPR" | ||
] | ||
} | ||
"0x7793": { | ||
"group": "connection", | ||
"key": "QK_BLUETOOTH_PROFILE1", | ||
"aliases": [ | ||
"BT_PRF1" | ||
] | ||
}, | ||
"0x7794": { | ||
"group": "connection", | ||
"key": "QK_BLUETOOTH_PROFILE2", | ||
"aliases": [ | ||
"BT_PRF2" | ||
] | ||
}, | ||
"0x7795": { | ||
"group": "connection", | ||
"key": "QK_BLUETOOTH_PROFILE3", | ||
"aliases": [ | ||
"BT_PRF3" | ||
] | ||
}, | ||
"0x7796": { | ||
"group": "connection", | ||
"key": "QK_BLUETOOTH_PROFILE4", | ||
"aliases": [ | ||
"BT_PRF4" | ||
] | ||
}, | ||
"0x7797": { | ||
"group": "connection", | ||
"key": "QK_BLUETOOTH_PROFILE5", | ||
"aliases": [ | ||
"BT_PRF5" | ||
] | ||
}, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"keycodes": { | ||
"0x7C20": "!delete!", // old QK_OUTPUT_AUTO | ||
"0x7C21": "!delete!", // old QK_OUTPUT_USB | ||
"0x7C22": "!delete!", // old QK_OUTPUT_BLUETOOTH | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// Copyright 2024 Nick Brassel (@tzarc) | ||
// SPDX-License-Identifier: GPL-2.0-or-later | ||
#include "outputselect.h" | ||
#include "process_connection.h" | ||
|
||
bool process_connection(uint16_t keycode, keyrecord_t *record) { | ||
if (record->event.pressed) { | ||
switch (keycode) { | ||
case QK_OUTPUT_NEXT: | ||
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. | ||
return false; | ||
case QK_OUTPUT_USB: | ||
set_output(OUTPUT_USB); | ||
return false; | ||
case QK_OUTPUT_BLUETOOTH: | ||
set_output(OUTPUT_BLUETOOTH); | ||
return false; | ||
|
||
case QK_OUTPUT_PREV: | ||
case QK_OUTPUT_NONE: | ||
case QK_OUTPUT_2P4GHZ: | ||
case QK_BLUETOOTH_PROFILE_NEXT: | ||
case QK_BLUETOOTH_PROFILE_PREV: | ||
case QK_BLUETOOTH_UNPAIR: | ||
case QK_BLUETOOTH_PROFILE1: | ||
case QK_BLUETOOTH_PROFILE2: | ||
case QK_BLUETOOTH_PROFILE3: | ||
case QK_BLUETOOTH_PROFILE4: | ||
case QK_BLUETOOTH_PROFILE5: | ||
// As-yet unimplemented. | ||
// When implementation is done, ensure `docs/keycodes.md`, `docs/features/bluetooth.md` are updated accordingly. | ||
return false; | ||
} | ||
} | ||
return true; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// Copyright 2024 Nick Brassel (@tzarc) | ||
// SPDX-License-Identifier: GPL-2.0-or-later | ||
#pragma once | ||
|
||
#include <stdint.h> | ||
#include <stdbool.h> | ||
#include "action.h" | ||
|
||
bool process_connection(uint16_t keycode, keyrecord_t *record); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters