Skip to content

Commit

Permalink
Formatting fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
getreuer committed Jan 22, 2025
1 parent 8eaf67d commit 2a27710
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 29 deletions.
30 changes: 2 additions & 28 deletions quantum/keycode_string.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,36 +69,10 @@ typedef struct keycode_string_name_t {
uint16_t keycode;
const char* name;
} keycode_string_name_t;
// typedef struct keycode_string_name_t keycode_string_name_t;

/**
* @brief Names for additional keycodes for `get_keycode_string()`.
*
* @note The table *must* end with `KEYCODE_STRING_NAMES_END`.
*
* Define the `custom_keycode_names` table in your keymap.c to add names for
* additional keycodes to `keycode_string()`. This table may also be used to
* override how `keycode_string()` formats a keycode. For example, supposing
* keymap.c defines `MYMACRO1` and `MYMACRO2` as custom keycodes:
*
* const keycode_string_name_t keycode_string_names_user[] = {
* KEYCODE_STRING_NAME(MYMACRO1),
* KEYCODE_STRING_NAME(MYMACRO2),
* KEYCODE_STRING_NAME(KC_EXLM),
* KEYCODE_STRING_NAMES_END // End of table sentinel.
* };
*
* The above defines names for `MYMACRO1` and `MYMACRO2`, and overrides
* `KC_EXLM` to format as "KC_EXLM" instead of the default "S(KC_1)".
*/
// extern const keycode_string_name_t* keycode_string_names_user;
/** Same as `keycode_string_names_user`, but for use at the keyboard level. */
// extern const keycode_string_name_t* keycode_string_names_kb;

/** Helper to define a keycode_string_name_t. */
# define KEYCODE_STRING_NAME(kc) {(kc), PSTR(#kc)}
/** Makes end-of-table sentinel for a table of keycode_string_name_t. */
# define KEYCODE_STRING_NAMES_END {0, NULL}
# define KEYCODE_STRING_NAME(kc) \
{ (kc), PSTR(#kc) }

#else

Expand Down
1 change: 0 additions & 1 deletion tests/keycode_string/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,3 @@

#define KEYCODE_STRING_NAMES_USER
#define KEYCODE_STRING_NAMES_KB

0 comments on commit 2a27710

Please sign in to comment.