mirror of
https://github.com/qmk/qmk_firmware.git
synced 2026-06-20 14:23:45 -04:00
process_key_lock: clear entire key state in cancel_key_lock() (#26269)
cancel_key_lock() called UNSET_KEY_STATE(0x0), which expands to clearing only bit 0 of key_state[0]. The lock state is a 256-bit map spread across key_state[0..3], so every locked key other than keycode 0x00 stayed latched after a cancel. Zero all four words so cancel_key_lock() releases every locked key, as its name and its public declaration in process_key_lock.h imply.
This commit is contained in:
@@ -57,7 +57,11 @@ static inline uint16_t translate_keycode(uint16_t keycode) {
|
||||
|
||||
void cancel_key_lock(void) {
|
||||
watching = false;
|
||||
UNSET_KEY_STATE(0x0);
|
||||
// Clear the full 256-bit state, otherwise every actually-locked key will still be latched.
|
||||
key_state[0] = 0;
|
||||
key_state[1] = 0;
|
||||
key_state[2] = 0;
|
||||
key_state[3] = 0;
|
||||
}
|
||||
|
||||
bool process_key_lock(uint16_t *keycode, keyrecord_t *record) {
|
||||
|
||||
Reference in New Issue
Block a user