Hacker News new | ask | show | jobs
by archagon 3216 days ago
For the specific purpose of remapping side mouse buttons, BTT only allows you to bind them to keyboard shortcuts. As far as I can tell, no tool except for the one I made lets you bind them to virtual swipe events (which generally work better).
1 comments

BetterTouchTool has always had the "mimicking standard gestures" predefined actions which really send gesture events and don't just send shortcuts. However it currently only supports three finger swipe left and right (which are the most useful to go back and forward). I probably should look into how to synthesize other gestures as well (there is no official API for synthesizing gestures but afaik people have reverse engineered how to do it, e.g. https://github.com/calftrail/Touch/tree/master/TouchSynthesi...)

For three finger swipes I'm using a trick to synthesize them without private API, but for other swipe types I'd need to synthesize them using the private API... However there haven't been too many requests for other event types thus it's not very high up on my TODO list.

(I'm the author of BTT)

Also BTT allows you to bind them to many many predefined actions in addition to keyboard shortcuts, e.g. "Trigger Menubar Menu Item" which can be very powerful.

Huh, neat! I was wrong, didn't realize BTT supported that. I'm using fake three-finger swipes for my app as well, via the calftrail code you mentioned. (Hence the GPL license.) Are you using a different trick? Is there a more elegant way to do it barring private API access?
No, unfortunately it's not elegant at all :-)

I'm basically using CGEventCreateData to save an original system three finger swipe, then I'm just generating an event based on that saved data and refresh the timestamp and mouse location before sending it.

Thanks for the info! I was considering doing something similar when I was building my app, but calftrail's code saved the day...

Wish developers were legitimately able to generate those three-finger swipe events, because they are ubiquitously supported and really useful. (Just the other day, I discovered that Preview allows you to switch pages by swiping up and down! Weird.)

Up and down swipes were quite common before macOS 10.9 and some apps still implement them. They basically trigger a page up/page down event.