aboutsummaryrefslogtreecommitdiff
path: root/quantum/process_keycode
diff options
context:
space:
mode:
authorPriyadi Iman Nurcahyo <priyadi@priyadi.net>2017-02-23 18:10:00 +0700
committerPriyadi Iman Nurcahyo <priyadi@priyadi.net>2017-02-23 18:10:00 +0700
commit296b927e7740f23fc91f84ebac6ca0c85c654028 (patch)
treea755834b66c547de127be4e434e6670d8f0c40da /quantum/process_keycode
parent1ac5dc9e524444ef98cfab1d9822151a6bfb9621 (diff)
downloadqmk_firmware-296b927e7740f23fc91f84ebac6ca0c85c654028.tar.gz
qmk_firmware-296b927e7740f23fc91f84ebac6ca0c85c654028.zip
Fix UNICODE_MAP input_mode problem
Diffstat (limited to 'quantum/process_keycode')
-rw-r--r--quantum/process_keycode/process_unicodemap.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/quantum/process_keycode/process_unicodemap.c b/quantum/process_keycode/process_unicodemap.c
index 37f10df86..68a593a18 100644
--- a/quantum/process_keycode/process_unicodemap.c
+++ b/quantum/process_keycode/process_unicodemap.c
@@ -1,25 +1,26 @@
1#include "process_unicodemap.h" 1#include "process_unicodemap.h"
2#include "process_unicode_common.h"
2 3
3__attribute__((weak)) 4__attribute__((weak))
4const uint32_t PROGMEM unicode_map[] = { 5const uint32_t PROGMEM unicode_map[] = {
5}; 6};
6 7
7void register_hex32(uint32_t hex) { 8void register_hex32(uint32_t hex) {
8 uint8_t onzerostart = 1; 9 bool onzerostart = true;
9 for(int i = 7; i >= 0; i--) { 10 for(int i = 7; i >= 0; i--) {
10 if (i <= 3) { 11 if (i <= 3) {
11 onzerostart = 0; 12 onzerostart = false;
12 } 13 }
13 uint8_t digit = ((hex >> (i*4)) & 0xF); 14 uint8_t digit = ((hex >> (i*4)) & 0xF);
14 if (digit == 0) { 15 if (digit == 0) {
15 if (onzerostart == 0) { 16 if (!onzerostart) {
16 register_code(hex_to_keycode(digit)); 17 register_code(hex_to_keycode(digit));
17 unregister_code(hex_to_keycode(digit)); 18 unregister_code(hex_to_keycode(digit));
18 } 19 }
19 } else { 20 } else {
20 register_code(hex_to_keycode(digit)); 21 register_code(hex_to_keycode(digit));
21 unregister_code(hex_to_keycode(digit)); 22 unregister_code(hex_to_keycode(digit));
22 onzerostart = 0; 23 onzerostart = false;
23 } 24 }
24 } 25 }
25} 26}
@@ -28,6 +29,7 @@ __attribute__((weak))
28void unicode_map_input_error() {} 29void unicode_map_input_error() {}
29 30
30bool process_unicode_map(uint16_t keycode, keyrecord_t *record) { 31bool process_unicode_map(uint16_t keycode, keyrecord_t *record) {
32 uint8_t input_mode = get_unicode_input_mode();
31 if ((keycode & QK_UNICODE_MAP) == QK_UNICODE_MAP && record->event.pressed) { 33 if ((keycode & QK_UNICODE_MAP) == QK_UNICODE_MAP && record->event.pressed) {
32 const uint32_t* map = unicode_map; 34 const uint32_t* map = unicode_map;
33 uint16_t index = keycode - QK_UNICODE_MAP; 35 uint16_t index = keycode - QK_UNICODE_MAP;