diff options
| author | Drashna Jaelre <drashna@live.com> | 2020-06-10 15:18:53 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-06-10 23:18:53 +0100 |
| commit | 573d1fbb929b83989e3b5933852282299d87d467 (patch) | |
| tree | 359682639557e2ba5b1e9e1968a587fc018aefd3 /docs/feature_pointing_device.md | |
| parent | 437446ba8f636afbc2048aa655fc1c2662fbe2ce (diff) | |
| download | qmk_firmware-573d1fbb929b83989e3b5933852282299d87d467.tar.gz qmk_firmware-573d1fbb929b83989e3b5933852282299d87d467.zip | |
Include `pointing_device_send` in docs (#9185)
Diffstat (limited to 'docs/feature_pointing_device.md')
| -rw-r--r-- | docs/feature_pointing_device.md | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/docs/feature_pointing_device.md b/docs/feature_pointing_device.md index f0b3d75bd..c9309d697 100644 --- a/docs/feature_pointing_device.md +++ b/docs/feature_pointing_device.md | |||
| @@ -21,7 +21,11 @@ Keep in mind that a report_mouse_t (here "mouseReport") has the following proper | |||
| 21 | * `mouseReport.h` - this is a signed int from -127 to 127 (not 128, this is defined in USB HID spec) representing horizontal scrolling (+ right, - left). | 21 | * `mouseReport.h` - this is a signed int from -127 to 127 (not 128, this is defined in USB HID spec) representing horizontal scrolling (+ right, - left). |
| 22 | * `mouseReport.buttons` - this is a uint8_t in which the last 5 bits are used. These bits represent the mouse button state - bit 3 is mouse button 5, and bit 7 is mouse button 1. | 22 | * `mouseReport.buttons` - this is a uint8_t in which the last 5 bits are used. These bits represent the mouse button state - bit 3 is mouse button 5, and bit 7 is mouse button 1. |
| 23 | 23 | ||
| 24 | When the mouse report is sent, the x, y, v, and h values are set to 0 (this is done in "pointing_device_send()", which can be overridden to avoid this behavior). This way, button states persist, but movement will only occur once. For further customization, both `pointing_device_init` and `pointing_device_task` can be overridden. | 24 | Once you have made the necessary changes to the mouse report, you need to send it: |
| 25 | |||
| 26 | * `pointing_device_send()` - Sends the mouse report to the host and zeroes out the report. | ||
| 27 | |||
| 28 | When the mouse report is sent, the x, y, v, and h values are set to 0 (this is done in `pointing_device_send()`, which can be overridden to avoid this behavior). This way, button states persist, but movement will only occur once. For further customization, both `pointing_device_init` and `pointing_device_task` can be overridden. | ||
| 25 | 29 | ||
| 26 | In the following example, a custom key is used to click the mouse and scroll 127 units vertically and horizontally, then undo all of that when released - because that's a totally useful function. Listen, this is an example: | 30 | In the following example, a custom key is used to click the mouse and scroll 127 units vertically and horizontally, then undo all of that when released - because that's a totally useful function. Listen, this is an example: |
| 27 | 31 | ||
| @@ -38,6 +42,7 @@ case MS_SPECIAL: | |||
| 38 | currentReport.buttons &= ~MOUSE_BTN1; | 42 | currentReport.buttons &= ~MOUSE_BTN1; |
| 39 | } | 43 | } |
| 40 | pointing_device_set_report(currentReport); | 44 | pointing_device_set_report(currentReport); |
| 45 | pointing_device_send(); | ||
| 41 | break; | 46 | break; |
| 42 | ``` | 47 | ``` |
| 43 | 48 | ||
