Deprecate SECURE_* keycodes for QK_SECURE_* (#18847)

* Deprecate SECURE_* keycodes for QK_SECURE_*

* Update keycode process

* Update process_secure.c

* Apply suggestions from code review

Co-authored-by: Ryan <fauxpark@gmail.com>

Co-authored-by: Ryan <fauxpark@gmail.com>
This commit is contained in:
Joel Challis 2022-10-25 22:59:17 +01:00 committed by GitHub
parent 812001de7f
commit ec2414c074
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 25 additions and 14 deletions

View file

@ -26,12 +26,12 @@ SECURE_ENABLE = yes
## Keycodes
| Key | Description |
|------------------|--------------------------------------------------------------------------------|
| `SECURE_LOCK` | Revert back to a locked state |
| `SECURE_UNLOCK` | Forces unlock without performing a unlock sequence |
| `SECURE_TOGGLE` | Toggle directly between locked and unlock without performing a unlock sequence |
| `SECURE_REQUEST` | Request that user perform the unlock sequence |
| Key |Aliases | Description |
|---------------------|---------|--------------------------------------------------------------------------------|
| `QK_SECURE_LOCK` |`SE_LOCK`| Revert back to a locked state |
| `QK_SECURE_UNLOCK` |`SE_UNLK`| Forces unlock without performing a unlock sequence |
| `QK_SECURE_TOGGLE` |`SE_TOGG`| Toggle directly between locked and unlock without performing a unlock sequence |
| `QK_SECURE_REQUEST` |`SE_REQ` | Request that user perform the unlock sequence |
## Configuration

View file

@ -23,19 +23,19 @@ bool preprocess_secure(uint16_t keycode, keyrecord_t *record) {
bool process_secure(uint16_t keycode, keyrecord_t *record) {
#ifndef SECURE_DISABLE_KEYCODES
if (!record->event.pressed) {
if (keycode == SECURE_LOCK) {
if (keycode == QK_SECURE_LOCK) {
secure_lock();
return false;
}
if (keycode == SECURE_UNLOCK) {
if (keycode == QK_SECURE_UNLOCK) {
secure_unlock();
return false;
}
if (keycode == SECURE_TOGGLE) {
if (keycode == QK_SECURE_TOGGLE) {
secure_is_locked() ? secure_unlock() : secure_lock();
return false;
}
if (keycode == SECURE_REQUEST) {
if (keycode == QK_SECURE_REQUEST) {
secure_request_unlock();
return false;
}

View file

@ -598,10 +598,10 @@ enum quantum_keycodes {
QK_MAKE,
QK_REBOOT,
SECURE_LOCK,
SECURE_UNLOCK,
SECURE_TOGGLE,
SECURE_REQUEST,
QK_SECURE_LOCK,
QK_SECURE_UNLOCK,
QK_SECURE_TOGGLE,
QK_SECURE_REQUEST,
QK_CAPS_WORD_TOGGLE,
@ -857,6 +857,12 @@ enum quantum_keycodes {
#define KO_ON QK_KEY_OVERRIDE_ON
#define KO_OFF QK_KEY_OVERRIDE_OFF
// Secure
#define SE_LOCK QK_SECURE_LOCK
#define SE_UNLK QK_SECURE_UNLOCK
#define SE_TOGG QK_SECURE_TOGGLE
#define SE_REQ QK_SECURE_REQUEST
// Swap Hands
#define SH_T(kc) (QK_SWAP_HANDS | (kc))
#define SH_TG (QK_SWAP_HANDS | OP_SH_TOGGLE)

View file

@ -84,6 +84,11 @@
#define JS_BUTTON30 QK_JOYSTICK_BUTTON_30
#define JS_BUTTON31 QK_JOYSTICK_BUTTON_31
#define SECURE_LOCK QK_SECURE_LOCK
#define SECURE_UNLOCK QK_SECURE_UNLOCK
#define SECURE_TOGGLE QK_SECURE_TOGGLE
#define SECURE_REQUEST QK_SECURE_REQUEST
#define TERM_ON _Static_assert(false, "The Terminal feature has been removed from QMK. Please remove use of TERM_ON/TERM_OFF from your keymap.")
#define TERM_OFF _Static_assert(false, "The Terminal feature has been removed from QMK.. Please remove use of TERM_ON/TERM_OFF from your keymap.")
// #define RESET _Static_assert(false, "The RESET keycode has been removed from QMK.. Please remove use from your keymap.")