Simulate a tap, is possible?

I know that is possible to intercept a tap on a screen, but I want to know if is it possible to simulate a tap in a point of screen (with x and y coordinates). Thanks


UITouch *touch = [[UITouch alloc] initInView:view];
UIEvent *eventDown = [[UIEvent alloc] initWithTouch:touch];

[touch.view touchesBegan:[eventDown allTouches] withEvent:eventDown];

[touch setPhase:UITouchPhaseEnded];
UIEvent *eventUp = [[UIEvent alloc] initWithTouch:touch];

[touch.view touchesEnded:[eventUp allTouches] withEvent:eventUp];

[eventDown release];
[eventUp release];
[touch release];

从这里http://cocoawithlove.com/2008/10/synthesizing-touch-event-on-iphone.html

链接地址: http://www.djcxy.com/p/5192.html

上一篇: 重构:使游戏引擎更加模块化,以及如何实现

下一篇: 模拟一个水龙头,是可能的?