]> git.saurik.com Git - cydget.git/commitdiff
Revert a bunch of keyboard behavior for now: I hate Cydget.
authorJay Freeman (saurik) <saurik@saurik.com>
Sun, 4 Mar 2012 21:43:21 +0000 (21:43 +0000)
committerJay Freeman (saurik) <saurik@saurik.com>
Sun, 4 Mar 2012 21:43:21 +0000 (21:43 +0000)
Tweak.mm

index 8ffeccca260e3105a61db96a5279526eb0940f88..e957efe460ad435b97157bd3609710ce91c9bc66 100644 (file)
--- 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);