1
0
Fork 0

Enhancement and fixes of "Secure" feature (#16958)

This commit is contained in:
Drashna Jael're 2022-05-14 15:07:08 -07:00 committed by GitHub
parent baa8d07fdb
commit db887e63d7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 379 additions and 2 deletions

View file

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