aboutsummaryrefslogtreecommitdiffstats
path: root/quantum/process_keycode/process_ucis.h
diff options
context:
space:
mode:
authorJason Laqua <jlaqua118@gmail.com>2020-06-18 02:07:34 -0500
committerGitHub <noreply@github.com>2020-06-18 08:07:34 +0100
commitf7eb030e917a8fa360ad7cc7bb26d804cf4c5f6c (patch)
tree8415ddb70ed9fa1cfea2651a6ef950483648d851 /quantum/process_keycode/process_ucis.h
parentaae1814319c4992471d074ed18b8b7b4842b0a66 (diff)
downloadfirmware-f7eb030e917a8fa360ad7cc7bb26d804cf4c5f6c.tar.gz
firmware-f7eb030e917a8fa360ad7cc7bb26d804cf4c5f6c.tar.bz2
firmware-f7eb030e917a8fa360ad7cc7bb26d804cf4c5f6c.zip
Standardize how unicode is processed (fixes #8768) (#8770)
Co-authored-by: Konstantin Đorđević <vomindoraan@gmail.com>
Diffstat (limited to 'quantum/process_keycode/process_ucis.h')
-rw-r--r--quantum/process_keycode/process_ucis.h26
1 files changed, 18 insertions, 8 deletions
diff --git a/quantum/process_keycode/process_ucis.h b/quantum/process_keycode/process_ucis.h
index 0f93a198b..a667430bd 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);