From 7c1797f52f74c9614615c0632ea1a2f5f11d3af6 Mon Sep 17 00:00:00 2001 From: Alabastard-64 <96358682+Alabastard-64@users.noreply.github.com> Date: Sat, 24 Sep 2022 00:43:55 -0600 Subject: [Core] Pointing Device Automatic Mouse Layer (#17962) Co-authored-by: Drashna Jaelre Co-authored-by: Stefan Kerkmann --- quantum/pointing_device/pointing_device_drivers.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'quantum/pointing_device/pointing_device_drivers.c') 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()); -- cgit v1.2.3