Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new set of keycodes for RGB Matrix #23463

Merged
merged 2 commits into from
May 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 92 additions & 0 deletions data/constants/keycodes/keycodes_0.0.4_lighting.hjson
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,98 @@
"aliases": [
"LM_SPDD"
]
},

"0x7840": {
"group": "rgb_matrix",
"key": "QK_RGB_MATRIX_ON",
"aliases": [
"RM_ON"
]
},
"0x7841": {
"group": "rgb_matrix",
"key": "QK_RGB_MATRIX_OFF",
"aliases": [
"RM_OFF"
]
},
"0x7842": {
"group": "rgb_matrix",
"key": "QK_RGB_MATRIX_TOGGLE",
"aliases": [
"RM_TOGG"
]
},
"0x7843": {
"group": "rgb_matrix",
"key": "QK_RGB_MATRIX_MODE_NEXT",
"aliases": [
"RM_NEXT"
]
},
"0x7844": {
"group": "rgb_matrix",
"key": "QK_RGB_MATRIX_MODE_PREVIOUS",
"aliases": [
"RM_PREV"
]
},
"0x7845": {
"group": "rgb_matrix",
"key": "QK_RGB_MATRIX_HUE_UP",
"aliases": [
"RM_HUEU"
]
},
"0x7846": {
"group": "rgb_matrix",
"key": "QK_RGB_MATRIX_HUE_DOWN",
"aliases": [
"RM_HUED"
]
},
"0x7847": {
"group": "rgb_matrix",
"key": "QK_RGB_MATRIX_SATURATION_UP",
"aliases": [
"RM_SATU"
]
},
"0x7848": {
"group": "rgb_matrix",
"key": "QK_RGB_MATRIX_SATURATION_DOWN",
"aliases": [
"RM_SATD"
]
},
"0x7849": {
"group": "rgb_matrix",
"key": "QK_RGB_MATRIX_VALUE_UP",
"aliases": [
"RM_VALU"
]
},
"0x784A": {
"group": "rgb_matrix",
"key": "QK_RGB_MATRIX_VALUE_DOWN",
"aliases": [
"RM_VALD"
]
},
"0x784B": {
"group": "rgb_matrix",
"key": "QK_RGB_MATRIX_SPEED_UP",
"aliases": [
"RM_SPDU"
]
},
"0x784C": {
"group": "rgb_matrix",
"key": "QK_RGB_MATRIX_SPEED_DOWN",
"aliases": [
"RM_SPDD"
]
}
}
}
34 changes: 17 additions & 17 deletions keyboards/kprepublic/bm68hsrgb/rev2/keymaps/via/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,53 +15,53 @@
*/
#include QMK_KEYBOARD_H
enum my_keycodes {
RM_TOGG = SAFE_RANGE,
RM_MOD,
RM_HUI,
RM_HUD,
RM_SAI,
RM_SAD,
RM_VAI,
RM_VAD
RMT = SAFE_RANGE,
RMS,
RMIH,
RMDH,
RMIS,
RMDS,
RMIV,
RMDV
};
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case RM_TOGG:
case RMT:
if (record->event.pressed)
{rgb_matrix_toggle();
}
return false;
case RM_MOD:
case RMS:
if (record->event.pressed)
{rgb_matrix_step();
}
return false;
case RM_HUI:
case RMIH:
if (record->event.pressed)
{rgb_matrix_increase_hue();
}
return false;
case RM_HUD:
case RMDH:
if (record->event.pressed)
{rgb_matrix_decrease_hue();
}
return false;
case RM_SAI:
case RMIS:
if (record->event.pressed)
{rgb_matrix_increase_sat();
}
return false;
case RM_SAD:
case RMDS:
if (record->event.pressed)
{rgb_matrix_decrease_sat();
}
return false;
case RM_VAI:
case RMIV:
if (record->event.pressed)
{rgb_matrix_increase_val();
}
return false;
case RM_VAD:
case RMDV:
if (record->event.pressed)
{rgb_matrix_decrease_val();
}
Expand All @@ -82,7 +82,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[1] = LAYOUT_65_ansi(
QK_GESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, QK_BOOT,
_______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, RGB_SPI, RGB_SPD, _______, _______, _______, _______,
KC_CAPS, RM_TOGG, RM_MOD, RM_HUI, RM_HUD, RM_SAI, RM_SAD, RM_VAI, RM_VAD, _______, _______, _______, _______, _______,
KC_CAPS, RMT, RMS, RMIH, RMDH, RMIS, RMDS, RMIV, RMDV, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, NK_TOGG, _______, _______, _______, _______, _______, KC_VOLU, _______,
_______, _______, _______, _______, _______, _______, _______, _______, KC_VOLD, _______
),
Expand Down
28 changes: 28 additions & 0 deletions quantum/keycodes.h
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,19 @@ enum qk_keycode_defines {
RGB_MODE_GRADIENT = 0x7832,
RGB_MODE_RGBTEST = 0x7833,
RGB_MODE_TWINKLE = 0x7834,
QK_RGB_MATRIX_ON = 0x7840,
QK_RGB_MATRIX_OFF = 0x7841,
QK_RGB_MATRIX_TOGGLE = 0x7842,
QK_RGB_MATRIX_MODE_NEXT = 0x7843,
QK_RGB_MATRIX_MODE_PREVIOUS = 0x7844,
QK_RGB_MATRIX_HUE_UP = 0x7845,
QK_RGB_MATRIX_HUE_DOWN = 0x7846,
QK_RGB_MATRIX_SATURATION_UP = 0x7847,
QK_RGB_MATRIX_SATURATION_DOWN = 0x7848,
QK_RGB_MATRIX_VALUE_UP = 0x7849,
QK_RGB_MATRIX_VALUE_DOWN = 0x784A,
QK_RGB_MATRIX_SPEED_UP = 0x784B,
QK_RGB_MATRIX_SPEED_DOWN = 0x784C,
QK_BOOTLOADER = 0x7C00,
QK_REBOOT = 0x7C01,
QK_DEBUG_TOGGLE = 0x7C02,
Expand Down Expand Up @@ -1311,6 +1324,19 @@ enum qk_keycode_defines {
RGB_M_G = RGB_MODE_GRADIENT,
RGB_M_T = RGB_MODE_RGBTEST,
RGB_M_TW = RGB_MODE_TWINKLE,
RM_ON = QK_RGB_MATRIX_ON,
RM_OFF = QK_RGB_MATRIX_OFF,
RM_TOGG = QK_RGB_MATRIX_TOGGLE,
RM_NEXT = QK_RGB_MATRIX_MODE_NEXT,
RM_PREV = QK_RGB_MATRIX_MODE_PREVIOUS,
RM_HUEU = QK_RGB_MATRIX_HUE_UP,
RM_HUED = QK_RGB_MATRIX_HUE_DOWN,
RM_SATU = QK_RGB_MATRIX_SATURATION_UP,
RM_SATD = QK_RGB_MATRIX_SATURATION_DOWN,
RM_VALU = QK_RGB_MATRIX_VALUE_UP,
RM_VALD = QK_RGB_MATRIX_VALUE_DOWN,
RM_SPDU = QK_RGB_MATRIX_SPEED_UP,
RM_SPDD = QK_RGB_MATRIX_SPEED_DOWN,
QK_BOOT = QK_BOOTLOADER,
QK_RBT = QK_REBOOT,
DB_TOGG = QK_DEBUG_TOGGLE,
Expand Down Expand Up @@ -1436,6 +1462,7 @@ enum qk_keycode_defines {
#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_RGB_KEYCODE(code) ((code) >= RGB_TOG && (code) <= RGB_MODE_TWINKLE)
#define IS_RGB_MATRIX_KEYCODE(code) ((code) >= QK_RGB_MATRIX_ON && (code) <= QK_RGB_MATRIX_SPEED_DOWN)
#define IS_QUANTUM_KEYCODE(code) ((code) >= QK_BOOTLOADER && (code) <= QK_ALT_REPEAT_KEY)
#define IS_KB_KEYCODE(code) ((code) >= QK_KB_0 && (code) <= QK_KB_31)
#define IS_USER_KEYCODE(code) ((code) >= QK_USER_0 && (code) <= QK_USER_31)
Expand All @@ -1459,6 +1486,7 @@ enum qk_keycode_defines {
#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 RGB_KEYCODE_RANGE RGB_TOG ... RGB_MODE_TWINKLE
#define RGB_MATRIX_KEYCODE_RANGE QK_RGB_MATRIX_ON ... QK_RGB_MATRIX_SPEED_DOWN
#define QUANTUM_KEYCODE_RANGE QK_BOOTLOADER ... QK_ALT_REPEAT_KEY
#define KB_KEYCODE_RANGE QK_KB_0 ... QK_KB_31
#define USER_KEYCODE_RANGE QK_USER_0 ... QK_USER_31
13 changes: 13 additions & 0 deletions tests/test_common/keycode_table.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -599,6 +599,19 @@ std::map<uint16_t, std::string> KEYCODE_ID_TABLE = {
{RGB_MODE_GRADIENT, "RGB_MODE_GRADIENT"},
{RGB_MODE_RGBTEST, "RGB_MODE_RGBTEST"},
{RGB_MODE_TWINKLE, "RGB_MODE_TWINKLE"},
{QK_RGB_MATRIX_ON, "QK_RGB_MATRIX_ON"},
{QK_RGB_MATRIX_OFF, "QK_RGB_MATRIX_OFF"},
{QK_RGB_MATRIX_TOGGLE, "QK_RGB_MATRIX_TOGGLE"},
{QK_RGB_MATRIX_MODE_NEXT, "QK_RGB_MATRIX_MODE_NEXT"},
{QK_RGB_MATRIX_MODE_PREVIOUS, "QK_RGB_MATRIX_MODE_PREVIOUS"},
{QK_RGB_MATRIX_HUE_UP, "QK_RGB_MATRIX_HUE_UP"},
{QK_RGB_MATRIX_HUE_DOWN, "QK_RGB_MATRIX_HUE_DOWN"},
{QK_RGB_MATRIX_SATURATION_UP, "QK_RGB_MATRIX_SATURATION_UP"},
{QK_RGB_MATRIX_SATURATION_DOWN, "QK_RGB_MATRIX_SATURATION_DOWN"},
{QK_RGB_MATRIX_VALUE_UP, "QK_RGB_MATRIX_VALUE_UP"},
{QK_RGB_MATRIX_VALUE_DOWN, "QK_RGB_MATRIX_VALUE_DOWN"},
{QK_RGB_MATRIX_SPEED_UP, "QK_RGB_MATRIX_SPEED_UP"},
{QK_RGB_MATRIX_SPEED_DOWN, "QK_RGB_MATRIX_SPEED_DOWN"},
{QK_BOOTLOADER, "QK_BOOTLOADER"},
{QK_REBOOT, "QK_REBOOT"},
{QK_DEBUG_TOGGLE, "QK_DEBUG_TOGGLE"},
Expand Down
Loading