From 7f67504993f96936145a48f5cee7dcc1e2645a47 Mon Sep 17 00:00:00 2001 From: wheredoesyourmindgo Date: Mon, 29 Nov 2021 00:17:07 -0800 Subject: Added cancel_key_lock function (#15321) --- quantum/process_keycode/process_key_lock.c | 5 +++++ quantum/process_keycode/process_key_lock.h | 1 + 2 files changed, 6 insertions(+) (limited to 'quantum/process_keycode') diff --git a/quantum/process_keycode/process_key_lock.c b/quantum/process_keycode/process_key_lock.c index 4bd58f0c1e..941a2c5780 100644 --- a/quantum/process_keycode/process_key_lock.c +++ b/quantum/process_keycode/process_key_lock.c @@ -56,6 +56,11 @@ static inline uint16_t translate_keycode(uint16_t keycode) { } } +void cancel_key_lock(void) { + watching = false; + UNSET_KEY_STATE(0x0); +} + bool process_key_lock(uint16_t *keycode, keyrecord_t *record) { // We start by categorizing the keypress event. In the event of a down // event, there are several possibilities: diff --git a/quantum/process_keycode/process_key_lock.h b/quantum/process_keycode/process_key_lock.h index baa0b39077..5159b0ba02 100644 --- a/quantum/process_keycode/process_key_lock.h +++ b/quantum/process_keycode/process_key_lock.h @@ -18,4 +18,5 @@ #include "quantum.h" +void cancel_key_lock(void); bool process_key_lock(uint16_t *keycode, keyrecord_t *record); -- cgit v1.2.3