diff options
author | Joshua Diamond <josh@windowoffire.com> | 2020-12-22 12:23:09 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-22 18:23:09 +0100 |
commit | 54e2bf3edefb670ede2c2c3934dc732264ac6381 (patch) | |
tree | 86ab2c2abe08c4a2e153ddf41d3be30ebf8bbbb4 /quantum/process_keycode | |
parent | 94535730809d3fb9b466b221b935f27898a17887 (diff) | |
download | qmk_firmware-54e2bf3edefb670ede2c2c3934dc732264ac6381.tar.gz qmk_firmware-54e2bf3edefb670ede2c2c3934dc732264ac6381.zip |
Fix Issue #9533 - Delayed shift state handling (#11220)
Co-authored-by: Ryan <fauxpark@gmail.com>
Diffstat (limited to 'quantum/process_keycode')
-rw-r--r-- | quantum/process_keycode/process_unicode_common.h | 1 | ||||
-rw-r--r-- | quantum/process_keycode/process_unicodemap.c | 9 |
2 files changed, 7 insertions, 3 deletions
diff --git a/quantum/process_keycode/process_unicode_common.h b/quantum/process_keycode/process_unicode_common.h index 3082fbb5f..c10e171ec 100644 --- a/quantum/process_keycode/process_unicode_common.h +++ b/quantum/process_keycode/process_unicode_common.h | |||
@@ -75,7 +75,6 @@ typedef union { | |||
75 | } unicode_config_t; | 75 | } unicode_config_t; |
76 | 76 | ||
77 | extern unicode_config_t unicode_config; | 77 | extern unicode_config_t unicode_config; |
78 | extern uint8_t unicode_saved_mods; | ||
79 | 78 | ||
80 | void unicode_input_mode_init(void); | 79 | void unicode_input_mode_init(void); |
81 | uint8_t get_unicode_input_mode(void); | 80 | uint8_t get_unicode_input_mode(void); |
diff --git a/quantum/process_keycode/process_unicodemap.c b/quantum/process_keycode/process_unicodemap.c index fcf676c24..459397014 100644 --- a/quantum/process_keycode/process_unicodemap.c +++ b/quantum/process_keycode/process_unicodemap.c | |||
@@ -21,8 +21,13 @@ __attribute__((weak)) uint16_t unicodemap_index(uint16_t keycode) { | |||
21 | // Keycode is a pair: extract index based on Shift / Caps Lock state | 21 | // Keycode is a pair: extract index based on Shift / Caps Lock state |
22 | uint16_t index = keycode - QK_UNICODEMAP_PAIR; | 22 | uint16_t index = keycode - QK_UNICODEMAP_PAIR; |
23 | 23 | ||
24 | bool shift = unicode_saved_mods & MOD_MASK_SHIFT; | 24 | uint8_t mods = get_mods() | get_weak_mods(); |
25 | bool caps = IS_HOST_LED_ON(USB_LED_CAPS_LOCK); | 25 | #ifndef NO_ACTION_ONESHOT |
26 | mods |= get_oneshot_mods(); | ||
27 | #endif | ||
28 | |||
29 | bool shift = mods & MOD_MASK_SHIFT; | ||
30 | bool caps = host_keyboard_led_state().caps_lock; | ||
26 | if (shift ^ caps) { | 31 | if (shift ^ caps) { |
27 | index >>= 7; | 32 | index >>= 7; |
28 | } | 33 | } |