Skip to content

Commit

Permalink
Deprecate KEY_OVERRIDE_* keycodes for KO_* (qmk#18843)
Browse files Browse the repository at this point in the history
  • Loading branch information
fauxpark authored and ramonimbao committed Nov 28, 2022
1 parent 6c0fc18 commit 23be77a
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 14 deletions.
14 changes: 6 additions & 8 deletions docs/feature_key_overrides.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,15 +150,13 @@ const key_override_t fn_override = {.trigger_mods = MOD_BIT(KC_RGUI) |
.enabled = NULL};
```
## Keycodes
## Keycodes
You can enable, disable and toggle all key overrides on the fly.
|Keycode |Description |Function Equivalent|
|----------|---------------------------------|--------|
|`KEY_OVERRIDE_ON` |Turns on Key Override feature | `key_override_on(void)`|
|`KEY_OVERRIDE_OFF` |Turns off Key Override feature |`key_override_off(void)`|
|`KEY_OVERRIDE_TOGGLE` |Toggles Key Override feature on and off |`key_override_toggle(void)`|
|Keycode |Aliases |Description |
|------------------------|---------|----------------------|
|`QK_KEY_OVERRIDE_TOGGLE`|`KO_TOGG`|Toggle key overrides |
|`QK_KEY_OVERRIDE_ON` |`KO_ON` |Turn on key overrides |
|`QK_KEY_OVERRIDE_OFF` |`KO_OFF` |Turn off key overrides|
## Reference for `key_override_t`
Expand Down
6 changes: 3 additions & 3 deletions quantum/process_keycode/process_key_override.c
Original file line number Diff line number Diff line change
Expand Up @@ -406,15 +406,15 @@ bool process_key_override(const uint16_t keycode, const keyrecord_t *const recor

if (key_down) {
switch (keycode) {
case KEY_OVERRIDE_TOGGLE:
case QK_KEY_OVERRIDE_TOGGLE:
key_override_toggle();
return false;

case KEY_OVERRIDE_ON:
case QK_KEY_OVERRIDE_ON:
key_override_on();
return false;

case KEY_OVERRIDE_OFF:
case QK_KEY_OVERRIDE_OFF:
key_override_off();
return false;

Expand Down
11 changes: 8 additions & 3 deletions quantum/quantum_keycodes.h
Original file line number Diff line number Diff line change
Expand Up @@ -513,9 +513,9 @@ enum quantum_keycodes {
RGB_MODE_TWINKLE,

// Key Overrides
KEY_OVERRIDE_TOGGLE,
KEY_OVERRIDE_ON,
KEY_OVERRIDE_OFF,
QK_KEY_OVERRIDE_TOGGLE,
QK_KEY_OVERRIDE_ON,
QK_KEY_OVERRIDE_OFF,

// Additional magic key
MAGIC_TOGGLE_GUI,
Expand Down Expand Up @@ -852,6 +852,11 @@ enum quantum_keycodes {
// Caps Word
#define CW_TOGG QK_CAPS_WORD_TOGGLE

// Key Overrides
#define KO_TOGG QK_KEY_OVERRIDE_TOGGLE
#define KO_ON QK_KEY_OVERRIDE_ON
#define KO_OFF QK_KEY_OVERRIDE_OFF

// Swap Hands
#define SH_T(kc) (QK_SWAP_HANDS | (kc))
#define SH_TG (QK_SWAP_HANDS | OP_SH_TOGGLE)
Expand Down
4 changes: 4 additions & 0 deletions quantum/quantum_keycodes_legacy.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
#define CAPSWRD QK_CAPS_WORD_TOGGLE
#define CAPS_WORD QK_CAPS_WORD_TOGGLE

#define KEY_OVERRIDE_TOGGLE QK_KEY_OVERRIDE_TOGGLE
#define KEY_OVERRIDE_ON QK_KEY_OVERRIDE_ON
#define KEY_OVERRIDE_OFF QK_KEY_OVERRIDE_OFF

#define PROGRAMMABLE_BUTTON_1 QK_PROGRAMMABLE_BUTTON_1
#define PROGRAMMABLE_BUTTON_2 QK_PROGRAMMABLE_BUTTON_2
#define PROGRAMMABLE_BUTTON_3 QK_PROGRAMMABLE_BUTTON_3
Expand Down

0 comments on commit 23be77a

Please sign in to comment.