artginzburg / MiddleClick-Sonoma

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

Doesn't work on Monterey. #32

Closed xAdamQ closed 1 year ago

xAdamQ commented 2 years ago

I installed it from brew as in the readme and it have the accessibility permissions. But It doesn't work. However I installed it from a random source on the internet later and it worked but it doesn't open at startup after putting it in login items and closes itself after a while.

Cediddi commented 2 years ago

It was not working for me as well, then I tried to run it via terminal /Applications/MiddleClick.app/Contents/MacOS/MiddleClick and it's working flawlessly. I think there's a configuration error or something.

xAdamQ commented 2 years ago

Thanks a lot, it actually worked that way. To launch it at startup:

Start Automator.app; Select "Application"; Click "Show library" in the toolbar (if hidden); Add "Run shell script" (from the Actions/Utilities); Copy-and-paste your script into the window; Save it somewhere: a file called your_name.app will be created); Close the middle click and run this the created app to test Go to System Preferences → Users and Groups → Login items Add this newly-created app;

source

leonard84 commented 2 years ago

I can confirm that the workaround through the shell works, but it has the annoying side effect that the launching application iterm/automator gets an accessibility feature prompt. If you deny the request it still works, but I'd like to avoid having to grant them the permission just to start this app without dialogs.

chrisma commented 2 years ago

Had the same issue of MiddleClick not working after brew installation. #24 mentioned activating MiddleClick in the 'Accessibility' section of the 'Security & Privacy' Preferences (it was not activated after install). This worked for me on Monterey 12.1.

image

antipopp commented 2 years ago

Had the same issue of MiddleClick not working after brew installation. #24 mentioned activating MiddleClick in the 'Accessibility' section of the 'Security & Privacy' Preferences )it was not activated after install). This worked for me on Monterey 12.1.

I have it unchecked and no matter what I try it won't check it.

JarrettBillingsley commented 2 years ago

I'm on monterey and trying to find a replacement for magicprefs (😭) and I tried this out. It's very inconsistent. It seems to turn about 5% of my three-finger clicks into middle clicks and misses the rest. Three-finger tap seems much more robust, but I don't like tap-to-click so...

Man, why's apple gotta make this such a pain?

JarrettBillingsley commented 2 years ago

Something possibly diagnostic about why this doesn't work (I have no idea, I'm just looking at the source):

https://github.com/artginzburg/MiddleClick-BigSur/blob/be5ee82bdfdc07a29cb45b901478b56ae1ce832e/MiddleClick/Controller.m#L181

This function is hardcoded to check for kCGEventLeftMouseDown and kCGEventLeftMouseUp, but I notice that a lot of the time it fails to middle click, I get a right-click menu instead. So maybe this code is just not being triggered because with three fingers down, mac OS is interpreting that as a right-click. Maybe this changed at some point and this code needs to be updated?


Edit: I figured out why it's inconsistent. It has to do with my finger placement. My muscle memory is to do a middle click with my thumb along the bottom edge of the trackpad and my index/middle fingers in the middle. That does not seem to be recognized as a three-finger click. But, if I use three fingers in the middle of the trackpad, it works 100% of the time.

I was trying out Middle and got the exact same behavior, so I'm guessing this may be an issue with the way mac OS translates/delivers events to Middleclick.

chrisma commented 2 years ago

trying to find a replacement for magicprefs

@JarrettBillingsley Have you tried BetterTouchTool yet? There seem to be some reports of that working

JarrettBillingsley commented 2 years ago

I haven't, but I really only need the middle click, so something like that feels a little overkill. But I imagine it will have the same limitations because...

I got a response from the developer of Middle and it turns out the API that all these apps use is limited. Apple's code does "resting touch rejection" which filters out certain touches at the edges of the trackpad, which explains why it's picky about where I put my fingers. I don't know that any of these apps can fix that issue without resorting to weird hacks.

So basically, I guess I have to retrain my fingers.

todivefor commented 2 years ago

I used Better Touch Tool just for this. It is overkill. When I got my Macbook Air M1 and Monterey, I tried this. It works fine. I use pointer, middle, ring fingers and it works 100%. I have to restart occasionally after sleep, but I can live with that. I couldn't get 2 finger tap to work, but now that I am using 3, I am used to it.

Filaipus commented 2 years ago

Yea there's something wrong going on. I can only get this to work properly in Monterey if I use three fingers tap. And I had to restart a bunch of times, leading to a few hard freezes from trying to add/remove the permissions in the accessibility options.

amjd commented 2 years ago

I've tried MiddleClick, Middle and BetterTouchTool and none of them seem to work properly on Monterey for me.

MiddleClick: Keeps restarting every few seconds. If you run it via terminal this is what is logged:

*** Recognized (0xb0) family*** (60 cols X  2 rows)
*** Recognized (0x6b) family*** (26 cols X 18 rows)
2022-05-18 14:13:57.786 MiddleClick[25570:560430] Couldn't create event tap! Check accessibility permissions.
2022-05-18 14:14:02.791 MiddleClick[25570:560430] Restarting app...

This is with accessibility permission already granted.

Middle: Quits on sleep.

BetterTouchTool: Sometimes doesn't recognize the gesture.

Please let me know if anyone knows other workarounds or apps.

byprakosoo commented 1 year ago

Still doesn't work in monterey for me

amjd commented 1 year ago

Update after two months: I've found the perfect solution in BetterTouchTool. I gave it another shot and it's working reliably this time.

Jont828 commented 1 year ago

Although it works well it is worth noting that it costs $22 whereas MiddleClick is free and open source. While I'm not too familiar with writing Mac apps, I'll look into it if I have time.

JarrettBillingsley commented 1 year ago

For what it's worth, if you only need middle-click functionality, the Middle app is currently only $8, almost a third the price. I would love there to be a functional open-source program for this, but I just got Middle cause I was tired of this app breaking.

artginzburg commented 1 year ago

If anyone still has problems, try the new release. I've had a lot of different variations of these auto-restart issues, and tested the new way of restarting on a beta release for 2 months. It fixes everything for me.

artginzburg commented 1 year ago

This issue has some good points of knowledge, but it doesn't really suggest anything or point out any particular problem that can be worked on in isolation. Closed with expectation of future more single-pointed issues, if any.