From d88048cc931658391228fb50443c0b87f418e920 Mon Sep 17 00:00:00 2001 From: Nick Brassel Date: Wed, 7 Aug 2024 17:17:08 +1000 Subject: [PATCH] Keycodes for cycling output. --- .../keycodes/keycodes_0.0.5_connection.hjson | 19 +++++++++++++++++-- quantum/keycodes.h | 15 ++++++++++----- tests/test_common/keycode_table.cpp | 2 ++ 3 files changed, 29 insertions(+), 7 deletions(-) diff --git a/data/constants/keycodes/keycodes_0.0.5_connection.hjson b/data/constants/keycodes/keycodes_0.0.5_connection.hjson index 1705812c9ee..9009254a3eb 100644 --- a/data/constants/keycodes/keycodes_0.0.5_connection.hjson +++ b/data/constants/keycodes/keycodes_0.0.5_connection.hjson @@ -6,6 +6,21 @@ } "keycodes": { "0x7780": { + "group": "connection", + "key": "QK_OUTPUT_NEXT", + "aliases": [ + "CX_NEXT", + "OU_AUTO" + ] + }, + "0x7781": { + "group": "connection", + "key": "QK_OUTPUT_PREV", + "aliases": [ + "CX_PREV" + ] + }, + "0x7782": { "group": "connection", "key": "QK_OUTPUT_USB", "aliases": [ @@ -13,14 +28,14 @@ "OU_USB" ] }, - "0x7781": { + "0x7783": { "group": "connection", "key": "QK_OUTPUT_2P4GHZ", "aliases": [ "CX_2P4G" ] }, - "0x7782": { + "0x7784": { "group": "connection", "key": "QK_OUTPUT_BLUETOOTH", "aliases": [ diff --git a/quantum/keycodes.h b/quantum/keycodes.h index 98ae00e082c..0883e2b2fad 100644 --- a/quantum/keycodes.h +++ b/quantum/keycodes.h @@ -622,9 +622,11 @@ enum qk_keycode_defines { QK_MACRO_29 = 0x771D, QK_MACRO_30 = 0x771E, QK_MACRO_31 = 0x771F, - QK_OUTPUT_USB = 0x7780, - QK_OUTPUT_2P4GHZ = 0x7781, - QK_OUTPUT_BLUETOOTH = 0x7782, + QK_OUTPUT_NEXT = 0x7780, + QK_OUTPUT_PREV = 0x7781, + QK_OUTPUT_USB = 0x7782, + QK_OUTPUT_2P4GHZ = 0x7783, + QK_OUTPUT_BLUETOOTH = 0x7784, QK_BLUETOOTH_PROFILE_NEXT = 0x7790, QK_BLUETOOTH_PROFILE_PREV = 0x7791, QK_BLUETOOTH_UNPAIR = 0x7792, @@ -1306,6 +1308,9 @@ enum qk_keycode_defines { MC_29 = QK_MACRO_29, MC_30 = QK_MACRO_30, MC_31 = QK_MACRO_31, + CX_NEXT = QK_OUTPUT_NEXT, + OU_AUTO = QK_OUTPUT_NEXT, + CX_PREV = QK_OUTPUT_PREV, CX_USB = QK_OUTPUT_USB, OU_USB = QK_OUTPUT_USB, CX_2P4G = QK_OUTPUT_2P4GHZ, @@ -1489,7 +1494,7 @@ enum qk_keycode_defines { #define IS_AUDIO_KEYCODE(code) ((code) >= QK_AUDIO_ON && (code) <= QK_AUDIO_VOICE_PREVIOUS) #define IS_STENO_KEYCODE(code) ((code) >= QK_STENO_BOLT && (code) <= QK_STENO_COMB_MAX) #define IS_MACRO_KEYCODE(code) ((code) >= QK_MACRO_0 && (code) <= QK_MACRO_31) -#define IS_CONNECTION_KEYCODE(code) ((code) >= QK_OUTPUT_USB && (code) <= QK_BLUETOOTH_PROFILE5) +#define IS_CONNECTION_KEYCODE(code) ((code) >= QK_OUTPUT_NEXT && (code) <= QK_BLUETOOTH_PROFILE5) #define IS_BACKLIGHT_KEYCODE(code) ((code) >= QK_BACKLIGHT_ON && (code) <= QK_BACKLIGHT_TOGGLE_BREATHING) #define IS_LED_MATRIX_KEYCODE(code) ((code) >= QK_LED_MATRIX_ON && (code) <= QK_LED_MATRIX_SPEED_DOWN) #define IS_UNDERGLOW_KEYCODE(code) ((code) >= QK_UNDERGLOW_TOGGLE && (code) <= QK_UNDERGLOW_SPEED_DOWN) @@ -1515,7 +1520,7 @@ enum qk_keycode_defines { #define AUDIO_KEYCODE_RANGE QK_AUDIO_ON ... QK_AUDIO_VOICE_PREVIOUS #define STENO_KEYCODE_RANGE QK_STENO_BOLT ... QK_STENO_COMB_MAX #define MACRO_KEYCODE_RANGE QK_MACRO_0 ... QK_MACRO_31 -#define CONNECTION_KEYCODE_RANGE QK_OUTPUT_USB ... QK_BLUETOOTH_PROFILE5 +#define CONNECTION_KEYCODE_RANGE QK_OUTPUT_NEXT ... QK_BLUETOOTH_PROFILE5 #define BACKLIGHT_KEYCODE_RANGE QK_BACKLIGHT_ON ... QK_BACKLIGHT_TOGGLE_BREATHING #define LED_MATRIX_KEYCODE_RANGE QK_LED_MATRIX_ON ... QK_LED_MATRIX_SPEED_DOWN #define UNDERGLOW_KEYCODE_RANGE QK_UNDERGLOW_TOGGLE ... QK_UNDERGLOW_SPEED_DOWN diff --git a/tests/test_common/keycode_table.cpp b/tests/test_common/keycode_table.cpp index c855632896c..53829f80512 100644 --- a/tests/test_common/keycode_table.cpp +++ b/tests/test_common/keycode_table.cpp @@ -562,6 +562,8 @@ std::map KEYCODE_ID_TABLE = { {QK_MACRO_29, "QK_MACRO_29"}, {QK_MACRO_30, "QK_MACRO_30"}, {QK_MACRO_31, "QK_MACRO_31"}, + {QK_OUTPUT_NEXT, "QK_OUTPUT_NEXT"}, + {QK_OUTPUT_PREV, "QK_OUTPUT_PREV"}, {QK_OUTPUT_USB, "QK_OUTPUT_USB"}, {QK_OUTPUT_2P4GHZ, "QK_OUTPUT_2P4GHZ"}, {QK_OUTPUT_BLUETOOTH, "QK_OUTPUT_BLUETOOTH"},