diff options
author | Alabastard-64 <96358682+Alabastard-64@users.noreply.github.com> | 2022-09-24 00:43:55 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-23 23:43:55 -0700 |
commit | 7c1797f52f74c9614615c0632ea1a2f5f11d3af6 (patch) | |
tree | e51c5c6f2d4019bd0b5a0ac6ad7199c35872899c /quantum/pointing_device/pointing_device_drivers.c | |
parent | 2318ae0433e92f773ea02bcb803de883379d98be (diff) |
[Core] Pointing Device Automatic Mouse Layer (#17962)
Co-authored-by: Drashna Jaelre <drashna@live.com>
Co-authored-by: Stefan Kerkmann <karlk90@pm.me>
Diffstat (limited to 'quantum/pointing_device/pointing_device_drivers.c')
-rw-r--r-- | quantum/pointing_device/pointing_device_drivers.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/quantum/pointing_device/pointing_device_drivers.c b/quantum/pointing_device/pointing_device_drivers.c index d7e0b90917..172c9f36d7 100644 --- a/quantum/pointing_device/pointing_device_drivers.c +++ b/quantum/pointing_device/pointing_device_drivers.c @@ -113,6 +113,15 @@ void cirque_pinnacle_configure_cursor_glide(float trigger_px) { # endif # if CIRQUE_PINNACLE_POSITION_MODE + +# ifdef POINTING_DEVICE_AUTO_MOUSE_ENABLE +static bool is_touch_down; + +bool auto_mouse_activation(report_mouse_t mouse_report) { + return is_touch_down || mouse_report.x != 0 || mouse_report.y != 0 || mouse_report.h != 0 || mouse_report.v != 0 || mouse_report.buttons; +} +# endif + report_mouse_t cirque_pinnacle_get_report(report_mouse_t mouse_report) { pinnacle_data_t touchData = cirque_pinnacle_read_data(); mouse_xy_report_t report_x = 0, report_y = 0; @@ -143,6 +152,10 @@ report_mouse_t cirque_pinnacle_get_report(report_mouse_t mouse_report) { pd_dprintf("cirque_pinnacle touchData x=%4d y=%4d z=%2d\n", touchData.xValue, touchData.yValue, touchData.zValue); } +# ifdef POINTING_DEVICE_AUTO_MOUSE_ENABLE + is_touch_down = touchData.touchDown; +# endif + // Scale coordinates to arbitrary X, Y resolution cirque_pinnacle_scale_data(&touchData, cirque_pinnacle_get_scale(), cirque_pinnacle_get_scale()); |