mirror of
https://github.com/qmk/qmk_firmware.git
synced 2026-09-27 04:19:11 +02:00
Attempt at simplifying interface.
This commit is contained in:
@@ -75,18 +75,22 @@ Use the result of `get_keycode_string()` immediately. Subsequent invocations reu
|
||||
|
||||
Many common QMK keycodes are recognized by `get_keycode_string()`, but not all. These include some common basic keycodes, layer switch keycodes, mod-taps, one-shot keycodes, tap dance keycodes, and Unicode keycodes. As a fallback, an unrecognized keycode is written as a hex number.
|
||||
|
||||
Optionally, `keycode_string_names_user` may be defined to add names for additional keycodes. For example, supposing keymap.c defines `MYMACRO1` and `MYMACRO2` as custom keycodes, the following adds their names:
|
||||
Optionally, names for additional keycodes may be defined. To do this, define `KEYCODE_STRING_NAMES_USER` in config.h:
|
||||
|
||||
```c
|
||||
const keycode_string_name_t *keycode_string_names_user =
|
||||
(keycode_string_name_t []){
|
||||
#define KEYCODE_STRING_NAMES_USER
|
||||
```
|
||||
|
||||
Then define `keycode_string_names_user` with the names for the additional keycodes. For example, supposing keymap.c defines `MYMACRO1` and `MYMACRO2` as custom keycodes, the following adds their names:
|
||||
|
||||
```c
|
||||
const keycode_string_name_t keycode_string_names_user[] = {
|
||||
KEYCODE_STRING_NAME(MYMACRO1),
|
||||
KEYCODE_STRING_NAME(MYMACRO2),
|
||||
KEYCODE_STRING_NAMES_END // End of table sentinel.
|
||||
};
|
||||
```
|
||||
|
||||
Similarly, `keycode_string_names_kb` may be defined to add names at the keyboard level.
|
||||
Similarly at the keyboard level, names for additional keycodes may be added by defining `KEYCODE_STRING_NAMES_KB` in config.h and defining keycode names in `keycode_string_names_kb`.
|
||||
|
||||
# Tracing Variables {#tracing-variables}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user