问题
I have an installation project in mind which involves a hacked iPad - I'd like to have a background process running recording all the touch events regardless of what app is running in the foreground, and send them out via OSC.
Note that this is using a jailbroken iPad with root access, and users will be alerted about not entering any sensitive data. But I'm not an iOS developer so I'm not sure if this is even possible. I'd appreciate any kind of input/suggestions.
[edit] Since someone questioned my motive behind this question, I'll try to explain a bit: to be specific, I'd like to build a mechanical system with Arduino that emulates the user's touch input on the iPad, but I do not want to limit them to using an app that does nothing else but recording touch events.
回答1:
There are three options:
- Use the
IOHIDFamily
subsystem to capture all the touch events. This will do most of the processing for you, the only thing you'll need to do is fetch the events using a HID client, get their types, and if they are touch events, get their position, radius and other things you need. - Use the
MultitouchSupport
framework. This way you will have to process the digitizer data frames manually which is tricky. - Use a
MobileSubstrate
hook to hook the already existing HID client inside SpringBoard.
来源:https://stackoverflow.com/questions/8303235/is-it-possible-to-capture-touch-events-in-the-background-on-a-jailbroken-ios-dev