@@ -5,8 +5,7 @@ sidebar_label: Mouse Emulation
55
66## Summary
77
8- Mouse emulation behaviors send mouse events. Currently, only mouse button presses are supported, but movement
9- and scroll action support is planned for the future.
8+ Mouse emulation behaviors send mouse events, including mouse button presses, cursor movement and scrolling.
109
1110::: warning [ Refreshing the HID descriptor]
1211
@@ -17,14 +16,12 @@ The mouse functionality will not work over BLE until that is done.
1716
1817## Configuration Option
1918
20- This feature can be enabled or disabled explicitly via a config option:
19+ To use any of the behaviors documented here, the ZMK mouse feature must be enabled explicitly via a config option:
2120
2221```
2322CONFIG_ZMK_MOUSE=y
2423```
2524
26- If you use the mouse key press behavior in your keymap, the feature will automatically be enabled for you.
27-
2825## Mouse Button Defines
2926
3027To make it easier to encode the HID mouse button numeric values, include
@@ -69,3 +66,67 @@ This example will send press of the fourth mouse button when the binding is trig
6966```
7067&mkp MB4
7168```
69+
70+ ## Mouse Move
71+
72+ This behavior sends mouse X/Y movement events to the connected host.
73+
74+ ### Behavior Binding
75+
76+ - Reference: ` &mmv `
77+ - Parameter: A ` uint32 ` with 16-bits each used for vertical and horizontal velocity.
78+
79+ The following defines can be passed for the parameter:
80+
81+ | Define | Action |
82+ | :----------- | :--------- |
83+ | ` MOVE_UP ` | Move up |
84+ | ` MOVE_DOWN ` | Move down |
85+ | ` MOVE_LEFT ` | Move left |
86+ | ` MOVE_RIGHT ` | Move right |
87+
88+ ### Examples
89+
90+ The following will send a scroll down event to the host when pressed/held:
91+
92+ ```
93+ &mmv MOVE_DOWN
94+ ```
95+
96+ The following will send a scroll left event to the host when pressed/held:
97+
98+ ```
99+ &mmv MOVE_LEFT
100+ ```
101+
102+ ## Mouse Scroll
103+
104+ This behavior sends vertical and horizontal scroll events to the connected host.
105+
106+ ### Behavior Binding
107+
108+ - Reference: ` &msc `
109+ - Parameter: A ` uint32 ` with 16-bits each used for vertical and horizontal velocity.
110+
111+ The following defines can be passed for the parameter:
112+
113+ | Define | Action |
114+ | :----------- | :--------- |
115+ | ` MOVE_UP ` | Move up |
116+ | ` MOVE_DOWN ` | Move down |
117+ | ` MOVE_LEFT ` | Move left |
118+ | ` MOVE_RIGHT ` | Move right |
119+
120+ ### Examples
121+
122+ The following will send a scroll down event to the host when pressed/held:
123+
124+ ```
125+ &msc MOVE_DOWN
126+ ```
127+
128+ The following will send a scroll left event to the host when pressed/held:
129+
130+ ```
131+ &msc MOVE_LEFT
132+ ```
0 commit comments