diff options
author | Gergely Nagy <algernon@madhouse-project.org> | 2016-08-14 14:34:52 +0200 |
---|---|---|
committer | Gergely Nagy <algernon@madhouse-project.org> | 2016-08-15 10:08:53 +0200 |
commit | a312cbf712764277e0dbbbb99410c2f6fc6c7484 (patch) | |
tree | 9f78d4f9d041304fea69e78f68bfd52f972aecfb /quantum/process_keycode/process_unicode.c | |
parent | 234dd276cf03be6fd6961473e9d9c8f35deec682 (diff) |
process_unicode: Use uint32_t for UCIS purposes
Use a single uint32_t to store the unicode of a symbol, instead of an
array of uint16_ts.
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
Diffstat (limited to 'quantum/process_keycode/process_unicode.c')
-rw-r--r-- | quantum/process_keycode/process_unicode.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/quantum/process_keycode/process_unicode.c b/quantum/process_keycode/process_unicode.c index c474483e7f..698cc3c025 100644 --- a/quantum/process_keycode/process_unicode.c +++ b/quantum/process_keycode/process_unicode.c @@ -60,6 +60,14 @@ void register_hex(uint16_t hex) { } } +void register_hex32(uint32_t hex) { + for(int i = 7; i >= 0; i--) { + uint8_t digit = ((hex >> (i*8)) & 0xF); + register_code(hex_to_keycode(digit)); + unregister_code(hex_to_keycode(digit)); + } +} + bool process_unicode(uint16_t keycode, keyrecord_t *record) { if (keycode > QK_UNICODE && record->event.pressed) { uint16_t unicode = keycode & 0x7FFF; @@ -156,9 +164,7 @@ bool process_ucis (uint16_t keycode, keyrecord_t *record) { for (i = 0; ucis_symbol_table[i].symbol; i++) { if (is_uni_seq (ucis_symbol_table[i].symbol)) { symbol_found = true; - for (uint8_t j = 0; ucis_symbol_table[i].codes[j]; j++) { - register_hex(ucis_symbol_table[i].codes[j]); - } + register_hex32(ucis_symbol_table[i].code); break; } } |