diff options
author | Jason Laqua <[email protected]> | 2020-06-18 02:07:34 -0500 |
---|---|---|
committer | GitHub <[email protected]> | 2020-06-18 08:07:34 +0100 |
commit | f7eb030e917a8fa360ad7cc7bb26d804cf4c5f6c (patch) | |
tree | 8415ddb70ed9fa1cfea2651a6ef950483648d851 /quantum/process_keycode/process_ucis.h | |
parent | aae1814319c4992471d074ed18b8b7b4842b0a66 (diff) | |
download | qmk_firmware-f7eb030e917a8fa360ad7cc7bb26d804cf4c5f6c.tar.gz qmk_firmware-f7eb030e917a8fa360ad7cc7bb26d804cf4c5f6c.zip |
Standardize how unicode is processed (fixes #8768) (#8770)
Co-authored-by: Konstantin Đorđević <[email protected]>
Diffstat (limited to 'quantum/process_keycode/process_ucis.h')
-rw-r--r-- | quantum/process_keycode/process_ucis.h | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/quantum/process_keycode/process_ucis.h b/quantum/process_keycode/process_ucis.h index 0f93a198bb..a667430bda 100644 --- a/quantum/process_keycode/process_ucis.h +++ b/quantum/process_keycode/process_ucis.h @@ -22,10 +22,13 @@ #ifndef UCIS_MAX_SYMBOL_LENGTH # define UCIS_MAX_SYMBOL_LENGTH 32 #endif +#ifndef UCIS_MAX_CODE_POINTS +# define UCIS_MAX_CODE_POINTS 3 +#endif typedef struct { - char *symbol; - char *code; + char * symbol; + uint32_t code_points[UCIS_MAX_CODE_POINTS]; } qk_ucis_symbol_t; typedef struct { @@ -36,12 +39,17 @@ typedef struct { extern qk_ucis_state_t qk_ucis_state; -#define UCIS_TABLE(...) \ - { \ - __VA_ARGS__, { NULL, NULL } \ +// clang-format off + +#define UCIS_TABLE(...) \ + { \ + __VA_ARGS__, \ + { NULL, {} } \ } -#define UCIS_SYM(name, code) \ - { name, #code } +#define UCIS_SYM(name, ...) \ + { name, {__VA_ARGS__} } + +// clang-format on extern const qk_ucis_symbol_t ucis_symbol_table[]; @@ -49,5 +57,7 @@ void qk_ucis_start(void); void qk_ucis_start_user(void); void qk_ucis_symbol_fallback(void); void qk_ucis_success(uint8_t symbol_index); -void register_ucis(const char *hex); + +void register_ucis(const uint32_t *code_points); + bool process_ucis(uint16_t keycode, keyrecord_t *record); |