]> git.donarmstrong.com Git - qmk_firmware.git/blobdiff - quantum/process_keycode/process_unicode.h
process_unicode: Add a way to enter unicode symbols by name
[qmk_firmware.git] / quantum / process_keycode / process_unicode.h
index ca17f8f66999f66452ea262cb831e81682776306..372ea2f0df97ae9fba1fd63a0f2678f641fafec7 100644 (file)
@@ -9,9 +9,39 @@
 #define UC_BSD 3
 
 void set_unicode_input_mode(uint8_t os_target);
+void unicode_input_start(void);
+void unicode_input_finish(void);
+void register_hex(uint16_t hex);
 
 bool process_unicode(uint16_t keycode, keyrecord_t *record);
 
+#ifdef UCIS_ENABLE
+#ifndef UCIS_MAX_SYMBOL_LENGTH
+#define UCIS_MAX_SYMBOL_LENGTH 32
+#endif
+
+typedef struct {
+  char *symbol;
+  uint16_t codes[4];
+} qk_ucis_symbol_t;
+
+struct {
+  uint8_t count;
+  uint16_t codes[UCIS_MAX_SYMBOL_LENGTH];
+  bool in_progress:1;
+} qk_ucis_state;
+
+#define UCIS_TABLE(...) {__VA_ARGS__, {NULL, {}}}
+#define UCIS_SYM(name, ...) {name, {__VA_ARGS__, 0}}
+
+extern const qk_ucis_symbol_t ucis_symbol_table[];
+
+void qk_ucis_start(void);
+void qk_ucis_symbol_fallback (void);
+bool process_record_ucis (uint16_t keycode, keyrecord_t *record);
+
+#endif
+
 #define UC_BSPC        UC(0x0008)
 
 #define UC_SPC UC(0x0020)
@@ -119,4 +149,4 @@ bool process_unicode(uint16_t keycode, keyrecord_t *record);
 #define UC_TILD        UC(0x007E)
 #define UC_DEL UC(0x007F)
 
-#endif
\ No newline at end of file
+#endif