2012-07-15 3 views
4

MobileSubstrate 플러그인을 통해 iOS에서 시스템 차원의 탭 시뮬레이션을하고 싶습니다. 이 아이디어는 iOS 5.1.1에서 시스템 전체 수준에서 터치 (처음 터치 한 다음 멀티 터치)를 시뮬레이트 할 수 있도록하는 것입니다.iOS에서의 시스템 전체 탭 시뮬레이션

특정 뷰에서 접촉을 시뮬레이션하기 위해 this article을 성공적으로 구현했지만 이제는이를 시스템 전체에서 시뮬레이션 할 수 있기를 바랍니다.

개인 MobileServices 프레임 워크를 사용해야한다는 것을 알고 있으며 GSEvent에서 documented myself을 보았습니다. 또한 Veency & MouseSupport 소스 코드를 살펴 보았습니다.

-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{ 

    GSEventRef eventRef = (GSEventRef)[event performSelector:@selector(_gsEvent)]; 
    GSEventRecord record = *_GSEventGetGSEventRecord(eventRef); 
    < breakpoint here to look at record > 
} 

을하고 그 결과는 위의 자세한 조 (아이폰 OS 3) 구조 이전에 매우 유사합니다

나는 UIEvents을 가로 채고 기본 구조 살펴보기를 연결하려고 노력했다.

내가 다음 (가 아닌 MS 지금 조정할 독립 실행 형 응용 프로그램에) 해당 이벤트 자신을 해고하려 : 전혀 작동하지 않습니다 이제

+(void)simulateTouchDown:(CGPoint)point{ 

    point.x = roundf(point.x); 
    point.y = roundf(point.y); 

    GSEventRecord record; 
    memset(&record, 0, sizeof(record)); 

    record.type = kGSEventHand; 
    record.windowLocation = point; 
    record.timestamp = GSCurrentEventTimestamp(); 

    GSSendSystemEvent(&record); 

} 

을, (충돌하거나하지 않습니다) .

대부분의 코드 (MouseSupport, Veency는) 만이

// Create & populate a GSEvent 
struct { 
    struct GSEventRecord record; 
    struct { 
     struct GSEventRecordInfo info; 
     struct GSPathInfo path; 
    } data; 
} event; 

memset(&event, 0, sizeof(event)); 

event.record.type = kGSEventHand; 
event.record.windowLocation = point; 
event.record.timestamp = GSCurrentEventTimestamp(); 
event.record.infoSize = sizeof(event.data); 

event.data.info.handInfo.type = kGSHandInfoTypeTouchDown;  
event.data.info.handInfo._0x44 = 0x1; 
event.data.info.handInfo._0x48 = 0x1; 

event.data.info.pathPositions = 1; 

event.data.path.pathIndex = 0x01; 
event.data.path.pathIdentity = 0x02; 
event.data.path.pathProximity = 0x00; 
event.data.path.pathLocation = event.record.windowLocation; 


GSSendSystemEvent(&event.record); 

같이 :

  • GSEventRecordInfo 알 수없는 (그리고 나는 그것이 정의 할 수있는 위치를 찾을 수 없습니다)
  • I 돈 전체 이벤트가 레코드를 전달하는 지점을 확인하지 못합니다.

이 일을 통해 iOS 5 가이드.

+0

왜 탈옥 했습니까? – bmargulies

+0

무엇을 의미합니까? 시스템 전체의 이벤트를 어떻게 시뮬레이트 할 것입니까? – Olotiar

+0

GSEventRecordInfo [here] (http://gitweb.saurik.com/iphone-api.git/blob/0ec5695fb65e628e298935de594682090a637b35:/GraphicsServices/GSEvent.h)에 대한 정의를 찾을 수 있습니다. – boxel

답변

0

GSEventRecordInfo는 iOS 3.2부터 도입되었을 수 있습니다 (연결 한 그래픽 서비스 헤더의 출처). iOS 5.1.1에서 실제로 기기에있는 프레임 워크를 클래스 덤프하고 거기에 정의되어 있는지 확인하십시오.

+0

안녕하세요. 나는 시도했다. 그러나 헤더 덤프가 유효한 Obj-C를 포함하지 않는다고 클래스 덤프가 불평한다. – Olotiar

+0

오, 죄송합니다. 실제로 프레임 워크가 C로 작성되어 클래스 덤핑이 쓸모 없게됩니다. 최선의 방법은 #the 채널의 irc에 가서 거기에 물어보십시오. 여기서 veency와 같은 것들을 만든 모든 사람들이 당신이 어울리는 헤더 에서처럼 프레임 워크를 뒤집어서 응답 할 수 있습니다. 귀하의 질문에 최선을 – stonesam92

+0

내가 일할 때 시도합니다. 고맙습니다 – Olotiar