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

Normalise mouse keycodes #23975

Merged
merged 5 commits into from
Jul 3, 2024
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
Empty file.
175 changes: 175 additions & 0 deletions data/constants/keycodes/keycodes_0.0.5_basic.hjson
Original file line number Diff line number Diff line change
@@ -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"
]
}
}
}
8 changes: 4 additions & 4 deletions docs/features/encoders.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
Expand Down
82 changes: 41 additions & 41 deletions docs/features/mouse_keys.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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:

Expand All @@ -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:
Expand Down
8 changes: 4 additions & 4 deletions docs/features/repeat_key.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ with mods, like Ctrl + Left &harr; Ctrl + Right Arrow.
|`KC_UP` &harr; `KC_DOWN` | Up &harr; Down Arrow |
|`KC_HOME` &harr; `KC_END` | Home &harr; End |
|`KC_PGUP` &harr; `KC_PGDN` | Page Up &harr; Page Down |
|`KC_MS_L` &harr; `KC_MS_R` | Mouse Cursor Left &harr; Right |
|`KC_MS_U` &harr; `KC_MS_D` | Mouse Cursor Up &harr; Down |
|`KC_WH_L` &harr; `KC_WH_R` | Mouse Wheel Left &harr; Right |
|`KC_WH_U` &harr; `KC_WH_D` | Mouse Wheel Up &harr; Down |
|`MS_LEFT` &harr; `MS_RGHT` | Mouse Cursor Left &harr; Right |
|`MS_UP` &harr; `MS_DOWN` | Mouse Cursor Up &harr; Down |
|`MS_WHLL` &harr; `MS_WHLR` | Mouse Wheel Left &harr; Right |
|`MS_WHLU` &harr; `MS_WHLD` | Mouse Wheel Up &harr; Down |

**Misc**

Expand Down
39 changes: 21 additions & 18 deletions docs/keycodes.md
Original file line number Diff line number Diff line change
Expand Up @@ -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}

Expand Down
2 changes: 1 addition & 1 deletion drivers/sensors/cirque_pinnacle_gestures.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Loading
Loading