jitouch icon indicating copy to clipboard operation
jitouch copied to clipboard

Left click on the magic mouse occasionally stops working

Open katzelad opened this issue 1 year ago • 6 comments

About once every couple of hours the left click of the magic mouse stops working until I perform a left click on the trackpad.

2023-01-11 10:59:42.853 Jitouch[13225:4794400] Suppressed MouseDown with 2 fingers d=0.285989 t=0.020944

After clicking the trackpad, MouseDown is no longer suppressed and left clicking is enabled.

Thanks

katzelad avatar Jan 13 '23 00:01 katzelad

The t=0.020944 suggests that the trackpadCallback has been called very shortly before your click. The d=0.285989 suggests that the trackpadCallback was called with two fingers present at that distance. This is the only place that lastTwoFingerDate is set. https://github.com/JitouchApp/Jitouch/blob/f8e8d6713f6c71c0af037feb6406bb990c47d5c7/jitouch/Jitouch/Gesture.m#L2005-L2022

Then lastTwoFingerDate is checked in the CGEventCallback: https://github.com/JitouchApp/Jitouch/blob/f8e8d6713f6c71c0af037feb6406bb990c47d5c7/jitouch/Jitouch/Gesture.m#L2934-L2939

When you see this issue, did you have a hand on or near the trackpad at the time? (It may be hovering as the trackpad can detect fingers close to but not touching the surface)

aaronkollasch avatar Jan 13 '23 06:01 aaronkollasch

@aaronkollasch Yes, this was the problem - my palm was resting close to the trackpad :) But when disabling Jitouch my palm doesn't interfere with the mouse left click (it also never happened when CGEventTap didn't work). Is it possible something about the detector which enables the click gestures interferes with palm detection?

katzelad avatar Jan 16 '23 14:01 katzelad

Some gestures like "One-Fix One-Tap" usually result in an unexpected click being sent, so Jitouch has to intercept those clicks and suppress them. The way Jitouch does this is it disables left clicks if it detects more than one finger on the touchpad within a certain distance. However, I should try moving that logic after Jitouch's built-in palm rejection. There's also potential for improving Jitouch's palm rejection, tracked in issue #44.

aaronkollasch avatar Jan 17 '23 00:01 aaronkollasch

@aaronkollasch Is it possible to suppress only trackpad clicks? It should be possible to tell them apart from mouse clicks by checking if there is a finger on the mouse during the click. Palm rejection also sounds great :)

katzelad avatar Jan 17 '23 00:01 katzelad

It's tricky because I don't think CGEventCallback knows which device sent the click, and if it does I don't think it would use the same IDs as the Multitouch API. What you suggest, allowing clicks if a magic mouse has a finger down at the time, is possible, but it would mean additional complexity so I'm not sure it's the right route.

When you see the issue, what part of the touchpad are you touching?

aaronkollasch avatar Jan 17 '23 02:01 aaronkollasch

The top-left part (fingers on the keyboard, thumb on or above the trackpad).

katzelad avatar Jan 17 '23 07:01 katzelad