有没有办法伪造 Touch 进入系统?
我发现了这一点:当 UIView 的 TouchBegan: 方法被触发并且屏幕上只有一根手指时,系统将等待最多 0.25 秒,看看手指是否移动得足够远,然后才会触发 TouchMoved: 。 没有任何编程方式可以解决这个问题。
但现在有趣的部分是:如果一根手指已经在屏幕上的某个地方,这种丑陋的行为就会被关闭。 接下来的每一个手指都被解释为想要移动的手指。 touchesMoved: 立即触发,没有延迟。
所以,伙计们,最大的问题是:是否有可能在屏幕上的某个地方伪造第一个初始手指,以便接下来的真实手指将被解释为第二个手指? 那会挽救我的周末;)
I discovered this: When a UIView's touchesBegan: method is fired and there is only one finger on the screen, the system will wait up to 0.25 seconds to see if the finger move far enough, before it will fire touchesMoved:. There is no programmatically way to get around this problem.
But now the interesting part: If one finger is already somewhere on the screen, this ugly behavior is turned off. every next finger is interpteted as one that wants to move. touchesMoved: is fired immediately with no delay.
So the BIG question, guys: Is it possible to fake this first initial finger somewhere on the screen, so that the following real finger will be interpreted as a second finger? That would rescue my weekend ;)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Matt Gallagher 在他的文章此处。 不过,他更多地打算将其用于用户界面测试,因为他确实使用了一些您不希望在运输应用程序中依赖的私有实例变量。
Matt Gallagher describes how to synthesize touch events in his post here. He intends this more for user interface testing, though, because he does use some private instance variables which you would not want to rely on for a shipping application.