diff options
| author | Drashna Jaelre <drashna@live.com> | 2022-05-14 15:07:08 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-05-14 23:07:08 +0100 |
| commit | db887e63d708925ad759e3504a6bc9ceef4aeb8f (patch) | |
| tree | 7366242dc8834ff5ddb761ff162fa444bf64653f /quantum/quantum.c | |
| parent | baa8d07fdb32a35f9ff5020d655271b01e057ddc (diff) | |
Enhancement and fixes of "Secure" feature (#16958)
Diffstat (limited to 'quantum/quantum.c')
| -rw-r--r-- | quantum/quantum.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/quantum/quantum.c b/quantum/quantum.c index b54b46760c..ac3e2d90b4 100644 --- a/quantum/quantum.c +++ b/quantum/quantum.c | |||
| @@ -571,3 +571,16 @@ const char *get_u16_str(uint16_t curr_num, char curr_pad) { | |||
| 571 | last_pad = curr_pad; | 571 | last_pad = curr_pad; |
| 572 | return get_numeric_str(buf, sizeof(buf), curr_num, curr_pad); | 572 | return get_numeric_str(buf, sizeof(buf), curr_num, curr_pad); |
| 573 | } | 573 | } |
| 574 | |||
| 575 | #if defined(SECURE_ENABLE) | ||
| 576 | void secure_hook_quantum(secure_status_t secure_status) { | ||
| 577 | // If keys are being held when this is triggered, they may not be released properly | ||
| 578 | // this can result in stuck keys, mods and layers. To prevent that, manually | ||
| 579 | // clear these, when it is triggered. | ||
| 580 | |||
| 581 | if (secure_status == SECURE_PENDING) { | ||
| 582 | clear_keyboard(); | ||
| 583 | layer_clear(); | ||
| 584 | } | ||
| 585 | } | ||
| 586 | #endif | ||
