summaryrefslogtreecommitdiffstats
path: root/quantum/process_keycode
diff options
context:
space:
mode:
authorDrashna Jaelre <drashna@live.com>2022-05-14 15:07:08 -0700
committerGitHub <noreply@github.com>2022-05-14 23:07:08 +0100
commitdb887e63d708925ad759e3504a6bc9ceef4aeb8f (patch)
tree7366242dc8834ff5ddb761ff162fa444bf64653f /quantum/process_keycode
parentbaa8d07fdb32a35f9ff5020d655271b01e057ddc (diff)
Enhancement and fixes of "Secure" feature (#16958)
Diffstat (limited to 'quantum/process_keycode')
-rw-r--r--quantum/process_keycode/process_secure.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/quantum/process_keycode/process_secure.c b/quantum/process_keycode/process_secure.c
index 827ace597a..3224104c99 100644
--- a/quantum/process_keycode/process_secure.c
+++ b/quantum/process_keycode/process_secure.c
@@ -7,7 +7,9 @@
bool preprocess_secure(uint16_t keycode, keyrecord_t *record) {
if (secure_is_unlocking()) {
- if (!record->event.pressed) {
+ // !pressed will trigger on any already held keys (such as layer keys),
+ // and cause the request secure check to prematurely fail.
+ if (record->event.pressed) {
secure_keypress_event(record->event.key.row, record->event.key.col);
}
@@ -33,7 +35,11 @@ bool process_secure(uint16_t keycode, keyrecord_t *record) {
secure_is_locked() ? secure_unlock() : secure_lock();
return false;
}
+ if (keycode == SECURE_REQUEST) {
+ secure_request_unlock();
+ return false;
+ }
}
#endif
return true;
-} \ No newline at end of file
+}