koekeishiya / skhd

Simple hotkey daemon for macOS
MIT License
6.05k stars 204 forks source link

Trackpad Gesture Support #25

Open rien333 opened 6 years ago

rien333 commented 6 years ago

Somewhat of a weird suggestion maybe, but would you be open to expand this tool's functionality to monitor specific trackpad gestures? (e.g. four finger taps, various swipes, "tip-taps") This tool has largely replaced the paid app bettertouchtool for me, except that it lacks binding trackpad gestures to commands. And because running both seems wasteful, I prefer skhd's way of configuration and skdh seems less recourse intensive, I would really like to use it for trackpad monitoring as well. Trackpad gesutres can be monitored through some sort of private API. I would be interested in implementing this functionality myself.

As not really everyone will need this probably, it seems more resource friendly to have a switch to enable trackpad gestures.

koekeishiya commented 6 years ago

I've never looked into how touch-data is presented, although I can see how this would be useful. Can you only track things such as four finger taps etc, or could we detect completely custom gestures?

rien333 commented 6 years ago

You could detect completely custom gestures using the private API method I linked above (this would require a shape recognization algorithm however, such as the easily implementable $1 algorithm), but I wouldn't really know how one would configure these with the current configuration setup. I was thinking of simpler gestures like tapping and swiping, which can easily be referred to with names. For example, I would love to add something like this to my skhd.conf:

tip-tap-left            [decrease volume]
tip-tap-right           [increase volume]
three-finger-tap        [simulate middle click]
# Making them usable with modifiers would be cool as well
cmd - right-corner-tap  [window to top-right corner]
koekeishiya commented 6 years ago

I've briefly started looking at this: https://github.com/koekeishiya/skhd/tree/mt

rien333 commented 6 years ago

Neat! If I find time the coming weeks I would gladly assist with testing and coding.

connorbrathwaite commented 6 years ago

also volunteer to assist with any early stage testing, would enhance my personal workflow that much more!

Vermoot commented 3 years ago

Is there still any chance that this might be revisited? I'd love to be able to ditch BetterTouchTool and use skhd to implement my usus of custom Trackpad Gestures. Most convenient thing would be to be able to configure all of that in a text-based config.

lucasmartins commented 2 months ago

TIP: This was implemented by https://github.com/artginzburg/MiddleClick-Sonoma