问题
GSSendEvent
does not work anymore for me.
Even subscribing a callback function using GSEventRegisterEventCallBack
does not fire with touch events, [UIEvent _gsEvent]
returns NULL.
What happened?
回答1:
Now iOS uses IOHIDEvent (in IOKit.framework) for touch events.
backboardd create touch events and sent to SpringBoard, and SpringBoard receives it by UIApplicationHandleEventQueue
Anyway, if you have jailbroken device and want to simulate touch, just use SimulateTouch library. You can download it from Bigboss's repo, and API info is here http://api.iolate.kr/simulatetouch/
Also, this is open source. https://github.com/iolate/SimulateTouch
来源:https://stackoverflow.com/questions/19093619/simulating-system-wide-touches-in-ios-7