有没有办法伪造 Touch 进​​入系统?

发布于 2024-07-30 17:15:56 字数 311 浏览 2 评论 0原文

我发现了这一点:当 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

风轻花落早 2024-08-06 17:15:56

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文