문제

How can I detect if a user's hand is on the right side of a magic mouse? Not right clicking, just checking what side of the mouse the finger is on.

도움이 되었습니까?

해결책 2

Apple official driver is really limited . This include the lack of support for advanced gestures like pinch and rotate.

The following proof of concept grab (very rawly) the pinch event, using the euclide's distance between the two fingers, and send a combined keystrokes as response to the front most application (kCGHIDEEventTap). Launching the binary and bring a Preview.app window to the front, you'll able to pinch in/out, using your magic mouse...amazing! :-)

Take a look at http://www.iphonesmartapps.org/aladino/?a=multitouch

Extending Functionality of Magic Mouse: Do I Need a kext?
Apple Magic Mouse Api

다른 팁

Unless you write something in the IOKit to handle this, it isn't that easy. What the App gets is what the driver (kext) sends it.

You could get something like Better Touch Tool or Magic Prefs which opens up a variety of options i.e. positions of fingers on mouse, where fingers are and are not registered etc...

Writing IOKit kext's isn't a simple process, but you could begin here:

https://developer.apple.com/library/mac/#documentation/devicedrivers/conceptual/IOKitFundamentals/Introduction/Introduction.html

Other than that, you're stuck with what the kext sends to your App as a notification.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top