summaryrefslogtreecommitdiff
path: root/quantum/process_keycode
diff options
context:
space:
mode:
authorJoshua Diamond <josh@windowoffire.com>2020-12-22 12:23:09 -0500
committerDrashna Jael're <drashna@live.com>2021-01-12 22:46:10 -0800
commit9af1faa040488c9b3034e589187656b37b75f916 (patch)
treec5549145b4bac994a863aa1dbfbe1eac4686e0db /quantum/process_keycode
parenta2bb489e37260763b39847c6d49d8f7182453532 (diff)
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.h1
-rw-r--r--quantum/process_keycode/process_unicodemap.c9
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 3082fbb5f0..c10e171ec3 100644
--- a/quantum/process_keycode/process_unicode_common.h
+++ b/quantum/process_keycode/process_unicode_common.h
@@ -75,7 +75,6 @@ typedef union {
} unicode_config_t;
extern unicode_config_t unicode_config;
-extern uint8_t unicode_saved_mods;
void unicode_input_mode_init(void);
uint8_t get_unicode_input_mode(void);
diff --git a/quantum/process_keycode/process_unicodemap.c b/quantum/process_keycode/process_unicodemap.c
index fcf676c24e..459397014d 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) {
// Keycode is a pair: extract index based on Shift / Caps Lock state
uint16_t index = keycode - QK_UNICODEMAP_PAIR;
- bool shift = unicode_saved_mods & MOD_MASK_SHIFT;
- bool caps = IS_HOST_LED_ON(USB_LED_CAPS_LOCK);
+ uint8_t mods = get_mods() | get_weak_mods();
+#ifndef NO_ACTION_ONESHOT
+ mods |= get_oneshot_mods();
+#endif
+
+ bool shift = mods & MOD_MASK_SHIFT;
+ bool caps = host_keyboard_led_state().caps_lock;
if (shift ^ caps) {
index >>= 7;
}