summaryrefslogtreecommitdiff
path: root/quantum
diff options
context:
space:
mode:
authorRyan <fauxpark@gmail.com>2023-01-31 05:37:19 +1100
committerGitHub <noreply@github.com>2023-01-30 18:37:19 +0000
commit2d843088a26ee639287d16fbd9ca4c35e18f7b8b (patch)
tree773ee2c9b7515594683ef9e4cb5755de68bae4e9 /quantum
parentcc9520b7a02ccdc97f79a800de04ff4ea15f2656 (diff)
Normalise Swap Hands keycodes (#19720)
Diffstat (limited to 'quantum')
-rw-r--r--quantum/keycodes.h23
-rw-r--r--quantum/process_keycode/process_autocorrect.c2
-rw-r--r--quantum/process_keycode/process_caps_word.c2
-rw-r--r--quantum/quantum_keycodes_legacy.h1
4 files changed, 18 insertions, 10 deletions
diff --git a/quantum/keycodes.h b/quantum/keycodes.h
index b5f0a32500..eafa9eb1b6 100644
--- a/quantum/keycodes.h
+++ b/quantum/keycodes.h
@@ -304,13 +304,13 @@ enum qk_keycode_defines {
KC_RIGHT_SHIFT = 0x00E5,
KC_RIGHT_ALT = 0x00E6,
KC_RIGHT_GUI = 0x00E7,
- SH_TG = 0x56F0,
- SH_TT = 0x56F1,
- SH_MON = 0x56F2,
- SH_MOFF = 0x56F3,
- SH_OFF = 0x56F4,
- SH_ON = 0x56F5,
- SH_OS = 0x56F6,
+ QK_SWAP_HANDS_TOGGLE = 0x56F0,
+ QK_SWAP_HANDS_TAP_TOGGLE = 0x56F1,
+ QK_SWAP_HANDS_MOMENTARY_ON = 0x56F2,
+ QK_SWAP_HANDS_MOMENTARY_OFF = 0x56F3,
+ QK_SWAP_HANDS_OFF = 0x56F4,
+ QK_SWAP_HANDS_ON = 0x56F5,
+ QK_SWAP_HANDS_ONE_SHOT = 0x56F6,
MAGIC_SWAP_CONTROL_CAPSLOCK = 0x7000,
MAGIC_UNSWAP_CONTROL_CAPSLOCK = 0x7001,
MAGIC_TOGGLE_CONTROL_CAPSLOCK = 0x7002,
@@ -863,6 +863,13 @@ enum qk_keycode_defines {
KC_RGUI = KC_RIGHT_GUI,
KC_RCMD = KC_RIGHT_GUI,
KC_RWIN = KC_RIGHT_GUI,
+ SH_TOGG = QK_SWAP_HANDS_TOGGLE,
+ SH_TT = QK_SWAP_HANDS_TAP_TOGGLE,
+ SH_MON = QK_SWAP_HANDS_MOMENTARY_ON,
+ SH_MOFF = QK_SWAP_HANDS_MOMENTARY_OFF,
+ SH_OFF = QK_SWAP_HANDS_OFF,
+ SH_ON = QK_SWAP_HANDS_ON,
+ SH_OS = QK_SWAP_HANDS_ONE_SHOT,
CL_SWAP = MAGIC_SWAP_CONTROL_CAPSLOCK,
CL_NORM = MAGIC_UNSWAP_CONTROL_CAPSLOCK,
CL_TOGG = MAGIC_TOGGLE_CONTROL_CAPSLOCK,
@@ -1309,7 +1316,7 @@ enum qk_keycode_defines {
#define IS_MEDIA_KEYCODE(code) ((code) >= KC_AUDIO_MUTE && (code) <= KC_ASSISTANT)
#define IS_MOUSE_KEYCODE(code) ((code) >= KC_MS_UP && (code) <= KC_MS_ACCEL2)
#define IS_MODIFIERS_KEYCODE(code) ((code) >= KC_LEFT_CTRL && (code) <= KC_RIGHT_GUI)
-#define IS_SWAP_HANDS_KEYCODE(code) ((code) >= SH_TG && (code) <= SH_OS)
+#define IS_SWAP_HANDS_KEYCODE(code) ((code) >= QK_SWAP_HANDS_TOGGLE && (code) <= QK_SWAP_HANDS_ONE_SHOT)
#define IS_MAGIC_KEYCODE(code) ((code) >= MAGIC_SWAP_CONTROL_CAPSLOCK && (code) <= MAGIC_TOGGLE_ESCAPE_CAPSLOCK)
#define IS_MIDI_KEYCODE(code) ((code) >= QK_MIDI_ON && (code) <= QK_MIDI_PITCH_BEND_UP)
#define IS_SEQUENCER_KEYCODE(code) ((code) >= SQ_ON && (code) <= SQ_SCLR)
diff --git a/quantum/process_keycode/process_autocorrect.c b/quantum/process_keycode/process_autocorrect.c
index 8aeebf0e06..c89dffeaad 100644
--- a/quantum/process_keycode/process_autocorrect.c
+++ b/quantum/process_keycode/process_autocorrect.c
@@ -126,7 +126,7 @@ __attribute__((weak)) bool process_autocorrect_user(uint16_t *keycode, keyrecord
// and mask for base keycode when they are tapped.
case QK_SWAP_HANDS ... QK_SWAP_HANDS_MAX:
#ifdef SWAP_HANDS_ENABLE
- // Note: IS_SWAP_HANDS_KEYCODE() actually tests for the special action keycodes like SH_TG, SH_TT, ...,
+ // Note: IS_SWAP_HANDS_KEYCODE() actually tests for the special action keycodes like SH_TOGG, SH_TT, ...,
// which currently overlap the SH_T(kc) range.
if (IS_SWAP_HANDS_KEYCODE(*keycode) || !record->tap.count) {
return false;
diff --git a/quantum/process_keycode/process_caps_word.c b/quantum/process_keycode/process_caps_word.c
index 4c0217eba7..933abe629e 100644
--- a/quantum/process_keycode/process_caps_word.c
+++ b/quantum/process_keycode/process_caps_word.c
@@ -143,7 +143,7 @@ bool process_caps_word(uint16_t keycode, keyrecord_t* record) {
#ifdef SWAP_HANDS_ENABLE
case QK_SWAP_HANDS ... QK_SWAP_HANDS_MAX:
- // Note: IS_SWAP_HANDS_KEYCODE() actually tests for the special action keycodes like SH_TG, SH_TT, ...,
+ // Note: IS_SWAP_HANDS_KEYCODE() actually tests for the special action keycodes like SH_TOGG, SH_TT, ...,
// which currently overlap the SH_T(kc) range.
if (IS_SWAP_HANDS_KEYCODE(keycode) || record->tap.count == 0) {
return true;
diff --git a/quantum/quantum_keycodes_legacy.h b/quantum/quantum_keycodes_legacy.h
index 51ec77bae0..28634d00f7 100644
--- a/quantum/quantum_keycodes_legacy.h
+++ b/quantum/quantum_keycodes_legacy.h
@@ -3,3 +3,4 @@
// clang-format off
// Deprecated Quantum keycodes
+#define SH_TG QK_SWAP_HANDS_TOGGLE