From f2edb73974d15b88ea9614002b18b045551b71d8 Mon Sep 17 00:00:00 2001 From: Drzony Date: Mon, 29 Aug 2022 06:34:42 +0200 Subject: Fix mouse report comparison failing on shared EP (#18060) Co-authored-by: Dasky <32983009+daskygit@users.noreply.github.com> --- quantum/pointing_device/pointing_device.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'quantum/pointing_device/pointing_device.c') diff --git a/quantum/pointing_device/pointing_device.c b/quantum/pointing_device/pointing_device.c index 505a7a6ffd..ae3f122e89 100644 --- a/quantum/pointing_device/pointing_device.c +++ b/quantum/pointing_device/pointing_device.c @@ -166,11 +166,9 @@ __attribute__((weak)) void pointing_device_send(void) { host_mouse_send(&local_mouse_report); } // send it and 0 it out except for buttons, so those stay until they are explicity over-ridden using update_pointing_device - local_mouse_report.x = 0; - local_mouse_report.y = 0; - local_mouse_report.v = 0; - local_mouse_report.h = 0; - + uint8_t buttons = local_mouse_report.buttons; + memset(&local_mouse_report, 0, sizeof(local_mouse_report)); + local_mouse_report.buttons = buttons; memcpy(&old_report, &local_mouse_report, sizeof(local_mouse_report)); } -- cgit v1.2.3 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.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'quantum/pointing_device/pointing_device.c') diff --git a/quantum/pointing_device/pointing_device.c b/quantum/pointing_device/pointing_device.c index ae3f122e89..e91de018f1 100644 --- a/quantum/pointing_device/pointing_device.c +++ b/quantum/pointing_device/pointing_device.c @@ -267,6 +267,10 @@ __attribute__((weak)) void pointing_device_task(void) { #else local_mouse_report = pointing_device_adjust_by_defines(local_mouse_report); local_mouse_report = pointing_device_task_kb(local_mouse_report); +#endif + // automatic mouse layer function +#ifdef POINTING_DEVICE_AUTO_MOUSE_ENABLE + pointing_device_task_auto_mouse(local_mouse_report); #endif // combine with mouse report to ensure that the combined is sent correctly #ifdef MOUSEKEY_ENABLE -- cgit v1.2.3 From 94d5fe6f908077e22a2445b3accda8d130135156 Mon Sep 17 00:00:00 2001 From: Thomas Date: Sat, 24 Sep 2022 17:44:14 +0200 Subject: Allow Active High for Pointing Device Motion Pin (#18404) Needed by the Cirque Trackpad for motion detection --- quantum/pointing_device/pointing_device.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'quantum/pointing_device/pointing_device.c') diff --git a/quantum/pointing_device/pointing_device.c b/quantum/pointing_device/pointing_device.c index e91de018f1..6981f850d0 100644 --- a/quantum/pointing_device/pointing_device.c +++ b/quantum/pointing_device/pointing_device.c @@ -144,7 +144,11 @@ __attribute__((weak)) void pointing_device_init(void) { { pointing_device_driver.init(); #ifdef POINTING_DEVICE_MOTION_PIN +# ifdef POINTING_DEVICE_MOTION_PIN_ACTIVE_LOW setPinInputHigh(POINTING_DEVICE_MOTION_PIN); +# else + setPinInput(POINTING_DEVICE_MOTION_PIN); +# endif #endif } @@ -236,7 +240,11 @@ __attribute__((weak)) void pointing_device_task(void) { # if defined(SPLIT_POINTING_ENABLE) # error POINTING_DEVICE_MOTION_PIN not supported when sharing the pointing device report between sides. # endif +# ifdef POINTING_DEVICE_MOTION_PIN_ACTIVE_LOW if (!readPin(POINTING_DEVICE_MOTION_PIN)) +# else + if (readPin(POINTING_DEVICE_MOTION_PIN)) +# endif #endif #if defined(SPLIT_POINTING_ENABLE) -- cgit v1.2.3 From fb400f2ac2c57fa0fc82ca803f6450b818bb32f9 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Mon, 26 Sep 2022 20:49:32 -0700 Subject: Enabling Pointing Device support in register code functions (#18363) --- quantum/pointing_device/pointing_device.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'quantum/pointing_device/pointing_device.c') diff --git a/quantum/pointing_device/pointing_device.c b/quantum/pointing_device/pointing_device.c index 6981f850d0..75bb5f81fc 100644 --- a/quantum/pointing_device/pointing_device.c +++ b/quantum/pointing_device/pointing_device.c @@ -22,6 +22,7 @@ #ifdef MOUSEKEY_ENABLE # include "mousekey.h" #endif + #if (defined(POINTING_DEVICE_ROTATION_90) + defined(POINTING_DEVICE_ROTATION_180) + defined(POINTING_DEVICE_ROTATION_270)) > 1 # error More than one rotation selected. This is not supported. #endif @@ -479,3 +480,10 @@ __attribute__((weak)) report_mouse_t pointing_device_task_combined_user(report_m return pointing_device_combine_reports(left_report, right_report); } #endif + +__attribute__((weak)) void pointing_device_keycode_handler(uint16_t keycode, bool pressed) { + if IS_MOUSEKEY_BUTTON (keycode) { + local_mouse_report.buttons = pointing_device_handle_buttons(local_mouse_report.buttons, pressed, keycode - KC_MS_BTN1); + pointing_device_send(); + } +} -- cgit v1.2.3