More docs

This commit is contained in:
Drashna Jael're 2023-11-20 19:43:14 -08:00
parent 24dc311de1
commit a3cd5e6879
No known key found for this signature in database
GPG Key ID: DBA1FD3A860D1B11
2 changed files with 13 additions and 1 deletions

View File

@ -378,7 +378,12 @@ POINTING_DEVICE_DRIVER = spacemouse_module
The SpaceMouse Module is a UART driven sensor, with 6 axises of motion.
While there isn't a whole lot to configure here, only the X and Y movement is enabled by default. The Z axis and the twist and turn axises are not supported out of box. These can be handled with a custom function:
| Setting (`config.h`) | Description | Default |
| ---------------------------- | ------------------------------------------------------------------------------------------- | ------------- |
| `SPACEMOUSE_USE_TILT_AXIS` | Uses the tilt axises for movement rather than the shift axises. | _not_defined_ |
By default, not all of the axises are utilized. If you would like to use more of them, you can do so by using this custom function, which translates the data from the SpaceMouse Module to the pointing device report.
```c
void spacemouse_module_handle_axises(spacemouse_data_t *spacemouse_data, report_mouse_t* mouse_report) {
@ -386,6 +391,8 @@ void spacemouse_module_handle_axises(spacemouse_data_t *spacemouse_data, report_
mouse_report->y = CONSTRAIN_HID_XY(spacemouse_data->y);
mouse_report->h = CONSTRAIN_HID(spacemouse_data->b);
mouse_report->v = CONSTRAIN_HID(spacemouse_data->c);
mouse_report->buttons = pointing_device_handle_buttons(mouse_report->buttons, (space_mouse_data->z < -10), KC_BTN1);
}
```

View File

@ -497,8 +497,13 @@ const pointing_device_driver_t pointing_device_driver = {
static bool spacemouse_present = false;
__attribute__((weak)) void spacemouse_module_handle_axises(spacemouse_data_t *spacemouse_data, report_mouse_t* mouse_report) {
#ifdef SPACEMOUSE_USE_TILT_AXIS
mouse_report->x = CONSTRAIN_HID_XY(spacemouse_data->tilt_x);
mouse_report->y = CONSTRAIN_HID_XY(spacemouse_data->tilt_y);
#else
mouse_report->x = CONSTRAIN_HID_XY(spacemouse_data->x);
mouse_report->y = CONSTRAIN_HID_XY(spacemouse_data->y);
#endif
}
static report_mouse_t spacemouse_get_report(report_mouse_t mouse_report) {