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

feat(mouse): Added mouse emulation #778

Closed
wants to merge 30 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
b14b024
Preliminary work for mouse click
krikun98 Apr 27, 2021
54ac765
Fine-tuning report, 16 buttons
krikun98 Apr 28, 2021
016256b
Bluetooth tuning, mouse wheel and movement backend
krikun98 Apr 29, 2021
3fb874f
Mouse-related behaviours
Apr 29, 2021
dc2e30d
Add mouse movement event
Apr 29, 2021
ee51487
Continuous mouse movement prototype
Apr 29, 2021
e2b97f1
Add mouse behaviour documentation
May 1, 2021
a339a9a
Cleaning out prototype traces
krikun98 May 2, 2021
141a525
clang-format
krikun98 May 2, 2021
345ef42
Implemented Rinh's suggestion to remove deadlocks
dtsykunov May 2, 2021
58178a7
Raised BLE mouse report queue size
krikun98 May 2, 2021
571e457
Documentation refactor
krikun98 May 2, 2021
0893c76
Add the doc page to the sidebar
krikun98 May 2, 2021
fddadb9
Added new mouse movement macros
krikun98 May 3, 2021
9957b28
Review edits: macro, event override fix, cosmetics
krikun98 May 3, 2021
6de29af
Mouse movement coordinate signedness consistency
krikun98 May 3, 2021
359f35b
Reverted mouse buttons 9-16
krikun98 May 3, 2021
4d08f97
Report refactor (added macros)
krikun98 May 3, 2021
b4ec49e
Simplify binary arithmetic
okke-formsma May 14, 2021
728f42e
Modified mouse_timer_unref to account for errors
krikun98 May 14, 2021
8fc5962
feat(mouse keys): add events, smoothing and acceleration
okke-formsma May 14, 2021
eb089b5
Added dedicated mouse work queue option
krikun98 Aug 26, 2021
96660dc
Simplified tick rate and made it configurable
krikun98 Aug 27, 2021
0bcd44a
Add messages to BLE queue without a waiting interval
krikun98 Aug 30, 2021
992bbc0
Cleanup and acceleration fixes
krikun98 Sep 2, 2021
8088585
Send mouse messages from dedicated thread
krikun98 Sep 21, 2021
cbce1db
Added documentation for new features
krikun98 Sep 23, 2021
ec85b7a
Moved tick duration
krikun98 Sep 23, 2021
2bf5e44
clang-format
krikun98 Sep 23, 2021
ee855f4
prettier
krikun98 Sep 23, 2021
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
Prev Previous commit
Next Next commit
Added documentation for new features
  • Loading branch information
krikun98 committed Jan 28, 2022
commit cbce1dbf40525d569f0c4623d5a5a6251806646e
39 changes: 38 additions & 1 deletion docs/docs/behaviors/mouse-emulation.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,20 @@ Mouse emulation behaviors send mouse movements, button presses or scroll actions

Please view [`dt-bindings/zmk/mouse.h`](https://github.com/zmkfirmware/zmk/blob/main/app/include/dt-bindings/zmk/mouse.h) for a comprehensive list of signals.

## Configuration options

This feature should be enabled via a config option:
```
CONFIG_ZMK_MOUSE=y
```
This option enables several others.

### Dedicated thread processing
`CONFIG_ZMK_MOUSE_WORK_QUEUE_DEDICATED` is enabled by default and separates the processing of mouse signals into a dedicated thread, significantly improving performance.

### Tick rate configuration
`CONFIG_ZMK_MOUSE_TICK_DURATION` sets the tick rate for mouse polling. It is set to 8 ms. by default.

## Keycode Defines

To make it easier to encode the HID keycode numeric values, most keymaps include
Expand Down Expand Up @@ -52,7 +66,7 @@ Example:
&mmv MOVE_UP
```

## Mouse Wheel
## Mouse Scrolling

This behaviour is used to scroll, both horizontally and vertically.

Expand All @@ -67,3 +81,26 @@ Example:
```
&mwh SCROLL_UP
```

## Acceleration

Both mouse movement and scrolling have independently configurable acceleration profiles with three parameters: delay before movement, time to max speed and the acceleration exponent.
The exponent is usually set to 0 for constant speed, 1 for uniform acceleration or 2 for uniform jerk.

These profiles can be configured inside your keymap:

```
&mmv {
time-to-max-speed-ms = <500>;
};

&mwh {
acceleration-exponent=<1>;
};

/ {
keymap {
...
};
};
```