I'd like to read trackpad multitouch gesture and coordinate data into my C++ program. Where can I find some introductory tutorials on doing this?
2 Answers
You should take a look at Cocoa Event Handling Guide.
To use Cocoa frameworks in your C++ program use Objective-C++.
The way to go is indeed objective-c++, which is just a mix of c++ and objective-c. It's very powerful because you can start using all the Apple frameworks in your C++ projects.
You should learn a bit of objective-c, rename some .m files to .mm (or .cpp files to .mm) and read through the apple documentation on touch events. ( https://developer.apple.com/library/mac/documentation/Cocoa/Reference/ApplicationKit/Classes/NSResponder_Class/Reference/Reference.html#//apple_ref/occ/instm/NSResponder/touchesBeganWithEvent: )
Or if objective-c scares you, check out this multitouch trackpad addon for OpenFrameworks https://github.com/jens-a-e/ofxMultiTouchPad

- 162
- 1
- 9
-
don't like the idea of picking up another language just to do this, but I guess it's it's the canonical approach... – daj Jun 18 '13 at 16:49
-
I know how you feel, I also came from c++. But learning obj-c is easy, interesting and so useful. Just think about all the Apple APIs you'll be able to use! – tim k Jun 19 '13 at 07:25