在iOS 7中模拟系统范围的触摸 [英] Simulating system-wide touches in iOS 7

查看:259
本文介绍了在iOS 7中模拟系统范围的触摸的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

GSSendEvent 对我不起作用。

甚至使用 GSEventRegisterEventCallBack 不会触发触摸事件, [UIEvent _gsEvent] 返回NULL。

Even subscribing a callback function using GSEventRegisterEventCallBack does not fire with touch events, [UIEvent _gsEvent] returns NULL.

发生了什么?

推荐答案

现在iOS使用IOHIDEvent(在IOKit.framework中)进行触摸事件。

Now iOS uses IOHIDEvent (in IOKit.framework) for touch events.

backboardd创建触摸事件并发送到SpringBoard,
和SpringBoard通过UIApplicationHandleEventQueue接收它

backboardd create touch events and sent to SpringBoard, and SpringBoard receives it by UIApplicationHandleEventQueue

无论如何,如果你有越狱设备和想要模拟触摸,
只需使用SimulateTouch库。
您可以从Bigboss的repo下载它,API信息在这里 http://api.iolate.kr/simulatetouch/

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/

此外,这是开源的。
https://github.com/iolate/SimulateTouch

Also, this is open source. https://github.com/iolate/SimulateTouch

这篇关于在iOS 7中模拟系统范围的触摸的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆