From f8596b40a4bb15a1881138baa8b8787277e2e622 Mon Sep 17 00:00:00 2001 From: Ryan Date: Wed, 3 Jul 2024 18:35:54 +1000 Subject: [PATCH] Normalise mouse keycodes (#23975) --- data/constants/keycodes/keycodes_0.0.5.hjson | 0 .../keycodes/keycodes_0.0.5_basic.hjson | 175 ++++++++++++++++++ docs/features/encoders.md | 8 +- docs/features/mouse_keys.md | 82 ++++---- docs/features/repeat_key.md | 8 +- docs/keycodes.md | 39 ++-- drivers/sensors/cirque_pinnacle_gestures.h | 2 +- .../lib/satisfaction75/satisfaction_encoder.c | 6 +- keyboards/dichotomy/keymaps/default/keymap.c | 16 +- quantum/action.c | 6 +- quantum/encoder.c | 4 +- quantum/keycode.h | 8 +- quantum/keycodes.h | 80 ++++---- quantum/mousekey.c | 112 +++++------ quantum/pointing_device/pointing_device.c | 2 +- .../pointing_device_auto_mouse.h | 2 +- quantum/quantum_keycodes_legacy.h | 39 ++++ quantum/repeat_key.c | 8 +- tests/test_common/keycode_table.cpp | 38 ++-- 19 files changed, 426 insertions(+), 209 deletions(-) create mode 100644 data/constants/keycodes/keycodes_0.0.5.hjson create mode 100644 data/constants/keycodes/keycodes_0.0.5_basic.hjson diff --git a/data/constants/keycodes/keycodes_0.0.5.hjson b/data/constants/keycodes/keycodes_0.0.5.hjson new file mode 100644 index 0000000000..e69de29bb2 diff --git a/data/constants/keycodes/keycodes_0.0.5_basic.hjson b/data/constants/keycodes/keycodes_0.0.5_basic.hjson new file mode 100644 index 0000000000..79b6bf6596 --- /dev/null +++ b/data/constants/keycodes/keycodes_0.0.5_basic.hjson @@ -0,0 +1,175 @@ +{ + "keycodes": { + "0x00CD": { + "group": "mouse", + "key": "QK_MOUSE_CURSOR_UP", + "label": "Mouse cursor up", + "aliases": [ + "!reset!", + "MS_UP" + ] + }, + "0x00CE": { + "group": "mouse", + "key": "QK_MOUSE_CURSOR_DOWN", + "label": "Mouse cursor down", + "aliases": [ + "!reset!", + "MS_DOWN" + ] + }, + "0x00CF": { + "group": "mouse", + "key": "QK_MOUSE_CURSOR_LEFT", + "label": "Mouse cursor left", + "aliases": [ + "!reset!", + "MS_LEFT" + ] + }, + "0x00D0": { + "group": "mouse", + "key": "QK_MOUSE_CURSOR_RIGHT", + "label": "Mouse cursor right", + "aliases": [ + "!reset!", + "MS_RGHT" + ] + }, + "0x00D1": { + "group": "mouse", + "key": "QK_MOUSE_BUTTON_1", + "label": "Mouse button 1", + "aliases": [ + "!reset!", + "MS_BTN1" + ] + }, + "0x00D2": { + "group": "mouse", + "key": "QK_MOUSE_BUTTON_2", + "label": "Mouse button 2", + "aliases": [ + "!reset!", + "MS_BTN2" + ] + }, + "0x00D3": { + "group": "mouse", + "key": "QK_MOUSE_BUTTON_3", + "label": "Mouse button 3", + "aliases": [ + "!reset!", + "MS_BTN3" + ] + }, + "0x00D4": { + "group": "mouse", + "key": "QK_MOUSE_BUTTON_4", + "label": "Mouse button 4", + "aliases": [ + "!reset!", + "MS_BTN4" + ] + }, + "0x00D5": { + "group": "mouse", + "key": "QK_MOUSE_BUTTON_5", + "label": "Mouse button 5", + "aliases": [ + "!reset!", + "MS_BTN5" + ] + }, + "0x00D6": { + "group": "mouse", + "key": "QK_MOUSE_BUTTON_6", + "label": "Mouse button 6", + "aliases": [ + "!reset!", + "MS_BTN6" + ] + }, + "0x00D7": { + "group": "mouse", + "key": "QK_MOUSE_BUTTON_7", + "label": "Mouse button 7", + "aliases": [ + "!reset!", + "MS_BTN7" + ] + }, + "0x00D8": { + "group": "mouse", + "key": "QK_MOUSE_BUTTON_8", + "label": "Mouse button 8", + "aliases": [ + "!reset!", + "MS_BTN8" + ] + }, + "0x00D9": { + "group": "mouse", + "key": "QK_MOUSE_WHEEL_UP", + "label": "Mouse wheel up", + "aliases": [ + "!reset!", + "MS_WHLU" + ] + }, + "0x00DA": { + "group": "mouse", + "key": "QK_MOUSE_WHEEL_DOWN", + "label": "Mouse wheel down", + "aliases": [ + "!reset!", + "MS_WHLD" + ] + }, + "0x00DB": { + "group": "mouse", + "key": "QK_MOUSE_WHEEL_LEFT", + "label": "Mouse wheel left", + "aliases": [ + "!reset!", + "MS_WHLL" + ] + }, + "0x00DC": { + "group": "mouse", + "key": "QK_MOUSE_WHEEL_RIGHT", + "label": "Mouse wheel right", + "aliases": [ + "!reset!", + "MS_WHLR" + ] + }, + "0x00DD": { + "group": "mouse", + "key": "QK_MOUSE_ACCELERATION_0", + "label": "Set mouse acceleration to 0", + "aliases": [ + "!reset!", + "MS_ACL0" + ] + }, + "0x00DE": { + "group": "mouse", + "key": "QK_MOUSE_ACCELERATION_1", + "label": "Set mouse acceleration to 1", + "aliases": [ + "!reset!", + "MS_ACL1" + ] + }, + "0x00DF": { + "group": "mouse", + "key": "QK_MOUSE_ACCELERATION_2", + "label": "Set mouse acceleration to 2", + "aliases": [ + "!reset!", + "MS_ACL2" + ] + } + } +} diff --git a/docs/features/encoders.md b/docs/features/encoders.md index eea70dafec..73cbb4f3f3 100644 --- a/docs/features/encoders.md +++ b/docs/features/encoders.md @@ -84,10 +84,10 @@ Your `keymap.c` will then need an encoder mapping defined (for four layers and t ```c #if defined(ENCODER_MAP_ENABLE) const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = { - [0] = { ENCODER_CCW_CW(KC_MS_WH_UP, KC_MS_WH_DOWN), ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, - [1] = { ENCODER_CCW_CW(RGB_HUD, RGB_HUI), ENCODER_CCW_CW(RGB_SAD, RGB_SAI) }, - [2] = { ENCODER_CCW_CW(RGB_VAD, RGB_VAI), ENCODER_CCW_CW(RGB_SPD, RGB_SPI) }, - [3] = { ENCODER_CCW_CW(RGB_RMOD, RGB_MOD), ENCODER_CCW_CW(KC_RIGHT, KC_LEFT) }, + [0] = { ENCODER_CCW_CW(MS_WHLU, MS_WHLD), ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, + [1] = { ENCODER_CCW_CW(RGB_HUD, RGB_HUI), ENCODER_CCW_CW(RGB_SAD, RGB_SAI) }, + [2] = { ENCODER_CCW_CW(RGB_VAD, RGB_VAI), ENCODER_CCW_CW(RGB_SPD, RGB_SPI) }, + [3] = { ENCODER_CCW_CW(RGB_RMOD, RGB_MOD), ENCODER_CCW_CW(KC_RIGHT, KC_LEFT) }, }; #endif ``` diff --git a/docs/features/mouse_keys.md b/docs/features/mouse_keys.md index c2b3e98f42..4cc06c992a 100644 --- a/docs/features/mouse_keys.md +++ b/docs/features/mouse_keys.md @@ -18,27 +18,27 @@ MOUSEKEY_ENABLE = yes In your keymap you can use the following keycodes to map key presses to mouse actions: -|Key |Aliases |Description | -|----------------|---------|-----------------| -|`KC_MS_UP` |`KC_MS_U`|Move cursor up | -|`KC_MS_DOWN` |`KC_MS_D`|Move cursor down | -|`KC_MS_LEFT` |`KC_MS_L`|Move cursor left | -|`KC_MS_RIGHT` |`KC_MS_R`|Move cursor right| -|`KC_MS_BTN1` |`KC_BTN1`|Press button 1 | -|`KC_MS_BTN2` |`KC_BTN2`|Press button 2 | -|`KC_MS_BTN3` |`KC_BTN3`|Press button 3 | -|`KC_MS_BTN4` |`KC_BTN4`|Press button 4 | -|`KC_MS_BTN5` |`KC_BTN5`|Press button 5 | -|`KC_MS_BTN6` |`KC_BTN6`|Press button 6 | -|`KC_MS_BTN7` |`KC_BTN7`|Press button 7 | -|`KC_MS_BTN8` |`KC_BTN8`|Press button 8 | -|`KC_MS_WH_UP` |`KC_WH_U`|Move wheel up | -|`KC_MS_WH_DOWN` |`KC_WH_D`|Move wheel down | -|`KC_MS_WH_LEFT` |`KC_WH_L`|Move wheel left | -|`KC_MS_WH_RIGHT`|`KC_WH_R`|Move wheel right | -|`KC_MS_ACCEL0` |`KC_ACL0`|Set speed to 0 | -|`KC_MS_ACCEL1` |`KC_ACL1`|Set speed to 1 | -|`KC_MS_ACCEL2` |`KC_ACL2`|Set speed to 2 | +|Key |Aliases |Description | +|-------------------------|---------|---------------------------| +|`QK_MOUSE_CURSOR_UP` |`MS_UP` |Mouse cursor up | +|`QK_MOUSE_CURSOR_DOWN` |`MS_DOWN`|Mouse cursor down | +|`QK_MOUSE_CURSOR_LEFT` |`MS_LEFT`|Mouse cursor left | +|`QK_MOUSE_CURSOR_RIGHT` |`MS_RGHT`|Mouse cursor right | +|`QK_MOUSE_BUTTON_1` |`MS_BTN1`|Mouse button 1 | +|`QK_MOUSE_BUTTON_2` |`MS_BTN2`|Mouse button 2 | +|`QK_MOUSE_BUTTON_3` |`MS_BTN3`|Mouse button 3 | +|`QK_MOUSE_BUTTON_4` |`MS_BTN4`|Mouse button 4 | +|`QK_MOUSE_BUTTON_5` |`MS_BTN5`|Mouse button 5 | +|`QK_MOUSE_BUTTON_6` |`MS_BTN6`|Mouse button 6 | +|`QK_MOUSE_BUTTON_7` |`MS_BTN7`|Mouse button 7 | +|`QK_MOUSE_BUTTON_8` |`MS_BTN8`|Mouse button 8 | +|`QK_MOUSE_WHEEL_UP` |`MS_WHLU`|Mouse wheel up | +|`QK_MOUSE_WHEEL_DOWN` |`MS_WHLD`|Mouse wheel down | +|`QK_MOUSE_WHEEL_LEFT` |`MS_WHLL`|Mouse wheel left | +|`QK_MOUSE_WHEEL_RIGHT` |`MS_WHLR`|Mouse wheel right | +|`QK_MOUSE_ACCELERATION_0`|`MS_ACL0`|Set mouse acceleration to 0| +|`QK_MOUSE_ACCELERATION_1`|`MS_ACL1`|Set mouse acceleration to 1| +|`QK_MOUSE_ACCELERATION_2`|`MS_ACL2`|Set mouse acceleration to 2| ## Configuring mouse keys @@ -106,17 +106,17 @@ Tips: ### Constant mode -In this mode you can define multiple different speeds for both the cursor and the mouse wheel. There is no acceleration. `KC_ACL0`, `KC_ACL1` and `KC_ACL2` change the cursor and scroll speed to their respective setting. +In this mode you can define multiple different speeds for both the cursor and the mouse wheel. There is no acceleration. `MS_ACL0`, `MS_ACL1` and `MS_ACL2` change the cursor and scroll speed to their respective setting. You can choose whether speed selection is momentary or tap-to-select: * **Momentary:** The chosen speed is only active while you hold the respective key. When the key is raised, mouse keys returns to the unmodified speed. -* **Tap-to-select:** The chosen speed is activated when you press the respective key and remains active even after the key has been raised. The default speed is that of `KC_ACL1`. There is no unmodified speed. +* **Tap-to-select:** The chosen speed is activated when you press the respective key and remains active even after the key has been raised. The default speed is that of `MS_ACL1`. There is no unmodified speed. The default speeds from slowest to fastest are as follows: -* **Momentary:** `KC_ACL0` < `KC_ACL1` < *unmodified* < `KC_ACL2` -* **Tap-to-select:** `KC_ACL0` < `KC_ACL1` < `KC_ACL2` +* **Momentary:** `MS_ACL0` < `MS_ACL1` < *unmodified* < `MS_ACL2` +* **Tap-to-select:** `MS_ACL0` < `MS_ACL1` < `MS_ACL2` To use constant speed mode, you must at least define `MK_3_SPEED` in your keymap’s `config.h` file: @@ -138,32 +138,32 @@ Use the following settings if you want to adjust cursor movement or scrolling: |`MK_MOMENTARY_ACCEL` |*Not defined*|Enable momentary speed selection | |`MK_C_OFFSET_UNMOD` |16 |Cursor offset per movement (unmodified) | |`MK_C_INTERVAL_UNMOD`|16 |Time between cursor movements (unmodified) | -|`MK_C_OFFSET_0` |1 |Cursor offset per movement (`KC_ACL0`) | -|`MK_C_INTERVAL_0` |32 |Time between cursor movements (`KC_ACL0`) | -|`MK_C_OFFSET_1` |4 |Cursor offset per movement (`KC_ACL1`) | -|`MK_C_INTERVAL_1` |16 |Time between cursor movements (`KC_ACL1`) | -|`MK_C_OFFSET_2` |32 |Cursor offset per movement (`KC_ACL2`) | -|`MK_C_INTERVAL_2` |16 |Time between cursor movements (`KC_ACL2`) | +|`MK_C_OFFSET_0` |1 |Cursor offset per movement (`MS_ACL0`) | +|`MK_C_INTERVAL_0` |32 |Time between cursor movements (`MS_ACL0`) | +|`MK_C_OFFSET_1` |4 |Cursor offset per movement (`MS_ACL1`) | +|`MK_C_INTERVAL_1` |16 |Time between cursor movements (`MS_ACL1`) | +|`MK_C_OFFSET_2` |32 |Cursor offset per movement (`MS_ACL2`) | +|`MK_C_INTERVAL_2` |16 |Time between cursor movements (`MS_ACL2`) | |`MK_W_OFFSET_UNMOD` |1 |Scroll steps per scroll action (unmodified)| |`MK_W_INTERVAL_UNMOD`|40 |Time between scroll steps (unmodified) | -|`MK_W_OFFSET_0` |1 |Scroll steps per scroll action (`KC_ACL0`) | -|`MK_W_INTERVAL_0` |360 |Time between scroll steps (`KC_ACL0`) | -|`MK_W_OFFSET_1` |1 |Scroll steps per scroll action (`KC_ACL1`) | -|`MK_W_INTERVAL_1` |120 |Time between scroll steps (`KC_ACL1`) | -|`MK_W_OFFSET_2` |1 |Scroll steps per scroll action (`KC_ACL2`) | -|`MK_W_INTERVAL_2` |20 |Time between scroll steps (`KC_ACL2`) | +|`MK_W_OFFSET_0` |1 |Scroll steps per scroll action (`MS_ACL0`) | +|`MK_W_INTERVAL_0` |360 |Time between scroll steps (`MS_ACL0`) | +|`MK_W_OFFSET_1` |1 |Scroll steps per scroll action (`MS_ACL1`) | +|`MK_W_INTERVAL_1` |120 |Time between scroll steps (`MS_ACL1`) | +|`MK_W_OFFSET_2` |1 |Scroll steps per scroll action (`MS_ACL2`) | +|`MK_W_INTERVAL_2` |20 |Time between scroll steps (`MS_ACL2`) | ### Combined mode -This mode functions like **Accelerated** mode, however, you can hold `KC_ACL0`, `KC_ACL1` and `KC_ACL2` +This mode functions like **Accelerated** mode, however, you can hold `MS_ACL0`, `MS_ACL1` and `MS_ACL2` to momentarily (while held) set the cursor and scroll speeds to constant speeds. When no acceleration keys are held, this mode is identical to **Accelerated** mode, and can be modified using all of the relevant settings. -* **KC_ACL0:** This acceleration sets your cursor to the slowest possible speed. This is useful for very +* **MS_ACL0:** This acceleration sets your cursor to the slowest possible speed. This is useful for very small and detailed movements of the cursor. -* **KC_ACL1:** This acceleration sets your cursor to half the maximum (user defined) speed. -* **KC_ACL2:** This acceleration sets your cursor to the maximum (computer defined) speed. This is +* **MS_ACL1:** This acceleration sets your cursor to half the maximum (user defined) speed. +* **MS_ACL2:** This acceleration sets your cursor to the maximum (computer defined) speed. This is useful for moving the cursor large distances without much accuracy. To use combined speed mode, you must at least define `MK_COMBINED` in your keymap’s `config.h` file: diff --git a/docs/features/repeat_key.md b/docs/features/repeat_key.md index 53495e0f4d..7f2bdc44e6 100644 --- a/docs/features/repeat_key.md +++ b/docs/features/repeat_key.md @@ -60,10 +60,10 @@ with mods, like Ctrl + Left ↔ Ctrl + Right Arrow. |`KC_UP` ↔ `KC_DOWN` | Up ↔ Down Arrow | |`KC_HOME` ↔ `KC_END` | Home ↔ End | |`KC_PGUP` ↔ `KC_PGDN` | Page Up ↔ Page Down | -|`KC_MS_L` ↔ `KC_MS_R` | Mouse Cursor Left ↔ Right | -|`KC_MS_U` ↔ `KC_MS_D` | Mouse Cursor Up ↔ Down | -|`KC_WH_L` ↔ `KC_WH_R` | Mouse Wheel Left ↔ Right | -|`KC_WH_U` ↔ `KC_WH_D` | Mouse Wheel Up ↔ Down | +|`MS_LEFT` ↔ `MS_RGHT` | Mouse Cursor Left ↔ Right | +|`MS_UP` ↔ `MS_DOWN` | Mouse Cursor Up ↔ Down | +|`MS_WHLL` ↔ `MS_WHLR` | Mouse Wheel Left ↔ Right | +|`MS_WHLU` ↔ `MS_WHLD` | Mouse Wheel Up ↔ Down | **Misc** diff --git a/docs/keycodes.md b/docs/keycodes.md index 4c91d98fa7..ea8b2e7b65 100644 --- a/docs/keycodes.md +++ b/docs/keycodes.md @@ -611,24 +611,27 @@ See also: [MIDI](features/midi) See also: [Mouse Keys](features/mouse_keys) -|Key |Aliases |Description | -|----------------|---------|---------------------------| -|`KC_MS_UP` |`KC_MS_U`|Mouse Cursor Up | -|`KC_MS_DOWN` |`KC_MS_D`|Mouse Cursor Down | -|`KC_MS_LEFT` |`KC_MS_L`|Mouse Cursor Left | -|`KC_MS_RIGHT` |`KC_MS_R`|Mouse Cursor Right | -|`KC_MS_BTN1` |`KC_BTN1`|Mouse Button 1 | -|`KC_MS_BTN2` |`KC_BTN2`|Mouse Button 2 | -|`KC_MS_BTN3` |`KC_BTN3`|Mouse Button 3 | -|`KC_MS_BTN4` |`KC_BTN4`|Mouse Button 4 | -|`KC_MS_BTN5` |`KC_BTN5`|Mouse Button 5 | -|`KC_MS_WH_UP` |`KC_WH_U`|Mouse Wheel Up | -|`KC_MS_WH_DOWN` |`KC_WH_D`|Mouse Wheel Down | -|`KC_MS_WH_LEFT` |`KC_WH_L`|Mouse Wheel Left | -|`KC_MS_WH_RIGHT`|`KC_WH_R`|Mouse Wheel Right | -|`KC_MS_ACCEL0` |`KC_ACL0`|Set mouse acceleration to 0| -|`KC_MS_ACCEL1` |`KC_ACL1`|Set mouse acceleration to 1| -|`KC_MS_ACCEL2` |`KC_ACL2`|Set mouse acceleration to 2| +|Key |Aliases |Description | +|-------------------------|---------|---------------------------| +|`QK_MOUSE_CURSOR_UP` |`MS_UP` |Mouse cursor up | +|`QK_MOUSE_CURSOR_DOWN` |`MS_DOWN`|Mouse cursor down | +|`QK_MOUSE_CURSOR_LEFT` |`MS_LEFT`|Mouse cursor left | +|`QK_MOUSE_CURSOR_RIGHT` |`MS_RGHT`|Mouse cursor right | +|`QK_MOUSE_BUTTON_1` |`MS_BTN1`|Mouse button 1 | +|`QK_MOUSE_BUTTON_2` |`MS_BTN2`|Mouse button 2 | +|`QK_MOUSE_BUTTON_3` |`MS_BTN3`|Mouse button 3 | +|`QK_MOUSE_BUTTON_4` |`MS_BTN4`|Mouse button 4 | +|`QK_MOUSE_BUTTON_5` |`MS_BTN5`|Mouse button 5 | +|`QK_MOUSE_BUTTON_6` |`MS_BTN6`|Mouse button 6 | +|`QK_MOUSE_BUTTON_7` |`MS_BTN7`|Mouse button 7 | +|`QK_MOUSE_BUTTON_8` |`MS_BTN8`|Mouse button 8 | +|`QK_MOUSE_WHEEL_UP` |`MS_WHLU`|Mouse wheel up | +|`QK_MOUSE_WHEEL_DOWN` |`MS_WHLD`|Mouse wheel down | +|`QK_MOUSE_WHEEL_LEFT` |`MS_WHLL`|Mouse wheel left | +|`QK_MOUSE_WHEEL_RIGHT` |`MS_WHLR`|Mouse wheel right | +|`QK_MOUSE_ACCELERATION_0`|`MS_ACL0`|Set mouse acceleration to 0| +|`QK_MOUSE_ACCELERATION_1`|`MS_ACL1`|Set mouse acceleration to 1| +|`QK_MOUSE_ACCELERATION_2`|`MS_ACL2`|Set mouse acceleration to 2| ## Modifiers {#modifiers} diff --git a/drivers/sensors/cirque_pinnacle_gestures.h b/drivers/sensors/cirque_pinnacle_gestures.h index d2aa206b2b..1412c86f7e 100644 --- a/drivers/sensors/cirque_pinnacle_gestures.h +++ b/drivers/sensors/cirque_pinnacle_gestures.h @@ -28,7 +28,7 @@ typedef struct { # ifndef CIRQUE_PINNACLE_TAPPING_TERM # include "action.h" # include "action_tapping.h" -# define CIRQUE_PINNACLE_TAPPING_TERM GET_TAPPING_TERM(KC_BTN1, &(keyrecord_t){}) +# define CIRQUE_PINNACLE_TAPPING_TERM GET_TAPPING_TERM(QK_MOUSE_BUTTON_1, &(keyrecord_t){}) # endif # ifndef CIRQUE_PINNACLE_TOUCH_DEBOUNCE # define CIRQUE_PINNACLE_TOUCH_DEBOUNCE (CIRQUE_PINNACLE_TAPPING_TERM * 8) diff --git a/keyboards/cannonkeys/lib/satisfaction75/satisfaction_encoder.c b/keyboards/cannonkeys/lib/satisfaction75/satisfaction_encoder.c index aab005ebd8..7e0b82e9e7 100644 --- a/keyboards/cannonkeys/lib/satisfaction75/satisfaction_encoder.c +++ b/keyboards/cannonkeys/lib/satisfaction75/satisfaction_encoder.c @@ -101,7 +101,7 @@ uint16_t handle_encoder_clockwise(void){ mapped_code = KC_MEDIA_NEXT_TRACK; break; case ENC_MODE_SCROLL: - mapped_code = KC_WH_D; + mapped_code = QK_MOUSE_WHEEL_DOWN; break; #ifdef BACKLIGHT_ENABLE case ENC_MODE_BACKLIGHT: @@ -143,7 +143,7 @@ uint16_t handle_encoder_ccw(void){ mapped_code = KC_MEDIA_PREV_TRACK; break; case ENC_MODE_SCROLL: - mapped_code = KC_WH_U; + mapped_code = QK_MOUSE_WHEEL_UP; break; #ifdef BACKLIGHT_ENABLE case ENC_MODE_BACKLIGHT: @@ -186,7 +186,7 @@ uint16_t handle_encoder_press(void){ mapped_code = KC_MEDIA_PLAY_PAUSE; break; case ENC_MODE_SCROLL: - mapped_code = KC_BTN3; + mapped_code = QK_MOUSE_BUTTON_3; break; #ifdef BACKLIGHT_ENABLE case ENC_MODE_BACKLIGHT: diff --git a/keyboards/dichotomy/keymaps/default/keymap.c b/keyboards/dichotomy/keymaps/default/keymap.c index b83f7b82e9..b92beb73cc 100755 --- a/keyboards/dichotomy/keymaps/default/keymap.c +++ b/keyboards/dichotomy/keymaps/default/keymap.c @@ -28,9 +28,9 @@ enum dichotomy_keycodes NUMKEY, SFTKEY, MOUKEY, - MS_BTN1, - MS_BTN2, - MS_BTN3 + CK_MSE1, + CK_MSE2, + CK_MSE3 }; #define CUSTOM_LONGPRESS 150 @@ -46,7 +46,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { NUMKEY, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, CK_QE, SFTKEY, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, MOUKEY, KC_LCTL, KC_LALT, KC_LGUI, KC_RGUI, KC_RALT, KC_RCTL, - MS_BTN3, KC_LBRC, KC_LPRN, KC_SPC, KC_SPC, KC_RPRN, KC_RBRC, MS_BTN3 + CK_MSE3, KC_LBRC, KC_LPRN, KC_SPC, KC_SPC, KC_RPRN, KC_RBRC, CK_MSE3 ), [_SF] = LAYOUT( /* Shifted layout, small changes (because angle brackets have been moved to thumb cluster buttons) */ @@ -75,7 +75,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_MS] = LAYOUT( /* Mouse layer, including buttons for clicking. */ _______, _______, _______, _______, _______, _______, KC_VOLU, KC_HOME, KC_PGUP, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, MS_BTN1, MS_BTN2, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, CK_MSE1, CK_MSE2, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_VOLD, KC_END, KC_PGDN, _______, _______, _______, _______, _______, _______, _______, KC_UP, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______ @@ -311,7 +311,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { break; //mouse buttons, for 1-3, to update the mouse report: - case MS_BTN1: + case CK_MSE1: currentReport = pointing_device_get_report(); if (record->event.pressed) { if (shift_held && shift_suspended){ @@ -327,7 +327,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { pointing_device_set_report(currentReport); returnVal = false; break; - case MS_BTN2: + case CK_MSE2: currentReport = pointing_device_get_report(); if (record->event.pressed) { if (shift_held && shift_suspended){ @@ -343,7 +343,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { pointing_device_set_report(currentReport); returnVal = false; break; - case MS_BTN3: + case CK_MSE3: currentReport = pointing_device_get_report(); if (record->event.pressed) { if (shift_held && shift_suspended){ diff --git a/quantum/action.c b/quantum/action.c index 74ef55e5eb..a39631ba3e 100644 --- a/quantum/action.c +++ b/quantum/action.c @@ -329,7 +329,7 @@ void register_mouse(uint8_t mouse_keycode, bool pressed) { // should mousekeys send report, or does something else handle this? switch (mouse_keycode) { # if defined(PS2_MOUSE_ENABLE) || defined(POINTING_DEVICE_ENABLE) - case KC_MS_BTN1 ... KC_MS_BTN8: + case QK_MOUSE_BUTTON_1 ... QK_MOUSE_BUTTON_8: // let pointing device handle the buttons // expand if/when it handles more of the code # if defined(POINTING_DEVICE_ENABLE) @@ -351,8 +351,8 @@ void register_mouse(uint8_t mouse_keycode, bool pressed) { #ifdef PS2_MOUSE_ENABLE // make sure that ps2 mouse has button report synced - if (KC_MS_BTN1 <= mouse_keycode && mouse_keycode <= KC_MS_BTN3) { - uint8_t tmp_button_msk = MOUSE_BTN_MASK(mouse_keycode - KC_MS_BTN1); + if (QK_MOUSE_BUTTON_1 <= mouse_keycode && mouse_keycode <= QK_MOUSE_BUTTON_3) { + uint8_t tmp_button_msk = MOUSE_BTN_MASK(mouse_keycode - QK_MOUSE_BUTTON_1); tp_buttons = pressed ? tp_buttons | tmp_button_msk : tp_buttons & ~tmp_button_msk; } #endif diff --git a/quantum/encoder.c b/quantum/encoder.c index 2ddbf3ee1e..27d7b1fc80 100644 --- a/quantum/encoder.c +++ b/quantum/encoder.c @@ -160,7 +160,7 @@ __attribute__((weak)) bool encoder_update_kb(uint8_t index, bool clockwise) { # if defined(EXTRAKEY_ENABLE) tap_code_delay(KC_VOLU, 10); # elif defined(MOUSEKEY_ENABLE) - tap_code_delay(KC_MS_WH_UP, 10); + tap_code_delay(QK_MOUSE_WHEEL_UP, 10); # else tap_code_delay(KC_PGDN, 10); # endif @@ -168,7 +168,7 @@ __attribute__((weak)) bool encoder_update_kb(uint8_t index, bool clockwise) { # if defined(EXTRAKEY_ENABLE) tap_code_delay(KC_VOLD, 10); # elif defined(MOUSEKEY_ENABLE) - tap_code_delay(KC_MS_WH_DOWN, 10); + tap_code_delay(QK_MOUSE_WHEEL_DOWN, 10); # else tap_code_delay(KC_PGUP, 10); # endif diff --git a/quantum/keycode.h b/quantum/keycode.h index df1452d296..4ff6894a01 100644 --- a/quantum/keycode.h +++ b/quantum/keycode.h @@ -29,10 +29,10 @@ along with this program. If not, see . #define IS_ANY(code) (KC_A <= (code) && (code) <= 0xFF) #define IS_MOUSEKEY(code) IS_MOUSE_KEYCODE(code) -#define IS_MOUSEKEY_MOVE(code) (KC_MS_UP <= (code) && (code) <= KC_MS_RIGHT) -#define IS_MOUSEKEY_BUTTON(code) (KC_MS_BTN1 <= (code) && (code) <= KC_MS_BTN8) -#define IS_MOUSEKEY_WHEEL(code) (KC_MS_WH_UP <= (code) && (code) <= KC_MS_WH_RIGHT) -#define IS_MOUSEKEY_ACCEL(code) (KC_MS_ACCEL0 <= (code) && (code) <= KC_MS_ACCEL2) +#define IS_MOUSEKEY_MOVE(code) (QK_MOUSE_CURSOR_UP <= (code) && (code) <= QK_MOUSE_CURSOR_RIGHT) +#define IS_MOUSEKEY_BUTTON(code) (QK_MOUSE_BUTTON_1 <= (code) && (code) <= QK_MOUSE_BUTTON_8) +#define IS_MOUSEKEY_WHEEL(code) (QK_MOUSE_WHEEL_UP <= (code) && (code) <= QK_MOUSE_WHEEL_RIGHT) +#define IS_MOUSEKEY_ACCEL(code) (QK_MOUSE_ACCELERATION_0 <= (code) && (code) <= QK_MOUSE_ACCELERATION_2) #define MOD_BIT(code) (1 << ((code)&0x07)) diff --git a/quantum/keycodes.h b/quantum/keycodes.h index c92028ab43..f461e4a586 100644 --- a/quantum/keycodes.h +++ b/quantum/keycodes.h @@ -283,25 +283,25 @@ enum qk_keycode_defines { KC_ASSISTANT = 0x00C0, KC_MISSION_CONTROL = 0x00C1, KC_LAUNCHPAD = 0x00C2, - KC_MS_UP = 0x00CD, - KC_MS_DOWN = 0x00CE, - KC_MS_LEFT = 0x00CF, - KC_MS_RIGHT = 0x00D0, - KC_MS_BTN1 = 0x00D1, - KC_MS_BTN2 = 0x00D2, - KC_MS_BTN3 = 0x00D3, - KC_MS_BTN4 = 0x00D4, - KC_MS_BTN5 = 0x00D5, - KC_MS_BTN6 = 0x00D6, - KC_MS_BTN7 = 0x00D7, - KC_MS_BTN8 = 0x00D8, - KC_MS_WH_UP = 0x00D9, - KC_MS_WH_DOWN = 0x00DA, - KC_MS_WH_LEFT = 0x00DB, - KC_MS_WH_RIGHT = 0x00DC, - KC_MS_ACCEL0 = 0x00DD, - KC_MS_ACCEL1 = 0x00DE, - KC_MS_ACCEL2 = 0x00DF, + QK_MOUSE_CURSOR_UP = 0x00CD, + QK_MOUSE_CURSOR_DOWN = 0x00CE, + QK_MOUSE_CURSOR_LEFT = 0x00CF, + QK_MOUSE_CURSOR_RIGHT = 0x00D0, + QK_MOUSE_BUTTON_1 = 0x00D1, + QK_MOUSE_BUTTON_2 = 0x00D2, + QK_MOUSE_BUTTON_3 = 0x00D3, + QK_MOUSE_BUTTON_4 = 0x00D4, + QK_MOUSE_BUTTON_5 = 0x00D5, + QK_MOUSE_BUTTON_6 = 0x00D6, + QK_MOUSE_BUTTON_7 = 0x00D7, + QK_MOUSE_BUTTON_8 = 0x00D8, + QK_MOUSE_WHEEL_UP = 0x00D9, + QK_MOUSE_WHEEL_DOWN = 0x00DA, + QK_MOUSE_WHEEL_LEFT = 0x00DB, + QK_MOUSE_WHEEL_RIGHT = 0x00DC, + QK_MOUSE_ACCELERATION_0 = 0x00DD, + QK_MOUSE_ACCELERATION_1 = 0x00DE, + QK_MOUSE_ACCELERATION_2 = 0x00DF, KC_LEFT_CTRL = 0x00E0, KC_LEFT_SHIFT = 0x00E1, KC_LEFT_ALT = 0x00E2, @@ -926,25 +926,25 @@ enum qk_keycode_defines { KC_ASST = KC_ASSISTANT, KC_MCTL = KC_MISSION_CONTROL, KC_LPAD = KC_LAUNCHPAD, - KC_MS_U = KC_MS_UP, - KC_MS_D = KC_MS_DOWN, - KC_MS_L = KC_MS_LEFT, - KC_MS_R = KC_MS_RIGHT, - KC_BTN1 = KC_MS_BTN1, - KC_BTN2 = KC_MS_BTN2, - KC_BTN3 = KC_MS_BTN3, - KC_BTN4 = KC_MS_BTN4, - KC_BTN5 = KC_MS_BTN5, - KC_BTN6 = KC_MS_BTN6, - KC_BTN7 = KC_MS_BTN7, - KC_BTN8 = KC_MS_BTN8, - KC_WH_U = KC_MS_WH_UP, - KC_WH_D = KC_MS_WH_DOWN, - KC_WH_L = KC_MS_WH_LEFT, - KC_WH_R = KC_MS_WH_RIGHT, - KC_ACL0 = KC_MS_ACCEL0, - KC_ACL1 = KC_MS_ACCEL1, - KC_ACL2 = KC_MS_ACCEL2, + MS_UP = QK_MOUSE_CURSOR_UP, + MS_DOWN = QK_MOUSE_CURSOR_DOWN, + MS_LEFT = QK_MOUSE_CURSOR_LEFT, + MS_RGHT = QK_MOUSE_CURSOR_RIGHT, + MS_BTN1 = QK_MOUSE_BUTTON_1, + MS_BTN2 = QK_MOUSE_BUTTON_2, + MS_BTN3 = QK_MOUSE_BUTTON_3, + MS_BTN4 = QK_MOUSE_BUTTON_4, + MS_BTN5 = QK_MOUSE_BUTTON_5, + MS_BTN6 = QK_MOUSE_BUTTON_6, + MS_BTN7 = QK_MOUSE_BUTTON_7, + MS_BTN8 = QK_MOUSE_BUTTON_8, + MS_WHLU = QK_MOUSE_WHEEL_UP, + MS_WHLD = QK_MOUSE_WHEEL_DOWN, + MS_WHLL = QK_MOUSE_WHEEL_LEFT, + MS_WHLR = QK_MOUSE_WHEEL_RIGHT, + MS_ACL0 = QK_MOUSE_ACCELERATION_0, + MS_ACL1 = QK_MOUSE_ACCELERATION_1, + MS_ACL2 = QK_MOUSE_ACCELERATION_2, KC_LCTL = KC_LEFT_CTRL, KC_LSFT = KC_LEFT_SHIFT, KC_LALT = KC_LEFT_ALT, @@ -1457,7 +1457,7 @@ enum qk_keycode_defines { #define IS_BASIC_KEYCODE(code) ((code) >= KC_A && (code) <= KC_EXSEL) #define IS_SYSTEM_KEYCODE(code) ((code) >= KC_SYSTEM_POWER && (code) <= KC_SYSTEM_WAKE) #define IS_CONSUMER_KEYCODE(code) ((code) >= KC_AUDIO_MUTE && (code) <= KC_LAUNCHPAD) -#define IS_MOUSE_KEYCODE(code) ((code) >= KC_MS_UP && (code) <= KC_MS_ACCEL2) +#define IS_MOUSE_KEYCODE(code) ((code) >= QK_MOUSE_CURSOR_UP && (code) <= QK_MOUSE_ACCELERATION_2) #define IS_MODIFIER_KEYCODE(code) ((code) >= KC_LEFT_CTRL && (code) <= KC_RIGHT_GUI) #define IS_SWAP_HANDS_KEYCODE(code) ((code) >= QK_SWAP_HANDS_TOGGLE && (code) <= QK_SWAP_HANDS_ONE_SHOT) #define IS_MAGIC_KEYCODE(code) ((code) >= QK_MAGIC_SWAP_CONTROL_CAPS_LOCK && (code) <= QK_MAGIC_TOGGLE_ESCAPE_CAPS_LOCK) @@ -1482,7 +1482,7 @@ enum qk_keycode_defines { #define BASIC_KEYCODE_RANGE KC_A ... KC_EXSEL #define SYSTEM_KEYCODE_RANGE KC_SYSTEM_POWER ... KC_SYSTEM_WAKE #define CONSUMER_KEYCODE_RANGE KC_AUDIO_MUTE ... KC_LAUNCHPAD -#define MOUSE_KEYCODE_RANGE KC_MS_UP ... KC_MS_ACCEL2 +#define MOUSE_KEYCODE_RANGE QK_MOUSE_CURSOR_UP ... QK_MOUSE_ACCELERATION_2 #define MODIFIER_KEYCODE_RANGE KC_LEFT_CTRL ... KC_RIGHT_GUI #define SWAP_HANDS_KEYCODE_RANGE QK_SWAP_HANDS_TOGGLE ... QK_SWAP_HANDS_ONE_SHOT #define MAGIC_KEYCODE_RANGE QK_MAGIC_SWAP_CONTROL_CAPS_LOCK ... QK_MAGIC_TOGGLE_ESCAPE_CAPS_LOCK diff --git a/quantum/mousekey.c b/quantum/mousekey.c index 3910811752..8683cfdffa 100644 --- a/quantum/mousekey.c +++ b/quantum/mousekey.c @@ -407,42 +407,42 @@ void mousekey_on(uint8_t code) { # ifdef MOUSEKEY_INERTIA // initial keypress sets impulse and activates first frame of movement - if ((code == KC_MS_UP) || (code == KC_MS_DOWN)) { - mousekey_y_dir = (code == KC_MS_DOWN) ? 1 : -1; + if ((code == QK_MOUSE_CURSOR_UP) || (code == QK_MOUSE_CURSOR_DOWN)) { + mousekey_y_dir = (code == QK_MOUSE_CURSOR_DOWN) ? 1 : -1; if (mousekey_frame < 2) mouse_report.y = move_unit(1); - } else if ((code == KC_MS_LEFT) || (code == KC_MS_RIGHT)) { - mousekey_x_dir = (code == KC_MS_RIGHT) ? 1 : -1; + } else if ((code == QK_MOUSE_CURSOR_LEFT) || (code == QK_MOUSE_CURSOR_RIGHT)) { + mousekey_x_dir = (code == QK_MOUSE_CURSOR_RIGHT) ? 1 : -1; if (mousekey_frame < 2) mouse_report.x = move_unit(0); } # else // no inertia - if (code == KC_MS_UP) + if (code == QK_MOUSE_CURSOR_UP) mouse_report.y = move_unit() * -1; - else if (code == KC_MS_DOWN) + else if (code == QK_MOUSE_CURSOR_DOWN) mouse_report.y = move_unit(); - else if (code == KC_MS_LEFT) + else if (code == QK_MOUSE_CURSOR_LEFT) mouse_report.x = move_unit() * -1; - else if (code == KC_MS_RIGHT) + else if (code == QK_MOUSE_CURSOR_RIGHT) mouse_report.x = move_unit(); # endif // inertia or not - else if (code == KC_MS_WH_UP) + else if (code == QK_MOUSE_WHEEL_UP) mouse_report.v = wheel_unit(); - else if (code == KC_MS_WH_DOWN) + else if (code == QK_MOUSE_WHEEL_DOWN) mouse_report.v = wheel_unit() * -1; - else if (code == KC_MS_WH_LEFT) + else if (code == QK_MOUSE_WHEEL_LEFT) mouse_report.h = wheel_unit() * -1; - else if (code == KC_MS_WH_RIGHT) + else if (code == QK_MOUSE_WHEEL_RIGHT) mouse_report.h = wheel_unit(); else if (IS_MOUSEKEY_BUTTON(code)) - mouse_report.buttons |= 1 << (code - KC_MS_BTN1); - else if (code == KC_MS_ACCEL0) + mouse_report.buttons |= 1 << (code - QK_MOUSE_BUTTON_1); + else if (code == QK_MOUSE_ACCELERATION_0) mousekey_accel |= (1 << 0); - else if (code == KC_MS_ACCEL1) + else if (code == QK_MOUSE_ACCELERATION_1) mousekey_accel |= (1 << 1); - else if (code == KC_MS_ACCEL2) + else if (code == QK_MOUSE_ACCELERATION_2) mousekey_accel |= (1 << 2); } @@ -450,43 +450,43 @@ void mousekey_off(uint8_t code) { # ifdef MOUSEKEY_INERTIA // key release clears impulse unless opposite direction is held - if ((code == KC_MS_UP) && (mousekey_y_dir < 1)) + if ((code == QK_MOUSE_CURSOR_UP) && (mousekey_y_dir < 1)) mousekey_y_dir = 0; - else if ((code == KC_MS_DOWN) && (mousekey_y_dir > -1)) + else if ((code == QK_MOUSE_CURSOR_DOWN) && (mousekey_y_dir > -1)) mousekey_y_dir = 0; - else if ((code == KC_MS_LEFT) && (mousekey_x_dir < 1)) + else if ((code == QK_MOUSE_CURSOR_LEFT) && (mousekey_x_dir < 1)) mousekey_x_dir = 0; - else if ((code == KC_MS_RIGHT) && (mousekey_x_dir > -1)) + else if ((code == QK_MOUSE_CURSOR_RIGHT) && (mousekey_x_dir > -1)) mousekey_x_dir = 0; # else // no inertia - if (code == KC_MS_UP && mouse_report.y < 0) + if (code == QK_MOUSE_CURSOR_UP && mouse_report.y < 0) mouse_report.y = 0; - else if (code == KC_MS_DOWN && mouse_report.y > 0) + else if (code == QK_MOUSE_CURSOR_DOWN && mouse_report.y > 0) mouse_report.y = 0; - else if (code == KC_MS_LEFT && mouse_report.x < 0) + else if (code == QK_MOUSE_CURSOR_LEFT && mouse_report.x < 0) mouse_report.x = 0; - else if (code == KC_MS_RIGHT && mouse_report.x > 0) + else if (code == QK_MOUSE_CURSOR_RIGHT && mouse_report.x > 0) mouse_report.x = 0; # endif // inertia or not - else if (code == KC_MS_WH_UP && mouse_report.v > 0) + else if (code == QK_MOUSE_WHEEL_UP && mouse_report.v > 0) mouse_report.v = 0; - else if (code == KC_MS_WH_DOWN && mouse_report.v < 0) + else if (code == QK_MOUSE_WHEEL_DOWN && mouse_report.v < 0) mouse_report.v = 0; - else if (code == KC_MS_WH_LEFT && mouse_report.h < 0) + else if (code == QK_MOUSE_WHEEL_LEFT && mouse_report.h < 0) mouse_report.h = 0; - else if (code == KC_MS_WH_RIGHT && mouse_report.h > 0) + else if (code == QK_MOUSE_WHEEL_RIGHT && mouse_report.h > 0) mouse_report.h = 0; else if (IS_MOUSEKEY_BUTTON(code)) - mouse_report.buttons &= ~(1 << (code - KC_MS_BTN1)); - else if (code == KC_MS_ACCEL0) + mouse_report.buttons &= ~(1 << (code - QK_MOUSE_BUTTON_1)); + else if (code == QK_MOUSE_ACCELERATION_0) mousekey_accel &= ~(1 << 0); - else if (code == KC_MS_ACCEL1) + else if (code == QK_MOUSE_ACCELERATION_1) mousekey_accel &= ~(1 << 1); - else if (code == KC_MS_ACCEL2) + else if (code == QK_MOUSE_ACCELERATION_2) mousekey_accel &= ~(1 << 2); if (mouse_report.x == 0 && mouse_report.y == 0) { mousekey_repeat = 0; @@ -568,29 +568,29 @@ void mousekey_on(uint8_t code) { uint16_t const c_offset = c_offsets[mk_speed]; uint16_t const w_offset = w_offsets[mk_speed]; uint8_t const old_speed = mk_speed; - if (code == KC_MS_UP) + if (code == QK_MOUSE_CURSOR_UP) mouse_report.y = c_offset * -1; - else if (code == KC_MS_DOWN) + else if (code == QK_MOUSE_CURSOR_DOWN) mouse_report.y = c_offset; - else if (code == KC_MS_LEFT) + else if (code == QK_MOUSE_CURSOR_LEFT) mouse_report.x = c_offset * -1; - else if (code == KC_MS_RIGHT) + else if (code == QK_MOUSE_CURSOR_RIGHT) mouse_report.x = c_offset; - else if (code == KC_MS_WH_UP) + else if (code == QK_MOUSE_WHEEL_UP) mouse_report.v = w_offset; - else if (code == KC_MS_WH_DOWN) + else if (code == QK_MOUSE_WHEEL_DOWN) mouse_report.v = w_offset * -1; - else if (code == KC_MS_WH_LEFT) + else if (code == QK_MOUSE_WHEEL_LEFT) mouse_report.h = w_offset * -1; - else if (code == KC_MS_WH_RIGHT) + else if (code == QK_MOUSE_WHEEL_RIGHT) mouse_report.h = w_offset; else if (IS_MOUSEKEY_BUTTON(code)) - mouse_report.buttons |= 1 << (code - KC_MS_BTN1); - else if (code == KC_MS_ACCEL0) + mouse_report.buttons |= 1 << (code - QK_MOUSE_BUTTON_1); + else if (code == QK_MOUSE_ACCELERATION_0) mk_speed = mkspd_0; - else if (code == KC_MS_ACCEL1) + else if (code == QK_MOUSE_ACCELERATION_1) mk_speed = mkspd_1; - else if (code == KC_MS_ACCEL2) + else if (code == QK_MOUSE_ACCELERATION_2) mk_speed = mkspd_2; if (mk_speed != old_speed) adjust_speed(); } @@ -599,30 +599,30 @@ void mousekey_off(uint8_t code) { # ifdef MK_MOMENTARY_ACCEL uint8_t const old_speed = mk_speed; # endif - if (code == KC_MS_UP && mouse_report.y < 0) + if (code == QK_MOUSE_CURSOR_UP && mouse_report.y < 0) mouse_report.y = 0; - else if (code == KC_MS_DOWN && mouse_report.y > 0) + else if (code == QK_MOUSE_CURSOR_DOWN && mouse_report.y > 0) mouse_report.y = 0; - else if (code == KC_MS_LEFT && mouse_report.x < 0) + else if (code == QK_MOUSE_CURSOR_LEFT && mouse_report.x < 0) mouse_report.x = 0; - else if (code == KC_MS_RIGHT && mouse_report.x > 0) + else if (code == QK_MOUSE_CURSOR_RIGHT && mouse_report.x > 0) mouse_report.x = 0; - else if (code == KC_MS_WH_UP && mouse_report.v > 0) + else if (code == QK_MOUSE_WHEEL_UP && mouse_report.v > 0) mouse_report.v = 0; - else if (code == KC_MS_WH_DOWN && mouse_report.v < 0) + else if (code == QK_MOUSE_WHEEL_DOWN && mouse_report.v < 0) mouse_report.v = 0; - else if (code == KC_MS_WH_LEFT && mouse_report.h < 0) + else if (code == QK_MOUSE_WHEEL_LEFT && mouse_report.h < 0) mouse_report.h = 0; - else if (code == KC_MS_WH_RIGHT && mouse_report.h > 0) + else if (code == QK_MOUSE_WHEEL_RIGHT && mouse_report.h > 0) mouse_report.h = 0; else if (IS_MOUSEKEY_BUTTON(code)) - mouse_report.buttons &= ~(1 << (code - KC_MS_BTN1)); + mouse_report.buttons &= ~(1 << (code - QK_MOUSE_BUTTON_1)); # ifdef MK_MOMENTARY_ACCEL - else if (code == KC_MS_ACCEL0) + else if (code == QK_MOUSE_ACCELERATION_0) mk_speed = mkspd_DEFAULT; - else if (code == KC_MS_ACCEL1) + else if (code == QK_MOUSE_ACCELERATION_1) mk_speed = mkspd_DEFAULT; - else if (code == KC_MS_ACCEL2) + else if (code == QK_MOUSE_ACCELERATION_2) mk_speed = mkspd_DEFAULT; if (mk_speed != old_speed) adjust_speed(); # endif diff --git a/quantum/pointing_device/pointing_device.c b/quantum/pointing_device/pointing_device.c index 4682aceb14..74ce9108a9 100644 --- a/quantum/pointing_device/pointing_device.c +++ b/quantum/pointing_device/pointing_device.c @@ -498,7 +498,7 @@ __attribute__((weak)) report_mouse_t pointing_device_task_combined_user(report_m __attribute__((weak)) void pointing_device_keycode_handler(uint16_t keycode, bool pressed) { if IS_MOUSEKEY_BUTTON (keycode) { - local_mouse_report.buttons = pointing_device_handle_buttons(local_mouse_report.buttons, pressed, keycode - KC_MS_BTN1); + local_mouse_report.buttons = pointing_device_handle_buttons(local_mouse_report.buttons, pressed, keycode - QK_MOUSE_BUTTON_1); pointing_device_send(); } } diff --git a/quantum/pointing_device/pointing_device_auto_mouse.h b/quantum/pointing_device/pointing_device_auto_mouse.h index a596c065a3..2c0d4d1043 100644 --- a/quantum/pointing_device/pointing_device_auto_mouse.h +++ b/quantum/pointing_device/pointing_device_auto_mouse.h @@ -37,7 +37,7 @@ # define AUTO_MOUSE_TIME 650 #endif #ifndef AUTO_MOUSE_DELAY -# define AUTO_MOUSE_DELAY GET_TAPPING_TERM(KC_MS_BTN1, &(keyrecord_t){}) +# define AUTO_MOUSE_DELAY GET_TAPPING_TERM(QK_MOUSE_BUTTON_1, &(keyrecord_t){}) #endif #ifndef AUTO_MOUSE_DEBOUNCE # define AUTO_MOUSE_DEBOUNCE 25 diff --git a/quantum/quantum_keycodes_legacy.h b/quantum/quantum_keycodes_legacy.h index 6ea5e13f3a..e1562077e5 100644 --- a/quantum/quantum_keycodes_legacy.h +++ b/quantum/quantum_keycodes_legacy.h @@ -16,3 +16,42 @@ #define RGB_VAD QK_UNDERGLOW_VALUE_DOWN #define RGB_SPI QK_UNDERGLOW_SPEED_UP #define RGB_SPD QK_UNDERGLOW_SPEED_DOWN + +#define KC_MS_UP QK_MOUSE_CURSOR_UP +#define KC_MS_U QK_MOUSE_CURSOR_UP +#define KC_MS_DOWN QK_MOUSE_CURSOR_DOWN +#define KC_MS_D QK_MOUSE_CURSOR_DOWN +#define KC_MS_LEFT QK_MOUSE_CURSOR_LEFT +#define KC_MS_L QK_MOUSE_CURSOR_LEFT +#define KC_MS_RIGHT QK_MOUSE_CURSOR_RIGHT +#define KC_MS_R QK_MOUSE_CURSOR_RIGHT +#define KC_MS_BTN1 QK_MOUSE_BUTTON_1 +#define KC_BTN1 QK_MOUSE_BUTTON_1 +#define KC_MS_BTN2 QK_MOUSE_BUTTON_2 +#define KC_BTN2 QK_MOUSE_BUTTON_2 +#define KC_MS_BTN3 QK_MOUSE_BUTTON_3 +#define KC_BTN3 QK_MOUSE_BUTTON_3 +#define KC_MS_BTN4 QK_MOUSE_BUTTON_4 +#define KC_BTN4 QK_MOUSE_BUTTON_4 +#define KC_MS_BTN5 QK_MOUSE_BUTTON_5 +#define KC_BTN5 QK_MOUSE_BUTTON_5 +#define KC_MS_BTN6 QK_MOUSE_BUTTON_6 +#define KC_BTN6 QK_MOUSE_BUTTON_6 +#define KC_MS_BTN7 QK_MOUSE_BUTTON_7 +#define KC_BTN7 QK_MOUSE_BUTTON_7 +#define KC_MS_BTN8 QK_MOUSE_BUTTON_8 +#define KC_BTN8 QK_MOUSE_BUTTON_8 +#define KC_MS_WH_UP QK_MOUSE_WHEEL_UP +#define KC_WH_U QK_MOUSE_WHEEL_UP +#define KC_MS_WH_DOWN QK_MOUSE_WHEEL_DOWN +#define KC_WH_D QK_MOUSE_WHEEL_DOWN +#define KC_MS_WH_LEFT QK_MOUSE_WHEEL_LEFT +#define KC_WH_L QK_MOUSE_WHEEL_LEFT +#define KC_MS_WH_RIGHT QK_MOUSE_WHEEL_RIGHT +#define KC_WH_R QK_MOUSE_WHEEL_RIGHT +#define KC_MS_ACCEL0 QK_MOUSE_ACCELERATION_0 +#define KC_ACL0 QK_MOUSE_ACCELERATION_0 +#define KC_MS_ACCEL1 QK_MOUSE_ACCELERATION_1 +#define KC_ACL1 QK_MOUSE_ACCELERATION_1 +#define KC_MS_ACCEL2 QK_MOUSE_ACCELERATION_2 +#define KC_ACL2 QK_MOUSE_ACCELERATION_2 diff --git a/quantum/repeat_key.c b/quantum/repeat_key.c index 4567428723..56f242f8b8 100644 --- a/quantum/repeat_key.c +++ b/quantum/repeat_key.c @@ -220,10 +220,10 @@ uint16_t get_alt_repeat_key_keycode(void) { {KC_BRIU, KC_BRID}, // Brightness Up / Down. #endif // EXTRAKEY_ENABLE #ifdef MOUSEKEY_ENABLE - {KC_MS_L, KC_MS_R}, // Mouse Cursor Left / Right. - {KC_MS_U, KC_MS_D}, // Mouse Cursor Up / Down. - {KC_WH_L, KC_WH_R}, // Mouse Wheel Left / Right. - {KC_WH_U, KC_WH_D}, // Mouse Wheel Up / Down. + {MS_LEFT, MS_RGHT}, // Mouse Cursor Left / Right. + {MS_UP, MS_DOWN}, // Mouse Cursor Up / Down. + {MS_WHLL, MS_WHLR}, // Mouse Wheel Left / Right. + {MS_WHLU, MS_WHLD}, // Mouse Wheel Up / Down. #endif // MOUSEKEY_ENABLE }; // clang-format on diff --git a/tests/test_common/keycode_table.cpp b/tests/test_common/keycode_table.cpp index 18dd536027..4c28ab4d20 100644 --- a/tests/test_common/keycode_table.cpp +++ b/tests/test_common/keycode_table.cpp @@ -225,25 +225,25 @@ std::map KEYCODE_ID_TABLE = { {KC_ASSISTANT, "KC_ASSISTANT"}, {KC_MISSION_CONTROL, "KC_MISSION_CONTROL"}, {KC_LAUNCHPAD, "KC_LAUNCHPAD"}, - {KC_MS_UP, "KC_MS_UP"}, - {KC_MS_DOWN, "KC_MS_DOWN"}, - {KC_MS_LEFT, "KC_MS_LEFT"}, - {KC_MS_RIGHT, "KC_MS_RIGHT"}, - {KC_MS_BTN1, "KC_MS_BTN1"}, - {KC_MS_BTN2, "KC_MS_BTN2"}, - {KC_MS_BTN3, "KC_MS_BTN3"}, - {KC_MS_BTN4, "KC_MS_BTN4"}, - {KC_MS_BTN5, "KC_MS_BTN5"}, - {KC_MS_BTN6, "KC_MS_BTN6"}, - {KC_MS_BTN7, "KC_MS_BTN7"}, - {KC_MS_BTN8, "KC_MS_BTN8"}, - {KC_MS_WH_UP, "KC_MS_WH_UP"}, - {KC_MS_WH_DOWN, "KC_MS_WH_DOWN"}, - {KC_MS_WH_LEFT, "KC_MS_WH_LEFT"}, - {KC_MS_WH_RIGHT, "KC_MS_WH_RIGHT"}, - {KC_MS_ACCEL0, "KC_MS_ACCEL0"}, - {KC_MS_ACCEL1, "KC_MS_ACCEL1"}, - {KC_MS_ACCEL2, "KC_MS_ACCEL2"}, + {QK_MOUSE_CURSOR_UP, "QK_MOUSE_CURSOR_UP"}, + {QK_MOUSE_CURSOR_DOWN, "QK_MOUSE_CURSOR_DOWN"}, + {QK_MOUSE_CURSOR_LEFT, "QK_MOUSE_CURSOR_LEFT"}, + {QK_MOUSE_CURSOR_RIGHT, "QK_MOUSE_CURSOR_RIGHT"}, + {QK_MOUSE_BUTTON_1, "QK_MOUSE_BUTTON_1"}, + {QK_MOUSE_BUTTON_2, "QK_MOUSE_BUTTON_2"}, + {QK_MOUSE_BUTTON_3, "QK_MOUSE_BUTTON_3"}, + {QK_MOUSE_BUTTON_4, "QK_MOUSE_BUTTON_4"}, + {QK_MOUSE_BUTTON_5, "QK_MOUSE_BUTTON_5"}, + {QK_MOUSE_BUTTON_6, "QK_MOUSE_BUTTON_6"}, + {QK_MOUSE_BUTTON_7, "QK_MOUSE_BUTTON_7"}, + {QK_MOUSE_BUTTON_8, "QK_MOUSE_BUTTON_8"}, + {QK_MOUSE_WHEEL_UP, "QK_MOUSE_WHEEL_UP"}, + {QK_MOUSE_WHEEL_DOWN, "QK_MOUSE_WHEEL_DOWN"}, + {QK_MOUSE_WHEEL_LEFT, "QK_MOUSE_WHEEL_LEFT"}, + {QK_MOUSE_WHEEL_RIGHT, "QK_MOUSE_WHEEL_RIGHT"}, + {QK_MOUSE_ACCELERATION_0, "QK_MOUSE_ACCELERATION_0"}, + {QK_MOUSE_ACCELERATION_1, "QK_MOUSE_ACCELERATION_1"}, + {QK_MOUSE_ACCELERATION_2, "QK_MOUSE_ACCELERATION_2"}, {KC_LEFT_CTRL, "KC_LEFT_CTRL"}, {KC_LEFT_SHIFT, "KC_LEFT_SHIFT"}, {KC_LEFT_ALT, "KC_LEFT_ALT"},