qmk_firmware/quantum
Pascal Getreuer 3484f0a0df
[Core] get_keycode_string(): function to format keycodes as strings, for more readable debug logging. (#24787)
* keycode_string(): Format keycodes as strings.

This adds the `keycode_string()` function described in
https://getreuer.info/posts/keyboards/keycode-string/index.html
as a core feature.

* Fix formatting.

* keycode_string review revisions.

* Rename keycode_string() -> get_keycode_string() for consistency with
  existing string utils like get_u8_str().

* Revise custom keycode names with separate _user and _kb tables.

* Correct indent in builddefs/generic_features.mk.

Co-authored-by: Ryan <fauxpark@gmail.com>

* Add KC_NUHS, KC_NUBS, and KC_CAPS.

* Fix linking error with custom names.

* Attempt at simplifying interface.

* Formatting fix.

* Several fixes and revisions.

* Don't use PSTR in KEYCODE_STRING_NAME, since this fails to build on
  AVR. Store custom names in RAM.
* Revise the internal table of common keycode names to use its own
  storage representation, still in PROGMEM, and now more efficiently
  stored flat in 8 bytes per entry.
* Support Swap Hands keycodes and a few other keycodes.

* Revert "Formatting fix."

This reverts commit 2a2771068c7ee545ffac4103aa07e847a9ec3816.

* Revert "Attempt at simplifying interface."

This reverts commit 8eaf67de76e75bc92d106a8b0decc893fbc65fa5.

* Simplify custom names API by sigprof's suggestion.

* Support more keycodes.

* Add QK_LOCK keycode.
* Add Secure keycodes.
* Add Joystick keycodes.
* Add Programmable Button keycodes.
* Add macro MC_ keycodes.
* For remaining keys in known code ranges, stringify them as
  "QK_<feature>+<number>". For instance, "QK_MIDI+7".

* Bug fix and a few improvements.

* Fix missing right-hand bit when displaying 5-bit mods numerically.
* Support KC_HYPR, KC_MEH, HYPR_T(kc), MEH_T(kc).
* Exclude one-shot keycodes when NO_ACTION_ONESHOT is defined.

---------

Co-authored-by: Ryan <fauxpark@gmail.com>
2025-03-19 20:45:56 +01:00
..
audio
backlight
bootmagic
debounce
encoder/tests
keymap_extras
led_matrix
logging
midi
os_detection/tests Merge remote-tracking branch 'origin/master' into develop 2025-01-29 19:28:06 +00:00
painter Created SH1107 driver for quantum painter (#24724) 2025-02-17 08:41:07 +11:00
pointing_device
process_keycode
rgb_matrix Add EOL to non-keyboard files (#24990) 2025-03-06 23:17:51 +00:00
rgblight
send_string
sequencer
split_common Add EOL to non-keyboard files (#24990) 2025-03-06 23:17:51 +00:00
unicode
wear_leveling Add EOL to non-keyboard files (#24990) 2025-03-06 23:17:51 +00:00
action.c Retro Tapping Re-Write; Key Roll Fix (#23641) 2025-02-16 20:50:42 +11:00
action.h Community modules (#24848) 2025-02-26 22:25:41 +11:00
action_code.h
action_layer.c
action_layer.h
action_tapping.c [Bug][Core] Fix for Chordal Hold: stuck mods when mod-taps are pressed in a stuttered sequence. (#24878) 2025-01-30 06:17:54 +11:00
action_tapping.h
action_util.c
action_util.h
basic_profiling.h
bits.h
bitwise.c
bitwise.h
caps_word.c
caps_word.h
color.c
color.h
command.c
command.h
crc.c
crc.h
debounce.h
deferred_exec.c
deferred_exec.h
digitizer.c
digitizer.h
dip_switch.c
dip_switch.h
dynamic_keymap.c
dynamic_keymap.h
eeconfig.c
eeconfig.h
encoder.c
encoder.h
haptic.c
haptic.h
joystick.c
joystick.h
keyboard.c Implement battery level interface (#24666) 2025-02-28 16:46:14 +11:00
keyboard.h
keycode.h
keycode_config.c
keycode_config.h
keycode_string.c [Core] get_keycode_string(): function to format keycodes as strings, for more readable debug logging. (#24787) 2025-03-19 20:45:56 +01:00
keycode_string.h [Core] get_keycode_string(): function to format keycodes as strings, for more readable debug logging. (#24787) 2025-03-19 20:45:56 +01:00
keycodes.h Community modules (#24848) 2025-02-26 22:25:41 +11:00
keymap_common.c
keymap_common.h
keymap_introspection.c Community modules (#24848) 2025-02-26 22:25:41 +11:00
keymap_introspection.h
layer_lock.c
layer_lock.h
leader.c
leader.h
led.c
led.h
led_tables.c
led_tables.h
main.c
matrix.c
matrix.h
matrix_common.c
modifiers.h
mousekey.c
mousekey.h
os_detection.c Community modules (#24848) 2025-02-26 22:25:41 +11:00
os_detection.h
pointing_device_internal.h
programmable_button.c
programmable_button.h
quantum.c Community modules (#24848) 2025-02-26 22:25:41 +11:00
quantum.h [Core] get_keycode_string(): function to format keycodes as strings, for more readable debug logging. (#24787) 2025-03-19 20:45:56 +01:00
quantum_keycodes.h
quantum_keycodes_legacy.h
raw_hid.h
repeat_key.c
repeat_key.h
ring_buffer.h
secure.c
secure.h
steno_keycodes.h
sync_timer.c
sync_timer.h
tri_layer.c
tri_layer.h
util.h
variable_trace.c
variable_trace.h
via.c
via.h Add EOL to non-keyboard files (#24990) 2025-03-06 23:17:51 +00:00
virtser.h
wpm.c
wpm.h