aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--quantum/process_keycode/process_unicode.c6
-rw-r--r--tmk_core/common/eeconfig.h1
2 files changed, 7 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
3static uint8_t input_mode; 3static uint8_t input_mode;
4static uint8_t first_flag = 0;
4 5
5__attribute__((weak)) 6__attribute__((weak))
6uint16_t hex_to_keycode(uint8_t hex) 7uint16_t hex_to_keycode(uint8_t hex)
@@ -17,6 +18,7 @@ uint16_t hex_to_keycode(uint8_t hex)
17void set_unicode_input_mode(uint8_t os_target) 18void 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
22uint8_t get_unicode_input_mode(void) { 24uint8_t get_unicode_input_mode(void) {
@@ -75,6 +77,10 @@ void register_hex(uint16_t hex) {
75 77
76bool process_unicode(uint16_t keycode, keyrecord_t *record) { 78bool 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);
diff --git a/tmk_core/common/eeconfig.h b/tmk_core/common/eeconfig.h
index d8caa346f..280dc7ab6 100644
--- a/tmk_core/common/eeconfig.h
+++ b/tmk_core/common/eeconfig.h
@@ -33,6 +33,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
33#define EECONFIG_BACKLIGHT (uint8_t *)6 33#define EECONFIG_BACKLIGHT (uint8_t *)6
34#define EECONFIG_AUDIO (uint8_t *)7 34#define EECONFIG_AUDIO (uint8_t *)7
35#define EECONFIG_RGBLIGHT (uint32_t *)8 35#define EECONFIG_RGBLIGHT (uint32_t *)8
36#define EECONFIG_UNICODEMODE (uint8_t *)12
36 37
37 38
38/* debug bit */ 39/* debug bit */