2

Is there a way to fake touch events by faking a tap on the screen at a certain coordinate? The problem im trying to solve is rendering a webpage to a opengl texture on a quad. Touches inside the quad need to be mapped to the view the webpage is rendered on. So if I could give the view the webpage a coordinate that the user touched, and the view can react to that touch as if it was a normal touch, that would be great.

so far ive found this, but the author claims your app will get rejected for using the undisclosed api calls http://www.cocoawithlove.com/2008/10/synthesizing-touch-event-on-iphone.html

4

1 回答 1

1

其实你可以做到的,有一个类用于管理设备中的所有事件(但它只是为了测试原因而创建的),确实会被拒绝或像camera+一样拉出,你应该尝试不同的方法如果您仍然想尝试它,我认为最好创建自己的 UIEvent 子类并使用 [[UIApplication sharedApplication] sendEvent:yourEvent] 如果事件中的触摸包含在视图边界中,它将通过命中测试并且就像触摸是用户生成的一样,将事件发送到视图。

于 2012-11-29T08:48:06.593 回答