From 1dad64a074ccec26d7866638659778aa9eef2b7c Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Sun, 4 Mar 2012 21:43:21 +0000 Subject: [PATCH] Revert a bunch of keyboard behavior for now: I hate Cydget. --- Tweak.mm | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/Tweak.mm b/Tweak.mm index 8ffeccc..e957efe 100644 --- a/Tweak.mm +++ b/Tweak.mm @@ -102,10 +102,11 @@ MSClassHook(UIPeripheralHost) - (void) enableCydget:(SBAwayController *)away { if (NSString *plugin = [self objectForKey:@"CYPlugin"] ?: [self objectForKey:@"Plugin"]) { ++online_; - UIKeyboardEnableAutomaticAppearance(); - [[UITextEffectsWindow sharedTextEffectsWindow] setWindowLevel:1000]; + if (kCFCoreFoundationVersionNumber < 600) + UIKeyboardEnableAutomaticAppearance(); + [[UITextEffectsWindow sharedTextEffectsWindow] setWindowLevel:1000]; [away enableLockScreenBundleWithName:plugin]; } } @@ -113,10 +114,11 @@ MSClassHook(UIPeripheralHost) - (void) disableCydget:(SBAwayController *)away { if (NSString *plugin = [self objectForKey:@"CYPlugin"] ?: [self objectForKey:@"Plugin"]) { [away disableLockScreenBundleWithName:plugin]; - [$UIPeripheralHost _releaseSharedInstance]; - UIKeyboardDisableAutomaticAppearance(); + if (kCFCoreFoundationVersionNumber < 600) + UIKeyboardDisableAutomaticAppearance(); + --online_; } } @@ -126,7 +128,7 @@ MSClassHook(UIPeripheralHost) // avoid rendering a keyboard onto the default SBAwayView while automatic keyboard is online MSInstanceMessageHook0(UIView *, SBAwayView, inputView) { // XXX: there is a conceptual error here - if (online_ == 0 && false) + if (online_ == 0 && false || kCFCoreFoundationVersionNumber > 600) return MSOldCall(); return [[[UIView alloc] init] autorelease]; @@ -134,7 +136,7 @@ MSInstanceMessageHook0(UIView *, SBAwayView, inputView) { // by default, keyboard actions are redirected to SBAwayController and press menu button MSInstanceMessageHook1(void, SpringBoard, handleKeyEvent, GSEventRef, event) { - if (online_ == 0) + if (online_ == 0 || kCFCoreFoundationVersionNumber > 600) return MSOldCall(event); return MSSuperCall(event); @@ -176,13 +178,12 @@ MSInstanceMessageHook1(void, SpringBoard, menuButtonDown, GSEventRef, event) { } MSInstanceMessageHook1(void, SBAwayView, addGestureRecognizer, id, recognizer) { - if (online_ == 0) + if (online_ == 0 || kCFCoreFoundationVersionNumber > 600) return MSOldCall(recognizer); } MSInstanceMessageHook1(void, SBAwayWindow, sendGSEvent, GSEventRef, event) { - NSLog(@"sendGSEvent"); - if (online_ == 0) + if (online_ == 0 || kCFCoreFoundationVersionNumber > 600) return MSOldCall(event); return MSSuperCall(event); -- 2.45.2