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

Nicol Bolas
  • 449,505
  • 63
  • 781
  • 982
Fonix
  • 11,447
  • 3
  • 45
  • 74

1 Answers1

1

Actually you can do it, there is a class for managing all the events in the device (but it was created only for testing reasons), indeed it will be rejected or pull out just as camera+ in the beginning, you should try a different approach if you want to try it anyway i think it will be best if you create your own UIEvent subclass and use [[UIApplication sharedApplication] sendEvent:yourEvent] if the touches in the event are contained in the view bounds it will pass the hit test and send the events to the view just as if the touches were user generated.

Sergio Prado
  • 229
  • 2
  • 3