Fix Issue #9533 - Delayed shift state handling (#11220)

Co-authored-by: Ryan <fauxpark@gmail.com>
This commit is contained in:
Joshua Diamond 2020-12-22 12:23:09 -05:00 committed by GitHub
parent 9453573080
commit 54e2bf3ede
Failed to generate hash of commit
2 changed files with 7 additions and 3 deletions

View file

@ -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;
}