artginzburg / MiddleClick-Sonoma

 "Wheel click" with three-finger click/tap for Trackpad and Magic Mouse.
GNU General Public License v3.0
1.66k stars 91 forks source link

Accept Right Mouse Down/Up events as a basic tapped event #79

Open mallexxx opened 1 year ago

mallexxx commented 1 year ago

Issue: https://github.com/artginzburg/MiddleClick-Ventura/issues/13

Steps to test:

artginzburg commented 1 year ago

Sometimes when performing three-finger-click straight away, without putting three fingers on the trackpad first, three-finger-click event tap doesn‘t work and opens context menu instead because the system interprets it as a 2-fingers click

I can't seem to reproduce the bug itself. Or more like I see it happen sometimes, very rarely, but am not even sure if it's me who accidentally put just 2 fingers on the trackpad or it's the app that did not register the 3rd.

By the way, do I need "Tap to click" enabled to reproduce the bug?

So, I built the app with these changes and it doesn't seem to change anything for me. What I'm trying currently is just opening a hundred new tabs and closing them one by one, positioning my fingers differently each time, and not resting them on the trackpad — just clicking immediately.

mallexxx commented 12 months ago

No, you don't need tap to click, I use normal force click on a magic trackpad The issue is the program will receive the 3rd finger put on a trackpad but won't receive a click because it's interpreted as 2 finger click and the app only subscribes for 1-finger click event tap. try putting 2 fingers on a trackpad first and then put 3rd doing a click, maybe this would help reproducing the issue

mallexxx commented 12 months ago

You can add the following code to mouseCallback (with kCGEventRightMouseDown added to the event mask) and see the console log. Try clicking simultaneously with 3 fingers or putting 2 fingers first and then applying click with a third finger. You can test clicking right in Xcode to make things easier.

if (needToClick && threeDown) {
  if (type == kCGEventRightMouseDown) {
    NSLog(@"!!!!right mouse down!!!!");
  } else {
    NSLog(@"!!!!left mouse down!!!!");
  }
}