Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

On Mac OS X, how to create multi-touch event and send to another application?

I want to "simulate" a multi-touch event for another application, e.g., simulate a zoom-in gesture on iPhoto. I searched many sources but can't find an answer for that.

It seems the most common way to sending an event to other application is with script bridge, getting a SBApplication and then send an AppleEvent. But it seems the general gesture or multi touch events are not there for common applications.

Also, there is no function like CGEventCreateMultiTouchEvent...(), thus I don't know if it's achievable by CGEventPost()

The method NSApplication.sendEvent might be able send a NSEvent which has the multi touch type defined. But how could I get the NSApplication* of another application?

Any help will be very appreciated :)

like image 357
Wei Xiang Avatar asked Nov 14 '22 08:11

Wei Xiang


1 Answers

I would script the application directly. I'd use "plain" objective-c.

like image 58
alexyorke Avatar answered Dec 24 '22 19:12

alexyorke