模拟所有物理按钮,例如iOS 7上的主页按钮上的压力(越狱) [英] Simulate all physical buttons like the pressure on the home button on iOS 7 (Jailbreak)
本文介绍了模拟所有物理按钮,例如iOS 7上的主页按钮上的压力(越狱)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试模拟iOS 7上的按下主页按钮,但iOS 6上使用的上一个方法不起作用。我说的是一个越狱设备。
I'm trying to simulate the "home button pressed" on iOS 7 but the previous method used on iOS 6 doesn't work. I speak of course of a jailbroken device.
#include "GSEvent.h"
- (void)simulateHomeButton
{
struct GSEventRecord record;
memset(&record, 0, sizeof(record));
record.type = kGSEventMenuButtonDown;
record.timestamp = GSCurrentEventTimestamp();
GSSendSystemEvent(&record);
record.type = kGSEventMenuButtonUp;
GSSendSystemEvent(&record);
}
* UPDATE
我真正需要的是像旧的让我模拟所有物理按钮的压力
*UPDATE What I really need is a generic method like the old one that let me to simulate the pressure of all physical buttons
推荐答案
试试这个。
[[%c(SBUIController)sharedInstance] clickedMenuButton];
[[%c(SBUIController) sharedInstance]clickedMenuButton];
这篇关于模拟所有物理按钮,例如iOS 7上的主页按钮上的压力(越狱)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文