U
U
UJey2012-03-30 12:54:52
Cocoa
UJey, 2012-03-30 12:54:52

Cocoa: How to track the Trackpad Scroll event in any application so that it knows the position of the fingers on the device?

I searched a lot for information on the topic, but did not find anything.
The task is this: no matter what the application is, you need to track the scrolling event, understand that this is scrolling on the trackpad and calculate the position of the finger on the device.
In other words, you need to understand from which point on the device the scrolling gesture began. It is important.
I tried to do through CGEventTap. I managed everything, but it was impossible to find out where the finger was on the device with this approach. There is simply no such information in the event object.
I also learned that touches information can be retrieved via the touchesMatchingPhase:inView: selector . However, from the EventTap callback function, accessing this selector causes Assert.
It seems thattouchesMatchingPhase:inView: only works when implementing events inside an NSView, and only if scrolling occurs within that NSView.
Need help from experts to solve this problem.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question