diff options
Diffstat (limited to 'quantum/process_keycode/process_unicode.c')
-rw-r--r-- | quantum/process_keycode/process_unicode.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/quantum/process_keycode/process_unicode.c b/quantum/process_keycode/process_unicode.c index cd3a610b4..f42f25538 100644 --- a/quantum/process_keycode/process_unicode.c +++ b/quantum/process_keycode/process_unicode.c | |||
@@ -1,6 +1,7 @@ | |||
1 | #include "process_unicode.h" | 1 | #include "process_unicode.h" |
2 | 2 | ||
3 | static uint8_t input_mode; | 3 | static uint8_t input_mode; |
4 | static uint8_t first_flag = 0; | ||
4 | 5 | ||
5 | __attribute__((weak)) | 6 | __attribute__((weak)) |
6 | uint16_t hex_to_keycode(uint8_t hex) | 7 | uint16_t hex_to_keycode(uint8_t hex) |
@@ -17,6 +18,7 @@ uint16_t hex_to_keycode(uint8_t hex) | |||
17 | void set_unicode_input_mode(uint8_t os_target) | 18 | void set_unicode_input_mode(uint8_t os_target) |
18 | { | 19 | { |
19 | input_mode = os_target; | 20 | input_mode = os_target; |
21 | eeprom_update_byte(EECONFIG_UNICODEMODE, os_target); | ||
20 | } | 22 | } |
21 | 23 | ||
22 | uint8_t get_unicode_input_mode(void) { | 24 | uint8_t get_unicode_input_mode(void) { |
@@ -75,6 +77,10 @@ void register_hex(uint16_t hex) { | |||
75 | 77 | ||
76 | bool process_unicode(uint16_t keycode, keyrecord_t *record) { | 78 | bool process_unicode(uint16_t keycode, keyrecord_t *record) { |
77 | if (keycode > QK_UNICODE && record->event.pressed) { | 79 | if (keycode > QK_UNICODE && record->event.pressed) { |
80 | if (first_flag == 0) { | ||
81 | set_unicode_input_mode(eeprom_read_byte(EECONFIG_UNICODEMODE)); | ||
82 | first_flag = 1; | ||
83 | } | ||
78 | uint16_t unicode = keycode & 0x7FFF; | 84 | uint16_t unicode = keycode & 0x7FFF; |
79 | unicode_input_start(); | 85 | unicode_input_start(); |
80 | register_hex(unicode); | 86 | register_hex(unicode); |