Hacker News new | ask | show | jobs
by fifafu 3223 days ago
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.

2 comments

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.