GSEvent创建按键事件
我是越狱编程新手。 执行以下代码时:
if ($GSEventCreateKeyEvent != NULL) {
string = CFStringCreateWithCharacters(kCFAllocatorDefault, &unicode, 1);
event0 = (*$GSEventCreateKeyEvent)(10, point, string, string, nil, 0, 0, 1);
event1 = (*$GSEventCreateKeyEvent)(11, point, string, string, nil, 0, 0, 1);
} else if ($GSCreateSyntheticKeyEvent != NULL) {
event0 = (*$GSCreateSyntheticKeyEvent)(unicode, YES, YES);
GSEventRecord *record(_GSEventGetGSEventRecord(event0));
record->type = GSEventTypeKeyDown;
} else return;
解密 GSEventCreateKeyEvent 和 GSCreateSyntheticKeyEvent 后。 这两个方法都无法识别并且函数返回。 我想念什么? 谢谢, 大卫
I'm new to jailbreak programming.
When executing the following code:
if ($GSEventCreateKeyEvent != NULL) {
string = CFStringCreateWithCharacters(kCFAllocatorDefault, &unicode, 1);
event0 = (*$GSEventCreateKeyEvent)(10, point, string, string, nil, 0, 0, 1);
event1 = (*$GSEventCreateKeyEvent)(11, point, string, string, nil, 0, 0, 1);
} else if ($GSCreateSyntheticKeyEvent != NULL) {
event0 = (*$GSCreateSyntheticKeyEvent)(unicode, YES, YES);
GSEventRecord *record(_GSEventGetGSEventRecord(event0));
record->type = GSEventTypeKeyDown;
} else return;
After declering both the GSEventCreateKeyEvent and GSCreateSyntheticKeyEvent.
Both of the method are not identify and the function returns.
What do I miss?
Thanks,
David
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不明白你的问题。
要注入按键事件,您可以使用
int hid_inject_text(const char * utf8_text);
,hid-support 项目中的 网址为 http://code.google.com/p/hid-support/
I don't understand your question.
To inject key events, you can use
int hid_inject_text(const char * utf8_text);
from the hid-support project at http://code.google.com/p/hid-support/