Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mallexxx
Copy link

@mallexxx mallexxx commented Sep 16, 2023

Issue: #13

  • Normally three-figer-click is performed by putting your three fingers at the trackpad and pushing
  • 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
  • The PR adds adds attitional kCGEventRightMouseDown/Up interception that fixes the issue

Steps to test:

  • Open a new browser Tab
  • Point mouse cursor on the tab
  • Perform three-finger-click instantly: without putting your fingers to the trackpad first, repeat several times: the tab should close

@artginzburg
Copy link
Owner

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
Copy link
Author

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
Copy link
Author

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!!!!");
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants