相关疑难解决方法(0)

GSSendEvent - 注入触摸事件iOS

我想在iPhone中注入触摸事件.我通过网络套接字获取触摸事件的坐标.GSSendEvent似乎是不错的选择.但是,它需要GSEventRecord作为输入之一.

有谁知道如何准备GSEventRecord?我根据一些例子准备了它,但是在GSSendEvent调用之后应用程序崩溃了.

感谢任何帮助.

-(void) handleMouseEventAtPoint:(CGPoint) point
{
static mach_port_t port_;

// structure of touch GSEvent
struct GSTouchEvent {
    GSEventRecord record;
    GSHandInfo    handInfo;
} ;

struct GSTouchEvent *touchEvent = (struct GSTouchEvent *) malloc(sizeof(struct GSTouchEvent));

bzero(touchEvent, sizeof(touchEvent));

// set up GSEvent
touchEvent->record.type = kGSEventHand;
touchEvent->record.windowLocation = point;
touchEvent->record.timestamp = GSCurrentEventTimestamp();
touchEvent->record.infoSize = sizeof(GSHandInfo) + sizeof(GSPathInfo);
touchEvent->handInfo.type = getHandInfoType(0, 1);
touchEvent->handInfo.pathInfosCount = 1;
bzero(&touchEvent->handInfo.pathInfos[0], sizeof(GSPathInfo));
touchEvent->handInfo.pathInfos[0].pathIndex     = 1;
touchEvent->handInfo.pathInfos[0].pathIdentity  = 2;
touchEvent->handInfo.pathInfos[0].pathProximity = 1 ? 0x03 : 0x00;
touchEvent->handInfo.pathInfos[0].pathLocation  = point;

port_ = …
Run Code Online (Sandbox Code Playgroud)

api private touch iphone-privateapi ios

8
推荐指数
1
解决办法
6137
查看次数

在iOS 7中模拟系统范围的触摸

GSSendEvent 对我不起作用了.

即使订阅回调函数GSEventRegisterEventCallBack也不会触发触摸事件,[UIEvent _gsEvent]返回NULL.

发生了什么?

jailbreak iphone-privateapi ios ios7

3
推荐指数
1
解决办法
2893
查看次数

标签 统计

ios ×2

iphone-privateapi ×2

api ×1

ios7 ×1

jailbreak ×1

private ×1

touch ×1