Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate ONESHOT_* keycodes for QK_ONE_SHOT_* #18844

Merged
merged 2 commits into from
Oct 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions docs/keycodes.md
Original file line number Diff line number Diff line change
Expand Up @@ -736,13 +736,13 @@ See also: [US ANSI Shifted Symbols](keycodes_us_ansi_shifted.md)

See also: [One Shot Keys](one_shot_keys.md)

|Key |Description |
|------------|----------------------------------|
|`OSM(mod)` |Hold `mod` for one keypress |
|`OSL(layer)`|Switch to `layer` for one keypress|
|`OS_ON` |Turns One Shot keys on |
|`OS_OFF` |Turns One Shot keys off |
|`OS_TOGG` |Toggles One Shot keys status |
|Key |Aliases |Description |
|--------------------|---------|----------------------------------|
|`OSM(mod)` | |Hold `mod` for one keypress |
|`OSL(layer)` | |Switch to `layer` for one keypress|
|`QK_ONE_SHOT_TOGGLE`|`OS_TOGG`|Toggles One Shot keys status |
|`QK_ONE_SHOT_ON` |`OS_ON` |Turns One Shot keys on |
|`QK_ONE_SHOT_OFF` |`OS_OFF` |Turns One Shot keys off |

## Programmable Button Support :id=programmable-button

Expand Down
6 changes: 3 additions & 3 deletions quantum/quantum.c
Original file line number Diff line number Diff line change
Expand Up @@ -395,13 +395,13 @@ bool process_record_quantum(keyrecord_t *record) {
return false;
#endif
#ifndef NO_ACTION_ONESHOT
case ONESHOT_TOGGLE:
case QK_ONE_SHOT_TOGGLE:
oneshot_toggle();
break;
case ONESHOT_ENABLE:
case QK_ONE_SHOT_ON:
oneshot_enable();
break;
case ONESHOT_DISABLE:
case QK_ONE_SHOT_OFF:
oneshot_disable();
break;
#endif
Expand Down
12 changes: 6 additions & 6 deletions quantum/quantum_keycodes.h
Original file line number Diff line number Diff line change
Expand Up @@ -505,9 +505,9 @@ enum quantum_keycodes {
#define SQ_T(n) (n < SEQUENCER_TRACKS ? SEQUENCER_TRACK_MIN + n : KC_NO)

// One Shot
ONESHOT_ENABLE,
ONESHOT_DISABLE,
ONESHOT_TOGGLE,
QK_ONE_SHOT_ON,
QK_ONE_SHOT_OFF,
QK_ONE_SHOT_TOGGLE,

// RGB underglow/matrix (continued)
RGB_MODE_TWINKLE,
Expand Down Expand Up @@ -923,9 +923,9 @@ enum quantum_keycodes {
#define QK_JOYSTICK_BUTTON_MAX QK_JOYSTICK_BUTTON_31

// One Shot aliases
#define OS_TOGG ONESHOT_TOGGLE
#define OS_ON ONESHOT_ENABLE
#define OS_OFF ONESHOT_DISABLE
#define OS_TOGG QK_ONE_SHOT_TOGGLE
#define OS_ON QK_ONE_SHOT_ON
#define OS_OFF QK_ONE_SHOT_OFF

// Programmable Button aliases
#define PB_1 QK_PROGRAMMABLE_BUTTON_1
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 @@ -14,6 +14,10 @@
#define KEY_OVERRIDE_ON QK_KEY_OVERRIDE_ON
#define KEY_OVERRIDE_OFF QK_KEY_OVERRIDE_OFF

#define ONESHOT_ENABLE QK_ONE_SHOT_ON
#define ONESHOT_DISABLE QK_ONE_SHOT_OFF
#define ONESHOT_TOGGLE QK_ONE_SHOT_TOGGLE

#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