You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

146 lines
8.1 KiB

2020 November 28 Breaking Changes Update (#11053) * Branch point for 2020 November 28 Breaking Change * Remove matrix_col_t to allow MATRIX_ROWS > 32 (#10183) * Add support for soft serial to ATmega32U2 (#10204) * Change MIDI velocity implementation to allow direct control of velocity value (#9940) * Add ability to build a subset of all keyboards based on platform. * Actually use eeprom_driver_init(). * Make bootloader_jump weak for ChibiOS. (#10417) * Joystick 16-bit support (#10439) * Per-encoder resolutions (#10259) * Share button state from mousekey to pointing_device (#10179) * Add hotfix for chibios keyboards not wake (#10088) * Add advanced/efficient RGB Matrix Indicators (#8564) * Naming change. * Support for STM32 GPIOF,G,H,I,J,K (#10206) * Add milc as a dependency and remove the installed milc (#10563) * ChibiOS upgrade: early init conversions (#10214) * ChibiOS upgrade: configuration file migrator (#9952) * Haptic and solenoid cleanup (#9700) * XD75 cleanup (#10524) * OLED display update interval support (#10388) * Add definition based on currently-selected serial driver. (#10716) * New feature: Retro Tapping per key (#10622) * Allow for modification of output RGB values when using rgblight/rgb_matrix. (#10638) * Add housekeeping task callbacks so that keyboards/keymaps are capable of executing code for each main loop iteration. (#10530) * Rescale both ChibiOS and AVR backlighting. * Reduce Helix keyboard build variation (#8669) * Minor change to behavior allowing display updates to continue between task ticks (#10750) * Some GPIO manipulations in matrix.c change to atomic. (#10491) * qmk cformat (#10767) * [Keyboard] Update the Speedo firmware for v3.0 (#10657) * Maartenwut/Maarten namechange to evyd13/Evy (#10274) * [quantum] combine repeated lines of code (#10837) * Add step sequencer feature (#9703) * aeboards/ext65 refactor (#10820) * Refactor xelus/dawn60 for Rev2 later (#10584) * add DEBUG_MATRIX_SCAN_RATE_ENABLE to common_features.mk (#10824) * [Core] Added `add_oneshot_mods` & `del_oneshot_mods` (#10549) * update chibios os usb for the otg driver (#8893) * Remove HD44780 References, Part 4 (#10735) * [Keyboard] Add Valor FRL TKL (+refactor) (#10512) * Fix cursor position bug in oled_write_raw functions (#10800) * Fixup version.h writing when using SKIP_VERSION=yes (#10972) * Allow for certain code in the codebase assuming length of string. (#10974) * Add AT90USB support for serial.c (#10706) * Auto shift: support repeats and early registration (#9826) * Rename ledmatrix.h to match .c file (#7949) * Split RGB_MATRIX_ENABLE into _ENABLE and _DRIVER (#10231) * Split LED_MATRIX_ENABLE into _ENABLE and _DRIVER (#10840) * Merge point for 2020 Nov 28 Breaking Change
3 years ago
  1. # Mouse keys
  2. Mouse keys is a feature that allows you to emulate a mouse using your keyboard. You can move the pointer at different speeds, press 5 buttons and scroll in 8 directions.
  3. ## Adding mouse keys to your keyboard
  4. To use mouse keys, you must at least enable mouse keys support and map mouse actions to keys on your keyboard.
  5. ### Enabling mouse keys
  6. To enable mouse keys, add the following line to your keymap’s `rules.mk`:
  7. ```c
  8. MOUSEKEY_ENABLE = yes
  9. ```
  10. ### Mapping mouse actions
  11. In your keymap you can use the following keycodes to map key presses to mouse actions:
  12. |Key |Aliases |Description |
  13. |----------------|---------|-----------------|
  14. |`KC_MS_UP` |`KC_MS_U`|Move cursor up |
  15. |`KC_MS_DOWN` |`KC_MS_D`|Move cursor down |
  16. |`KC_MS_LEFT` |`KC_MS_L`|Move cursor left |
  17. |`KC_MS_RIGHT` |`KC_MS_R`|Move cursor right|
  18. |`KC_MS_BTN1` |`KC_BTN1`|Press button 1 |
  19. |`KC_MS_BTN2` |`KC_BTN2`|Press button 2 |
  20. |`KC_MS_BTN3` |`KC_BTN3`|Press button 3 |
  21. |`KC_MS_BTN4` |`KC_BTN4`|Press button 4 |
  22. |`KC_MS_BTN5` |`KC_BTN5`|Press button 5 |
  23. |`KC_MS_WH_UP` |`KC_WH_U`|Move wheel up |
  24. |`KC_MS_WH_DOWN` |`KC_WH_D`|Move wheel down |
  25. |`KC_MS_WH_LEFT` |`KC_WH_L`|Move wheel left |
  26. |`KC_MS_WH_RIGHT`|`KC_WH_R`|Move wheel right |
  27. |`KC_MS_ACCEL0` |`KC_ACL0`|Set speed to 0 |
  28. |`KC_MS_ACCEL1` |`KC_ACL1`|Set speed to 1 |
  29. |`KC_MS_ACCEL2` |`KC_ACL2`|Set speed to 2 |
  30. ## Configuring mouse keys
  31. Mouse keys supports three different modes to move the cursor:
  32. * **Accelerated (default):** Holding movement keys accelerates the cursor until it reaches its maximum speed.
  33. * **Constant:** Holding movement keys moves the cursor at constant speeds.
  34. * **Combined:** Holding movement keys accelerates the cursor until it reaches its maximum speed, but holding acceleration and movement keys simultaneously moves the cursor at constant speeds.
  35. The same principle applies to scrolling.
  36. Configuration options that are times, intervals or delays are given in milliseconds. Scroll speed is given as multiples of the default scroll step. For example, a scroll speed of 8 means that each scroll action covers 8 times the length of the default scroll step as defined by your operating system or application.
  37. ### Accelerated mode
  38. This is the default mode. You can adjust the cursor and scrolling acceleration using the following settings in your keymap’s `config.h` file:
  39. |Define |Default|Description |
  40. |----------------------------|-------|---------------------------------------------------------|
  41. |`MOUSEKEY_DELAY` |300 |Delay between pressing a movement key and cursor movement|
  42. |`MOUSEKEY_INTERVAL` |50 |Time between cursor movements |
  43. |`MOUSEKEY_MAX_SPEED` |10 |Maximum cursor speed at which acceleration stops |
  44. |`MOUSEKEY_TIME_TO_MAX` |20 |Time until maximum cursor speed is reached |
  45. |`MOUSEKEY_WHEEL_DELAY` |300 |Delay between pressing a wheel key and wheel movement |
  46. |`MOUSEKEY_WHEEL_INTERVAL` |100 |Time between wheel movements |
  47. |`MOUSEKEY_WHEEL_MAX_SPEED` |8 |Maximum number of scroll steps per scroll action |
  48. |`MOUSEKEY_WHEEL_TIME_TO_MAX`|40 |Time until maximum scroll speed is reached |
  49. Tips:
  50. * Setting `MOUSEKEY_DELAY` too low makes the cursor unresponsive. Setting it too high makes small movements difficult.
  51. * For smoother cursor movements, lower the value of `MOUSEKEY_INTERVAL`. If the refresh rate of your display is 60Hz, you could set it to `16` (1/60). As this raises the cursor speed significantly, you may want to lower `MOUSEKEY_MAX_SPEED`.
  52. * Setting `MOUSEKEY_TIME_TO_MAX` or `MOUSEKEY_WHEEL_TIME_TO_MAX` to `0` will disable acceleration for the cursor or scrolling respectively. This way you can make one of them constant while keeping the other accelerated, which is not possible in constant speed mode.
  53. * Setting `MOUSEKEY_WHEEL_INTERVAL` too low will make scrolling too fast. Setting it too high will make scrolling too slow when the wheel key is held down.
  54. Cursor acceleration uses the same algorithm as the X Window System MouseKeysAccel feature. You can read more about it [on Wikipedia](https://en.wikipedia.org/wiki/Mouse_keys).
  55. ### Constant mode
  56. 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.
  57. You can choose whether speed selection is momentary or tap-to-select:
  58. * **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.
  59. * **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.
  60. The default speeds from slowest to fastest are as follows:
  61. * **Momentary:** `KC_ACL0` < `KC_ACL1` < *unmodified* < `KC_ACL2`
  62. * **Tap-to-select:** `KC_ACL0` < `KC_ACL1` < `KC_ACL2`
  63. To use constant speed mode, you must at least define `MK_3_SPEED` in your keymap’s `config.h` file:
  64. ```c
  65. #define MK_3_SPEED
  66. ```
  67. To enable momentary mode, also define `MK_MOMENTARY_ACCEL`:
  68. ```c
  69. #define MK_MOMENTARY_ACCEL
  70. ```
  71. Use the following settings if you want to adjust cursor movement or scrolling:
  72. |Define |Default |Description |
  73. |---------------------|-------------|-------------------------------------------|
  74. |`MK_3_SPEED` |*Not defined*|Enable constant cursor speeds |
  75. |`MK_MOMENTARY_ACCEL` |*Not defined*|Enable momentary speed selection |
  76. |`MK_C_OFFSET_UNMOD` |16 |Cursor offset per movement (unmodified) |
  77. |`MK_C_INTERVAL_UNMOD`|16 |Time between cursor movements (unmodified) |
  78. |`MK_C_OFFSET_0` |1 |Cursor offset per movement (`KC_ACL0`) |
  79. |`MK_C_INTERVAL_0` |32 |Time between cursor movements (`KC_ACL0`) |
  80. |`MK_C_OFFSET_1` |4 |Cursor offset per movement (`KC_ACL1`) |
  81. |`MK_C_INTERVAL_1` |16 |Time between cursor movements (`KC_ACL1`) |
  82. |`MK_C_OFFSET_2` |32 |Cursor offset per movement (`KC_ACL2`) |
  83. |`MK_C_INTERVAL_2` |16 |Time between cursor movements (`KC_ACL2`) |
  84. |`MK_W_OFFSET_UNMOD` |1 |Scroll steps per scroll action (unmodified)|
  85. |`MK_W_INTERVAL_UNMOD`|40 |Time between scroll steps (unmodified) |
  86. |`MK_W_OFFSET_0` |1 |Scroll steps per scroll action (`KC_ACL0`) |
  87. |`MK_W_INTERVAL_0` |360 |Time between scroll steps (`KC_ACL0`) |
  88. |`MK_W_OFFSET_1` |1 |Scroll steps per scroll action (`KC_ACL1`) |
  89. |`MK_W_INTERVAL_1` |120 |Time between scroll steps (`KC_ACL1`) |
  90. |`MK_W_OFFSET_2` |1 |Scroll steps per scroll action (`KC_ACL2`) |
  91. |`MK_W_INTERVAL_2` |20 |Time between scroll steps (`KC_ACL2`) |
  92. ### Combined mode
  93. This mode functions like **Accelerated** mode, however, you can hold `KC_ACL0`, `KC_ACL1` and `KC_ACL2`
  94. to momentarily (while held) set the cursor and scroll speeds to constant speeds. When no acceleration
  95. keys are held, this mode is identical to **Accelerated** mode, and can be modified using all of the
  96. relevant settings.
  97. * **KC_ACL0:** This acceleration sets your cursor to the slowest possible speed. This is useful for very
  98. small and detailed movements of the cursor.
  99. * **KC_ACL1:** This acceleration sets your cursor to half the maximum (user defined) speed.
  100. * **KC_ACL2:** This acceleration sets your cursor to the maximum (computer defined) speed. This is
  101. useful for moving the cursor large distances without much accuracy.
  102. To use constant speed mode, you must at least define `MK_COMBINED` in your keymap’s `config.h` file:
  103. ```c
  104. #define MK_COMBINED
  105. ```
  106. ## Use with PS/2 Mouse and Pointing Device
  107. Mouse keys button state is shared with [PS/2 mouse](feature_ps2_mouse.md) and [pointing device](feature_pointing_device.md) so mouse keys button presses can be used for clicks and drags.