Adding control for auto mouse sensitivity on X, Y, H, and V

This commit is contained in:
Sadek Baroudi 2024-01-14 12:53:33 -08:00
parent 871919d6c2
commit 4d62ff3df2
3 changed files with 27 additions and 7 deletions

View File

@ -216,9 +216,13 @@ This is fully supported. Once I merge the next major release in Q4, I will remov
In addition to the default configurations, there are additional features added to fingerpunch keyboards:
| Setting | Description | Default |
| ------------------------------------------------ | ------------------------------------------------------------------------------- | ------------------------------- |
| `FP_AUTO_MOUSE_TRACKBALL_SENSITIVITY` | (Required) Trackball auto mouse sensitivity value | `3` |
| Setting | Description | Default |
| ------------------------------------------------ | -------------------------------------------------------------------------------- | ------------------------------------- |
| `FP_AUTO_MOUSE_TRACKBALL_SENSITIVITY` | (Required) Trackball auto mouse sensitivity value | `3` |
| `FP_AUTO_MOUSE_TRACKBALL_SENSITIVITY_X` | (Required) Trackball auto mouse sensitivity value in the X direction (pointing) | `FP_AUTO_MOUSE_TRACKBALL_SENSITIVITY` |
| `FP_AUTO_MOUSE_TRACKBALL_SENSITIVITY_Y` | (Required) Trackball auto mouse sensitivity value in the Y direction (pointing) | `FP_AUTO_MOUSE_TRACKBALL_SENSITIVITY` |
| `FP_AUTO_MOUSE_TRACKBALL_SENSITIVITY_H` | (Required) Trackball auto mouse sensitivity value in the H direction (scrolling) | `FP_AUTO_MOUSE_TRACKBALL_SENSITIVITY` |
| `FP_AUTO_MOUSE_TRACKBALL_SENSITIVITY_V` | (Required) Trackball auto mouse sensitivity value in the X direction (scrolling) | `FP_AUTO_MOUSE_TRACKBALL_SENSITIVITY` |
(Additional auto mouse configuration in the layer lighting section)

View File

@ -444,10 +444,10 @@ bool auto_mouse_activation(report_mouse_t mouse_report) {
if (fp_snipe_layer_get() || fp_snipe_keycode_get()) {
return fabs(mouse_report.x) >= 0.5 || fabs(mouse_report.y) >= 0.5 || fabs(mouse_report.h) >= 0.5 || fabs(mouse_report.v) >= 0.5 || mouse_report.buttons;
} else {
return fabs(mouse_report.x) >= FP_AUTO_MOUSE_TRACKBALL_SENSITIVITY ||
fabs(mouse_report.y) >= FP_AUTO_MOUSE_TRACKBALL_SENSITIVITY ||
fabs(mouse_report.h) >= FP_AUTO_MOUSE_TRACKBALL_SENSITIVITY ||
fabs(mouse_report.v) >= FP_AUTO_MOUSE_TRACKBALL_SENSITIVITY ||
return fabs(mouse_report.x) >= FP_AUTO_MOUSE_TRACKBALL_SENSITIVITY_X ||
fabs(mouse_report.y) >= FP_AUTO_MOUSE_TRACKBALL_SENSITIVITY_Y ||
fabs(mouse_report.h) >= FP_AUTO_MOUSE_TRACKBALL_SENSITIVITY_H ||
fabs(mouse_report.v) >= FP_AUTO_MOUSE_TRACKBALL_SENSITIVITY_V ||
mouse_report.buttons;
}
}

View File

@ -116,6 +116,22 @@ bool fp_process_record_pointing(uint16_t keycode, keyrecord_t *record);
# define FP_AUTO_MOUSE_TRACKBALL_SENSITIVITY 3
# endif
# ifndef FP_AUTO_MOUSE_TRACKBALL_SENSITIVITY_X
# define FP_AUTO_MOUSE_TRACKBALL_SENSITIVITY_X FP_AUTO_MOUSE_TRACKBALL_SENSITIVITY
# endif
# ifndef FP_AUTO_MOUSE_TRACKBALL_SENSITIVITY_Y
# define FP_AUTO_MOUSE_TRACKBALL_SENSITIVITY_Y FP_AUTO_MOUSE_TRACKBALL_SENSITIVITY
# endif
# ifndef FP_AUTO_MOUSE_TRACKBALL_SENSITIVITY_H
# define FP_AUTO_MOUSE_TRACKBALL_SENSITIVITY_H FP_AUTO_MOUSE_TRACKBALL_SENSITIVITY
# endif
# ifndef FP_AUTO_MOUSE_TRACKBALL_SENSITIVITY_V
# define FP_AUTO_MOUSE_TRACKBALL_SENSITIVITY_V FP_AUTO_MOUSE_TRACKBALL_SENSITIVITY
# endif
# ifndef FP_POINTING_ZOOMING_LAYER
# define FP_POINTING_ZOOMING_LAYER 1
# endif