summary refs log tree commit diff
diff options
context:
space:
mode:
authorRyan <fauxpark@gmail.com>2022-10-26 03:50:22 +1100
committerGitHub <noreply@github.com>2022-10-25 17:50:22 +0100
commit812001de7fd0926f59fd399550f902ef4ec03ee6 (patch)
tree2da1fc8208911e6cee39258082f56ddcfc43fd43
parent1d34f380eb2717169c59fb4eb59bb1824a1f7187 (diff)
Deprecate `ONESHOT_*` keycodes for `QK_ONE_SHOT_*` (#18844)
* Deprecate `ONESHOT_*` keycodes for `QK_ONE_SHOT_*`

* Docs
-rw-r--r--docs/keycodes.md14
-rw-r--r--quantum/quantum.c6
-rw-r--r--quantum/quantum_keycodes.h12
-rw-r--r--quantum/quantum_keycodes_legacy.h4
4 files changed, 20 insertions, 16 deletions
diff --git a/docs/keycodes.md b/docs/keycodes.md
index b541975640..230f88456b 100644
--- a/docs/keycodes.md
+++ b/docs/keycodes.md
@@ -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
 
diff --git a/quantum/quantum.c b/quantum/quantum.c
index 2c55f45e3b..2333357be1 100644
--- a/quantum/quantum.c
+++ b/quantum/quantum.c
@@ -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
diff --git a/quantum/quantum_keycodes.h b/quantum/quantum_keycodes.h
index 06cc7835ae..8689b913ed 100644
--- a/quantum/quantum_keycodes.h
+++ b/quantum/quantum_keycodes.h
@@ -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,
@@ -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
diff --git a/quantum/quantum_keycodes_legacy.h b/quantum/quantum_keycodes_legacy.h
index 858875a58d..f53b8ef72a 100644
--- a/quantum/quantum_keycodes_legacy.h
+++ b/quantum/quantum_keycodes_legacy.h
@@ -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