JitouchApp / Jitouch

A multi-touch extension for MacBook, Magic Mouse, and Magic Trackpad
GNU General Public License v3.0
391 stars 28 forks source link

Three finger swipe with firefox #45

Closed samcarter closed 1 year ago

samcarter commented 1 year ago

First of all: Thanks a lot for your bug fixes. I couldn't get the upstream version of jitouch to work on my M1 mac, but with your modifications it finally worked!

I'm using jitouch to remap the left/right three finger swipe to a specific keyboard shortcut. This works great in all apps with the one exception of firefox. If I change the gesture to something else, e.g. a three finger tap, the remapping will also work in firefox.

Do you happen to know why the three finger swipe does not work in firefox? I thought that maybe firefox monopolises the gesture, so I tried to disable everything in firefox about:config which looked related to gestures, but the there finger swipe still does not work.

Screenshot 2022-11-04 at 17 23 12
aaronkollasch commented 1 year ago

Hello,

Do you have "Swipe between pages" enabled in System Preferences > Trackpad > More Gestures? It looks like Firefox picks up on that even if you have the three-finger swipe disabled.

Specifically, enabling the swipe between pages gesture sets this variable:

defaults write "Apple Global Domain" "AppleEnableSwipeNavigateWithScrolls" '1'

And setting swipe navigation to two-finger-only sets these variables, but perhaps Firefox is ignoring them.

defaults write "com.apple.driver.AppleBluetoothMultitouch.trackpad" "TrackpadThreeFingerHorizSwipeGesture" '0'
defaults write "com.apple.driver.AppleBluetoothMultitouch.trackpad" "TrackpadThreeFingerVertSwipeGesture" '0'
defaults write "com.apple.AppleMultitouchTrackpad" "TrackpadThreeFingerVertSwipeGesture" '0'
defaults write "com.apple.AppleMultitouchTrackpad" "TrackpadThreeFingerHorizSwipeGesture" '0'

So fixing this probably requires a change to Firefox.

samcarter commented 1 year ago

I have all options in "More Gestures" disabled:

Screenshot 2022-11-04 at 20 22 49

For experimentation, I tried

aaronkollasch commented 1 year ago

I found the culprit, Firefox is excluded from the three-finger swipe, probably because it has that gesture built in, so we might get double gestures otherwise. Not sure what the best way is to make that configurable.

https://github.com/aaronkollasch/jitouch/blob/96d199b110cf0919bc6363c5b37bce2b5f2fc63a/jitouch/Jitouch/Gesture.m#L1614-L1642

samcarter commented 1 year ago

@aaronkollasch Thank you so much for looking into this! I guess I'll have to train myself to use some other gesture...

samcarter commented 1 year ago

@aaronkollasch Thanks again for digging up the relevant code lines. I've now build a custom version from source without the if-cases and now jitouch also works fabulously with firefox for me! Thank you for your work on this project - this makes my life and probably the life of many other users so much easier!

aaronkollasch commented 1 year ago

No problem, I'm glad to hear you got it working for you!

EugeneTarasenko commented 1 year ago

@aaronkollasch Thanks again for digging up the relevant code lines. I've now build a custom version from source without the if-cases and now jitouch also works fabulously with firefox for me! Thank you for your work on this project - this makes my life and probably the life of many other users so much easier!

Does it work with Safari too? Or only with Firefox?

samcarter commented 1 year ago

@EugeneTarasenko Yes, it works in Safari, too.

These are the changes I made: https://github.com/samcarter/Jitouch/commit/8d263f0ae81c3ba12ac94e1bea05cae38f19ea6f