Apple Magic Mouse Api

旧街凉风 提交于 2019-12-03 13:16:05
Tyler

The Magic Mouse does not use the NSTouch API. I have been experimenting with it and attempting to capture touch information. I've had no luck so far. The only touch method that is common to both the mouse and the trackpad is the swipeWithEvent: method. It is called for a two finger swipe on the device only.

It seems the touch input from the mouse is being interpreted somewhere else, then forwarded on to the public API. I have yet to find the private API that is actually doing the work.

I have not tested, but I would be shocked if it didn't use NSTouch. NSTouch is the API you use to interact with the multi-touch trackpads on current MacBook Pros (and the new MacBooks that came out this week). You can check out the LightTable sample project to see how it is used.

It is part of AppKit, but it is a Snow Leopard only API.

valv0

get a look here: http://www.iphonesmartapps.org/aladino/?a=multitouch

there's a full working proof-of-concept using the CGEventPost method.

-- all the best!

I messed around with the below app before getting my magic mouse. I was surprised to find that the app also tracked the multi touch points on the mouse.

There is a link in the comments to some source that gets the raw data similarly, but there is no source to this actual app.

http://lericson.blogg.se/code/2009/november/multitouch-on-unibody-macbooks.html

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!