diff options
author | Jack Humbert <jack.humb@gmail.com> | 2017-02-15 23:20:35 -0500 |
---|---|---|
committer | Jack Humbert <jack.humb@gmail.com> | 2017-02-15 23:20:35 -0500 |
commit | 58823b4e0324f5b2861fc5a0f74f6faa3673f5dc (patch) | |
tree | 04e3074214a8415a8b0404477561d990a9ce205c /quantum/process_keycode/process_unicode_common.c | |
parent | f89499e255afbe5f8adeae5e71367f3d358af527 (diff) | |
download | qmk_firmware-58823b4e0324f5b2861fc5a0f74f6faa3673f5dc.tar.gz qmk_firmware-58823b4e0324f5b2861fc5a0f74f6faa3673f5dc.zip |
fix weirdness with arm and mods
Diffstat (limited to 'quantum/process_keycode/process_unicode_common.c')
-rw-r--r-- | quantum/process_keycode/process_unicode_common.c | 38 |
1 files changed, 20 insertions, 18 deletions
diff --git a/quantum/process_keycode/process_unicode_common.c b/quantum/process_keycode/process_unicode_common.c index d924c364a..31bc3b7ab 100644 --- a/quantum/process_keycode/process_unicode_common.c +++ b/quantum/process_keycode/process_unicode_common.c | |||
@@ -1,5 +1,7 @@ | |||
1 | #include "process_unicode_common.h" | 1 | #include "process_unicode_common.h" |
2 | 2 | ||
3 | uint8_t mods; | ||
4 | |||
3 | void set_unicode_input_mode(uint8_t os_target) | 5 | void set_unicode_input_mode(uint8_t os_target) |
4 | { | 6 | { |
5 | input_mode = os_target; | 7 | input_mode = os_target; |
@@ -12,17 +14,17 @@ uint8_t get_unicode_input_mode(void) { | |||
12 | __attribute__((weak)) | 14 | __attribute__((weak)) |
13 | void unicode_input_start (void) { | 15 | void unicode_input_start (void) { |
14 | // save current mods | 16 | // save current mods |
15 | unicode_mods = keyboard_report->mods; | 17 | mods = keyboard_report->mods; |
16 | 18 | ||
17 | // unregister all mods to start from clean state | 19 | // unregister all mods to start from clean state |
18 | if (unicode_mods & MOD_BIT(KC_LSFT)) unregister_code(KC_LSFT); | 20 | if (mods & MOD_BIT(KC_LSFT)) unregister_code(KC_LSFT); |
19 | if (unicode_mods & MOD_BIT(KC_RSFT)) unregister_code(KC_RSFT); | 21 | if (mods & MOD_BIT(KC_RSFT)) unregister_code(KC_RSFT); |
20 | if (unicode_mods & MOD_BIT(KC_LCTL)) unregister_code(KC_LCTL); | 22 | if (mods & MOD_BIT(KC_LCTL)) unregister_code(KC_LCTL); |
21 | if (unicode_mods & MOD_BIT(KC_RCTL)) unregister_code(KC_RCTL); | 23 | if (mods & MOD_BIT(KC_RCTL)) unregister_code(KC_RCTL); |
22 | if (unicode_mods & MOD_BIT(KC_LALT)) unregister_code(KC_LALT); | 24 | if (mods & MOD_BIT(KC_LALT)) unregister_code(KC_LALT); |
23 | if (unicode_mods & MOD_BIT(KC_RALT)) unregister_code(KC_RALT); | 25 | if (mods & MOD_BIT(KC_RALT)) unregister_code(KC_RALT); |
24 | if (unicode_mods & MOD_BIT(KC_LGUI)) unregister_code(KC_LGUI); | 26 | if (mods & MOD_BIT(KC_LGUI)) unregister_code(KC_LGUI); |
25 | if (unicode_mods & MOD_BIT(KC_RGUI)) unregister_code(KC_RGUI); | 27 | if (mods & MOD_BIT(KC_RGUI)) unregister_code(KC_RGUI); |
26 | 28 | ||
27 | switch(input_mode) { | 29 | switch(input_mode) { |
28 | case UC_OSX: | 30 | case UC_OSX: |
@@ -63,15 +65,15 @@ void unicode_input_finish (void) { | |||
63 | break; | 65 | break; |
64 | } | 66 | } |
65 | 67 | ||
66 | // reregister previously set unicode_mods | 68 | // reregister previously set mods |
67 | if (unicode_mods & MOD_BIT(KC_LSFT)) register_code(KC_LSFT); | 69 | if (mods & MOD_BIT(KC_LSFT)) register_code(KC_LSFT); |
68 | if (unicode_mods & MOD_BIT(KC_RSFT)) register_code(KC_RSFT); | 70 | if (mods & MOD_BIT(KC_RSFT)) register_code(KC_RSFT); |
69 | if (unicode_mods & MOD_BIT(KC_LCTL)) register_code(KC_LCTL); | 71 | if (mods & MOD_BIT(KC_LCTL)) register_code(KC_LCTL); |
70 | if (unicode_mods & MOD_BIT(KC_RCTL)) register_code(KC_RCTL); | 72 | if (mods & MOD_BIT(KC_RCTL)) register_code(KC_RCTL); |
71 | if (unicode_mods & MOD_BIT(KC_LALT)) register_code(KC_LALT); | 73 | if (mods & MOD_BIT(KC_LALT)) register_code(KC_LALT); |
72 | if (unicode_mods & MOD_BIT(KC_RALT)) register_code(KC_RALT); | 74 | if (mods & MOD_BIT(KC_RALT)) register_code(KC_RALT); |
73 | if (unicode_mods & MOD_BIT(KC_LGUI)) register_code(KC_LGUI); | 75 | if (mods & MOD_BIT(KC_LGUI)) register_code(KC_LGUI); |
74 | if (unicode_mods & MOD_BIT(KC_RGUI)) register_code(KC_RGUI); | 76 | if (mods & MOD_BIT(KC_RGUI)) register_code(KC_RGUI); |
75 | } | 77 | } |
76 | 78 | ||
77 | void register_hex(uint16_t hex) { | 79 | void register_hex(uint16_t hex) { |