diff options
| author | nielsenz <nielsen.zac@gmail.com> | 2017-03-30 19:15:43 -0700 |
|---|---|---|
| committer | nielsenz <nielsen.zac@gmail.com> | 2017-03-30 19:15:43 -0700 |
| commit | 7e54332890f4c376314f942574c6183c87a6e9c8 (patch) | |
| tree | 1332d84f9c7f8bda515ad26af22601b8273cbbfc /quantum/process_keycode/process_unicode_common.c | |
| parent | b9225a28f253e1ec33b8c96798bfef4b8cc0918d (diff) | |
| download | qmk_firmware-7e54332890f4c376314f942574c6183c87a6e9c8.tar.gz qmk_firmware-7e54332890f4c376314f942574c6183c87a6e9c8.zip | |
Pulling and pushing troubles
Diffstat (limited to 'quantum/process_keycode/process_unicode_common.c')
| -rw-r--r-- | quantum/process_keycode/process_unicode_common.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/quantum/process_keycode/process_unicode_common.c b/quantum/process_keycode/process_unicode_common.c index 6012b4f07..b4d4231db 100644 --- a/quantum/process_keycode/process_unicode_common.c +++ b/quantum/process_keycode/process_unicode_common.c | |||
| @@ -16,11 +16,14 @@ | |||
| 16 | 16 | ||
| 17 | #include "process_unicode_common.h" | 17 | #include "process_unicode_common.h" |
| 18 | 18 | ||
| 19 | static uint8_t input_mode; | ||
| 20 | static uint8_t first_flag = 0; | ||
| 19 | uint8_t mods; | 21 | uint8_t mods; |
| 20 | 22 | ||
| 21 | void set_unicode_input_mode(uint8_t os_target) | 23 | void set_unicode_input_mode(uint8_t os_target) |
| 22 | { | 24 | { |
| 23 | input_mode = os_target; | 25 | input_mode = os_target; |
| 26 | eeprom_update_byte(EECONFIG_UNICODEMODE, os_target); | ||
| 24 | } | 27 | } |
| 25 | 28 | ||
| 26 | uint8_t get_unicode_input_mode(void) { | 29 | uint8_t get_unicode_input_mode(void) { |
| @@ -92,6 +95,18 @@ void unicode_input_finish (void) { | |||
| 92 | if (mods & MOD_BIT(KC_RGUI)) register_code(KC_RGUI); | 95 | if (mods & MOD_BIT(KC_RGUI)) register_code(KC_RGUI); |
| 93 | } | 96 | } |
| 94 | 97 | ||
| 98 | __attribute__((weak)) | ||
| 99 | uint16_t hex_to_keycode(uint8_t hex) | ||
| 100 | { | ||
| 101 | if (hex == 0x0) { | ||
| 102 | return KC_0; | ||
| 103 | } else if (hex < 0xA) { | ||
| 104 | return KC_1 + (hex - 0x1); | ||
| 105 | } else { | ||
| 106 | return KC_A + (hex - 0xA); | ||
| 107 | } | ||
| 108 | } | ||
| 109 | |||
| 95 | void register_hex(uint16_t hex) { | 110 | void register_hex(uint16_t hex) { |
| 96 | for(int i = 3; i >= 0; i--) { | 111 | for(int i = 3; i >= 0; i--) { |
| 97 | uint8_t digit = ((hex >> (i*4)) & 0xF); | 112 | uint8_t digit = ((hex >> (i*4)) & 0xF); |
