Add new set of keycodes for LED Matrix (#23432)

master
Ryan 2024-04-11 14:14:02 +10:00 committed by GitHub
parent 25f608c1b4
commit 52d3ef0fe4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 123 additions and 10 deletions

View File

@ -0,0 +1,67 @@
{
"keycodes": {
"0x7810": {
"group": "led_matrix",
"key": "QK_LED_MATRIX_ON",
"aliases": [
"LM_ON"
]
},
"0x7811": {
"group": "led_matrix",
"key": "QK_LED_MATRIX_OFF",
"aliases": [
"LM_OFF"
]
},
"0x7812": {
"group": "led_matrix",
"key": "QK_LED_MATRIX_TOGGLE",
"aliases": [
"LM_TOGG"
]
},
"0x7813": {
"group": "led_matrix",
"key": "QK_LED_MATRIX_MODE_NEXT",
"aliases": [
"LM_NEXT"
]
},
"0x7814": {
"group": "led_matrix",
"key": "QK_LED_MATRIX_MODE_PREVIOUS",
"aliases": [
"LM_PREV"
]
},
"0x7815": {
"group": "led_matrix",
"key": "QK_LED_MATRIX_BRIGHTNESS_UP",
"aliases": [
"LM_BRIU"
]
},
"0x7816": {
"group": "led_matrix",
"key": "QK_LED_MATRIX_BRIGHTNESS_DOWN",
"aliases": [
"LM_BRID"
]
},
"0x7817": {
"group": "led_matrix",
"key": "QK_LED_MATRIX_SPEED_UP",
"aliases": [
"LM_SPDU"
]
},
"0x7818": {
"group": "led_matrix",
"key": "QK_LED_MATRIX_SPEED_DOWN",
"aliases": [
"LM_SPDD"
]
}
}
}

View File

@ -217,16 +217,17 @@ As mentioned earlier, the center of the keyboard by default is expected to be `{
## Keycodes :id=keycodes
All LED matrix keycodes are currently shared with the [Backlight feature](feature_backlight.md).
| Key | Aliases | Description |
|-------------------------|-----------|-------------------------------|
| `QK_BACKLIGHT_TOGGLE` | `BL_TOGG` | Toggle LED Matrix on or off |
| `QK_BACKLIGHT_STEP` | `BL_STEP` | Cycle through modes |
| `QK_BACKLIGHT_ON` | `BL_ON` | Turn on LED Matrix |
| `QK_BACKLIGHT_OFF` | `BL_OFF` | Turn off LED Matrix |
| `QK_BACKLIGHT_UP` | `BL_UP` | Increase the brightness level |
| `QK_BACKLIGHT_DOWN` | `BL_DOWN` | Decrease the brightness level |
|Key |Aliases |Description |
|-------------------------------|---------|-----------------------------------|
|`QK_LED_MATRIX_ON` |`LM_ON` |Turn on LED Matrix |
|`QK_LED_MATRIX_OFF` |`LM_OFF` |Turn off LED Matrix |
|`QK_LED_MATRIX_TOGGLE` |`LM_TOGG`|Toggle LED Matrix on or off |
|`QK_LED_MATRIX_MODE_NEXT` |`LM_NEXT`|Cycle through animations |
|`QK_LED_MATRIX_MODE_PREVIOUS` |`LM_PREV`|Cycle through animations in reverse|
|`QK_LED_MATRIX_BRIGHTNESS_UP` |`LM_BRIU`|Increase the brightness level |
|`QK_LED_MATRIX_BRIGHTNESS_DOWN`|`LM_BRID`|Decrease the brightness level |
|`QK_LED_MATRIX_SPEED_UP` |`LM_SPDU`|Increase the animation speed |
|`QK_LED_MATRIX_SPEED_DOWN` |`LM_SPDD`|Decrease the animation speed |
## LED Matrix Effects :id=led-matrix-effects

View File

@ -398,6 +398,22 @@ See also: [Leader Key](feature_leader_key.md)
|---------|------------------------|
|`QK_LEAD`|Begins a leader sequence|
## LED Matrix :id=led-matrix
See also: [LED Matrix](feature_led_matrix.md)
|Key |Aliases |Description |
|-------------------------------|---------|-----------------------------------|
|`QK_LED_MATRIX_ON` |`LM_ON` |Turn on LED Matrix |
|`QK_LED_MATRIX_OFF` |`LM_OFF` |Turn off LED Matrix |
|`QK_LED_MATRIX_TOGGLE` |`LM_TOGG`|Toggle LED Matrix on or off |
|`QK_LED_MATRIX_MODE_NEXT` |`LM_NEXT`|Cycle through animations |
|`QK_LED_MATRIX_MODE_PREVIOUS` |`LM_PREV`|Cycle through animations in reverse|
|`QK_LED_MATRIX_BRIGHTNESS_UP` |`LM_BRIU`|Increase the brightness level |
|`QK_LED_MATRIX_BRIGHTNESS_DOWN`|`LM_BRID`|Decrease the brightness level |
|`QK_LED_MATRIX_SPEED_UP` |`LM_SPDU`|Increase the animation speed |
|`QK_LED_MATRIX_SPEED_DOWN` |`LM_SPDD`|Decrease the animation speed |
## Magic Keycodes :id=magic-keycodes
See also: [Magic Keycodes](keycodes_magic.md)

View File

@ -627,6 +627,15 @@ enum qk_keycode_defines {
QK_BACKLIGHT_UP = 0x7804,
QK_BACKLIGHT_STEP = 0x7805,
QK_BACKLIGHT_TOGGLE_BREATHING = 0x7806,
QK_LED_MATRIX_ON = 0x7810,
QK_LED_MATRIX_OFF = 0x7811,
QK_LED_MATRIX_TOGGLE = 0x7812,
QK_LED_MATRIX_MODE_NEXT = 0x7813,
QK_LED_MATRIX_MODE_PREVIOUS = 0x7814,
QK_LED_MATRIX_BRIGHTNESS_UP = 0x7815,
QK_LED_MATRIX_BRIGHTNESS_DOWN = 0x7816,
QK_LED_MATRIX_SPEED_UP = 0x7817,
QK_LED_MATRIX_SPEED_DOWN = 0x7818,
RGB_TOG = 0x7820,
RGB_MODE_FORWARD = 0x7821,
RGB_MODE_REVERSE = 0x7822,
@ -1281,6 +1290,15 @@ enum qk_keycode_defines {
BL_UP = QK_BACKLIGHT_UP,
BL_STEP = QK_BACKLIGHT_STEP,
BL_BRTG = QK_BACKLIGHT_TOGGLE_BREATHING,
LM_ON = QK_LED_MATRIX_ON,
LM_OFF = QK_LED_MATRIX_OFF,
LM_TOGG = QK_LED_MATRIX_TOGGLE,
LM_NEXT = QK_LED_MATRIX_MODE_NEXT,
LM_PREV = QK_LED_MATRIX_MODE_PREVIOUS,
LM_BRIU = QK_LED_MATRIX_BRIGHTNESS_UP,
LM_BRID = QK_LED_MATRIX_BRIGHTNESS_DOWN,
LM_SPDU = QK_LED_MATRIX_SPEED_UP,
LM_SPDD = QK_LED_MATRIX_SPEED_DOWN,
RGB_MOD = RGB_MODE_FORWARD,
RGB_RMOD = RGB_MODE_REVERSE,
RGB_M_P = RGB_MODE_PLAIN,
@ -1416,6 +1434,7 @@ enum qk_keycode_defines {
#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_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_QUANTUM_KEYCODE(code) ((code) >= QK_BOOTLOADER && (code) <= QK_ALT_REPEAT_KEY)
#define IS_KB_KEYCODE(code) ((code) >= QK_KB_0 && (code) <= QK_KB_31)
@ -1438,6 +1457,7 @@ enum qk_keycode_defines {
#define STENO_KEYCODE_RANGE QK_STENO_BOLT ... QK_STENO_COMB_MAX
#define MACRO_KEYCODE_RANGE QK_MACRO_0 ... QK_MACRO_31
#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 QUANTUM_KEYCODE_RANGE QK_BOOTLOADER ... QK_ALT_REPEAT_KEY
#define KB_KEYCODE_RANGE QK_KB_0 ... QK_KB_31

View File

@ -569,6 +569,15 @@ std::map<uint16_t, std::string> KEYCODE_ID_TABLE = {
{QK_BACKLIGHT_UP, "QK_BACKLIGHT_UP"},
{QK_BACKLIGHT_STEP, "QK_BACKLIGHT_STEP"},
{QK_BACKLIGHT_TOGGLE_BREATHING, "QK_BACKLIGHT_TOGGLE_BREATHING"},
{QK_LED_MATRIX_ON, "QK_LED_MATRIX_ON"},
{QK_LED_MATRIX_OFF, "QK_LED_MATRIX_OFF"},
{QK_LED_MATRIX_TOGGLE, "QK_LED_MATRIX_TOGGLE"},
{QK_LED_MATRIX_MODE_NEXT, "QK_LED_MATRIX_MODE_NEXT"},
{QK_LED_MATRIX_MODE_PREVIOUS, "QK_LED_MATRIX_MODE_PREVIOUS"},
{QK_LED_MATRIX_BRIGHTNESS_UP, "QK_LED_MATRIX_BRIGHTNESS_UP"},
{QK_LED_MATRIX_BRIGHTNESS_DOWN, "QK_LED_MATRIX_BRIGHTNESS_DOWN"},
{QK_LED_MATRIX_SPEED_UP, "QK_LED_MATRIX_SPEED_UP"},
{QK_LED_MATRIX_SPEED_DOWN, "QK_LED_MATRIX_SPEED_DOWN"},
{RGB_TOG, "RGB_TOG"},
{RGB_MODE_FORWARD, "RGB_MODE_FORWARD"},
{RGB_MODE_REVERSE, "RGB_MODE_REVERSE"},