diff options
Diffstat (limited to 'docs/faq_debug.md')
-rw-r--r-- | docs/faq_debug.md | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/docs/faq_debug.md b/docs/faq_debug.md index 35a4160e27..269049afb8 100644 --- a/docs/faq_debug.md +++ b/docs/faq_debug.md @@ -77,6 +77,17 @@ KL: kc: 172, col: 2, row: 0, pressed: 1, time: 16303, int: 0, count: 0 KL: kc: 172, col: 2, row: 0, pressed: 0, time: 16411, int: 0, count: 0 ``` +### Which keycode is this keypress? + +Keycodes are logged in the example above as numerical codes, which may be difficult to interpret. For more readable logging, add `KEYCODE_STRING_ENABLE = yes` in your `rules.mk` and use `get_keycode_string(kc)`. For example: + +```c +uprintf("kc: %s\n", get_keycode_string(keycode)); +``` + +This logs the keycode as a human-readable string like "`LT(2,KC_D)`" rather than a numerical code like "`0x4207`." See the [Keycode String](unit_testing#keycode-string) section of the Unit Testing page for more information. + + ### How long did it take to scan for a keypress? When testing performance issues, it can be useful to know the frequency at which the switch matrix is being scanned. To enable logging for this scenario, add the following code to your keymaps `config.h` |