6

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?

Kara
  • 6,115
  • 16
  • 50
  • 57
daj
  • 6,962
  • 9
  • 45
  • 79
  • check out: http://stackoverflow.com/questions/1669909/extending-functionality-of-magic-mouse-do-i-need-a-kext – Seth Hays Jun 14 '13 at 00:05

2 Answers2

2

You should take a look at Cocoa Event Handling Guide.
To use Cocoa frameworks in your C++ program use Objective-C++.

Community
  • 1
  • 1
cody
  • 3,233
  • 1
  • 22
  • 25
0

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

tim k
  • 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