Mouse mode toggle creates really confusing situations right now, disable it.
authorJoe Wreschnig <joe.wreschnig@gmail.com>
Wed, 6 Mar 2013 12:23:09 +0000 (13:23 +0100)
committerJoe Wreschnig <joe.wreschnig@gmail.com>
Wed, 6 Mar 2013 12:23:09 +0000 (13:23 +0100)
English.lproj/MainMenu.xib
Enjoyable.xcodeproj/project.pbxproj
NJDeviceController.h
NJOutput.m
NJOutputController.m
NJOutputMouseMove.m
NJOutputSwitchMouseMode.h [deleted file]
NJOutputSwitchMouseMode.m [deleted file]

index 9cce48b7d2d880cea6fafbb4a9fec59b34cc19c3..ad2d58d67ddb4fe002cb8f42983f8948fb2abc99 100644 (file)
                        <object class="NSWindowTemplate" id="808667431">
                                <int key="NSWindowStyleMask">15</int>
                                <int key="NSWindowBacking">2</int>
-                               <string key="NSWindowRect">{{355, 59}, {640, 300}}</string>
+                               <string key="NSWindowRect">{{355, 59}, {640, 270}}</string>
                                <int key="NSWTFlags">1685585920</int>
                                <string key="NSWindowTitle">Enjoyable</string>
                                <string key="NSWindowClass">NSWindow</string>
                                        <array key="NSToolbarIBSelectableItems" id="0"/>
                                </object>
                                <nil key="NSUserInterfaceItemIdentifier"/>
-                               <string key="NSWindowContentMinSize">{640, 300}</string>
+                               <string key="NSWindowContentMinSize">{640, 270}</string>
                                <object class="NSView" key="NSWindowView" id="177223957">
                                        <reference key="NSNextResponder"/>
                                        <int key="NSvFlags">256</int>
                                                                                                                <object class="NSOutlineView" id="365506042">
                                                                                                                        <reference key="NSNextResponder" ref="698362889"/>
                                                                                                                        <int key="NSvFlags">256</int>
-                                                                                                                       <string key="NSFrameSize">{200, 298}</string>
+                                                                                                                       <string key="NSFrameSize">{200, 268}</string>
                                                                                                                        <reference key="NSSuperview" ref="698362889"/>
                                                                                                                        <reference key="NSWindow"/>
                                                                                                                        <reference key="NSNextKeyView" ref="892486973"/>
                                                                                                                        <bool key="NSOutlineViewAutoresizesOutlineColumnKey">NO</bool>
                                                                                                                </object>
                                                                                                        </array>
-                                                                                                       <string key="NSFrame">{{1, 1}, {200, 298}}</string>
+                                                                                                       <string key="NSFrame">{{1, 1}, {200, 268}}</string>
                                                                                                        <reference key="NSSuperview" ref="364857164"/>
                                                                                                        <reference key="NSWindow"/>
                                                                                                        <reference key="NSNextKeyView" ref="365506042"/>
                                                                                                        <double key="NSPercent">0.99789030000000001</double>
                                                                                                </object>
                                                                                        </array>
-                                                                                       <string key="NSFrameSize">{202, 300}</string>
+                                                                                       <string key="NSFrameSize">{202, 270}</string>
                                                                                        <reference key="NSSuperview" ref="977242492"/>
                                                                                        <reference key="NSWindow"/>
                                                                                        <reference key="NSNextKeyView" ref="698362889"/>
                                                                                        <double key="NSMagnification">1</double>
                                                                                </object>
                                                                        </array>
-                                                                       <string key="NSFrameSize">{202, 300}</string>
+                                                                       <string key="NSFrameSize">{202, 270}</string>
                                                                        <reference key="NSSuperview" ref="206489479"/>
                                                                        <reference key="NSWindow"/>
                                                                        <reference key="NSNextKeyView" ref="364857164"/>
                                                                                <object class="NSSlider" id="792189805">
                                                                                        <reference key="NSNextResponder" ref="606740242"/>
                                                                                        <int key="NSvFlags">268</int>
-                                                                                       <string key="NSFrame">{{228, 52}, {140, 12}}</string>
+                                                                                       <string key="NSFrame">{{228, 22}, {140, 12}}</string>
                                                                                        <reference key="NSSuperview" ref="606740242"/>
                                                                                        <reference key="NSWindow"/>
                                                                                        <string key="NSReuseIdentifierKey">_NS:9</string>
                                                                                <object class="NSSlider" id="385416822">
                                                                                        <reference key="NSNextResponder" ref="606740242"/>
                                                                                        <int key="NSvFlags">268</int>
-                                                                                       <string key="NSFrame">{{228, 120}, {176, 12}}</string>
+                                                                                       <string key="NSFrame">{{228, 90}, {176, 12}}</string>
                                                                                        <reference key="NSSuperview" ref="606740242"/>
                                                                                        <reference key="NSWindow"/>
                                                                                        <reference key="NSNextKeyView" ref="125828224"/>
                                                                                <object class="NSSegmentedControl" id="875916470">
                                                                                        <reference key="NSNextResponder" ref="606740242"/>
                                                                                        <int key="NSvFlags">265</int>
-                                                                                       <string key="NSFrame">{{227, 132}, {178, 15}}</string>
+                                                                                       <string key="NSFrame">{{227, 102}, {178, 15}}</string>
                                                                                        <reference key="NSSuperview" ref="606740242"/>
                                                                                        <reference key="NSWindow"/>
                                                                                        <reference key="NSNextKeyView" ref="385416822"/>
                                                                                <object class="NSSegmentedControl" id="921829691">
                                                                                        <reference key="NSNextResponder" ref="606740242"/>
                                                                                        <int key="NSvFlags">265</int>
-                                                                                       <string key="NSFrame">{{227, 64}, {178, 15}}</string>
+                                                                                       <string key="NSFrame">{{227, 34}, {178, 15}}</string>
                                                                                        <reference key="NSSuperview" ref="606740242"/>
                                                                                        <reference key="NSWindow"/>
                                                                                        <reference key="NSNextKeyView" ref="792189805"/>
                                                                                <object class="NSSegmentedControl" id="125828224">
                                                                                        <reference key="NSNextResponder" ref="606740242"/>
                                                                                        <int key="NSvFlags">265</int>
-                                                                                       <string key="NSFrame">{{226, 89}, {180, 24}}</string>
+                                                                                       <string key="NSFrame">{{226, 59}, {180, 24}}</string>
                                                                                        <reference key="NSSuperview" ref="606740242"/>
                                                                                        <reference key="NSWindow"/>
                                                                                        <reference key="NSNextKeyView" ref="921829691"/>
                                                                                <object class="NSCustomView" id="57697638">
                                                                                        <reference key="NSNextResponder" ref="606740242"/>
                                                                                        <int key="NSvFlags">265</int>
-                                                                                       <string key="NSFrame">{{228, 190}, {176, 24}}</string>
+                                                                                       <string key="NSFrame">{{228, 160}, {176, 24}}</string>
                                                                                        <reference key="NSSuperview" ref="606740242"/>
                                                                                        <reference key="NSWindow"/>
                                                                                        <reference key="NSNextKeyView" ref="194275224"/>
                                                                                <object class="NSPopUpButton" id="194275224">
                                                                                        <reference key="NSNextResponder" ref="606740242"/>
                                                                                        <int key="NSvFlags">265</int>
-                                                                                       <string key="NSFrame">{{225, 156}, {182, 26}}</string>
+                                                                                       <string key="NSFrame">{{225, 126}, {182, 26}}</string>
                                                                                        <reference key="NSSuperview" ref="606740242"/>
                                                                                        <reference key="NSWindow"/>
                                                                                        <reference key="NSNextKeyView" ref="875916470"/>
                                                                                <object class="NSMatrix" id="120408205">
                                                                                        <reference key="NSNextResponder" ref="606740242"/>
                                                                                        <int key="NSvFlags">268</int>
-                                                                                       <string key="NSFrame">{{20, 16}, {200, 236}}</string>
+                                                                                       <string key="NSFrame">{{20, 20}, {200, 202}}</string>
                                                                                        <reference key="NSSuperview" ref="606740242"/>
                                                                                        <reference key="NSWindow"/>
                                                                                        <reference key="NSNextKeyView" ref="57697638"/>
                                                                                        <bool key="NSAllowsLogicalLayoutDirection">NO</bool>
-                                                                                       <int key="NSNumRows">7</int>
+                                                                                       <int key="NSNumRows">6</int>
                                                                                        <int key="NSNumCols">1</int>
                                                                                        <array class="NSMutableArray" key="NSCells">
                                                                                                <object class="NSButtonCell" id="177186415">
                                                                                                        <int key="NSPeriodicDelay">400</int>
                                                                                                        <int key="NSPeriodicInterval">75</int>
                                                                                                </object>
-                                                                                               <object class="NSButtonCell" id="211076068">
-                                                                                                       <int key="NSCellFlags">603979776</int>
-                                                                                                       <int key="NSCellFlags2">0</int>
-                                                                                                       <string key="NSContents">Switch mouse mode</string>
-                                                                                                       <reference key="NSSupport" ref="45863614"/>
-                                                                                                       <reference key="NSControlView" ref="120408205"/>
-                                                                                                       <int key="NSButtonFlags">1211912448</int>
-                                                                                                       <int key="NSButtonFlags2">0</int>
-                                                                                                       <reference key="NSNormalImage" ref="421587711"/>
-                                                                                                       <reference key="NSAlternateImage" ref="68833793"/>
-                                                                                                       <string key="NSAlternateContents"/>
-                                                                                                       <int key="NSPeriodicDelay">400</int>
-                                                                                                       <int key="NSPeriodicInterval">75</int>
-                                                                                               </object>
                                                                                        </array>
                                                                                        <string key="NSCellSize">{200, 32}</string>
                                                                                        <string key="NSIntercellSpacing">{4, 2}</string>
                                                                                <object class="NSTextField" id="1016088174">
                                                                                        <reference key="NSNextResponder" ref="606740242"/>
                                                                                        <int key="NSvFlags">266</int>
-                                                                                       <string key="NSFrame">{{0, 269}, {429, 17}}</string>
+                                                                                       <string key="NSFrame">{{0, 239}, {429, 17}}</string>
                                                                                        <reference key="NSSuperview" ref="606740242"/>
                                                                                        <reference key="NSWindow"/>
                                                                                        <reference key="NSNextKeyView" ref="497528019"/>
                                                                                <object class="NSBox" id="497528019">
                                                                                        <reference key="NSNextResponder" ref="606740242"/>
                                                                                        <int key="NSvFlags">10</int>
-                                                                                       <string key="NSFrame">{{12, 258}, {405, 5}}</string>
+                                                                                       <string key="NSFrame">{{12, 228}, {405, 5}}</string>
                                                                                        <reference key="NSSuperview" ref="606740242"/>
                                                                                        <reference key="NSWindow"/>
                                                                                        <reference key="NSNextKeyView" ref="120408205"/>
                                                                                        <bool key="NSTransparent">NO</bool>
                                                                                </object>
                                                                        </array>
-                                                                       <string key="NSFrame">{{211, 0}, {429, 300}}</string>
+                                                                       <string key="NSFrame">{{211, 0}, {429, 270}}</string>
                                                                        <reference key="NSSuperview" ref="206489479"/>
                                                                        <reference key="NSWindow"/>
                                                                        <reference key="NSNextKeyView" ref="1016088174"/>
                                                                        <string key="NSClassName">NSView</string>
                                                                </object>
                                                        </array>
-                                                       <string key="NSFrameSize">{640, 300}</string>
+                                                       <string key="NSFrameSize">{640, 270}</string>
                                                        <reference key="NSSuperview" ref="177223957"/>
                                                        <reference key="NSWindow"/>
                                                        <reference key="NSNextKeyView" ref="977242492"/>
                                                        <bool key="NSIsVertical">YES</bool>
                                                </object>
                                        </array>
-                                       <string key="NSFrameSize">{640, 300}</string>
+                                       <string key="NSFrameSize">{640, 270}</string>
                                        <reference key="NSSuperview"/>
                                        <reference key="NSWindow"/>
                                        <reference key="NSNextKeyView" ref="206489479"/>
                                </object>
                                <string key="NSScreenRect">{{0, 0}, {1440, 878}}</string>
-                               <string key="NSMinSize">{640, 355}</string>
+                               <string key="NSMinSize">{640, 325}</string>
                                <string key="NSMaxSize">{10000000000000, 10000000000000}</string>
                                <string key="NSFrameAutosaveName">Enjoyable</string>
                                <bool key="NSWindowIsRestorable">YES</bool>
                                                        <reference ref="820968178"/>
                                                        <reference ref="275466816"/>
                                                        <reference ref="134694197"/>
-                                                       <reference ref="211076068"/>
                                                </array>
                                                <reference key="parent" ref="606740242"/>
                                                <string key="objectName">Output Types</string>
                                                <reference key="object" ref="514491330"/>
                                                <reference key="parent" ref="125828224"/>
                                        </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">748</int>
-                                               <reference key="object" ref="211076068"/>
-                                               <reference key="parent" ref="120408205"/>
-                                               <string key="objectName">Switch Mouse Mode</string>
-                                       </object>
                                        <object class="IBObjectRecord">
                                                <int key="objectID">749</int>
                                                <reference key="object" ref="921829691"/>
                                <string key="744.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
                                <integer value="1" key="745.IBNSSegmentedControlInspectorSelectedSegmentMetadataKey"/>
                                <string key="745.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <string key="748.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
                                <string key="749.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
                                <integer value="3" key="750.IBNSSegmentedControlInspectorSelectedSegmentMetadataKey"/>
                                <string key="750.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
index 45376882585b7fe79e6418ba2c0db016bd3afb5c..2cc0bfedacf0ab9bc31ac8a2f7940e9c29928091 100644 (file)
@@ -11,7 +11,6 @@
                8B7E476C15C314A200C588FA /* NJOutputMouseButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 8B7E476B15C314A200C588FA /* NJOutputMouseButton.m */; };
                8BD9B54315C230FF00929C5D /* NJOutputMouseMove.m in Sources */ = {isa = PBXBuildFile; fileRef = 8BD9B54215C230FE00929C5D /* NJOutputMouseMove.m */; };
                8BEFAD9C15C46BFF00823AEC /* NJOutputMouseScroll.m in Sources */ = {isa = PBXBuildFile; fileRef = 8BEFAD9B15C46BFF00823AEC /* NJOutputMouseScroll.m */; };
-               8BEFADA015C476DC00823AEC /* NJOutputSwitchMouseMode.m in Sources */ = {isa = PBXBuildFile; fileRef = 8BEFAD9F15C476DC00823AEC /* NJOutputSwitchMouseMode.m */; };
                8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; };
                8D11072D0486CEB800E47090 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; };
                8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; };
@@ -52,8 +51,6 @@
                8BD9B54215C230FE00929C5D /* NJOutputMouseMove.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NJOutputMouseMove.m; sourceTree = "<group>"; };
                8BEFAD9A15C46BFF00823AEC /* NJOutputMouseScroll.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NJOutputMouseScroll.h; sourceTree = "<group>"; };
                8BEFAD9B15C46BFF00823AEC /* NJOutputMouseScroll.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NJOutputMouseScroll.m; sourceTree = "<group>"; };
-               8BEFAD9E15C476DC00823AEC /* NJOutputSwitchMouseMode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NJOutputSwitchMouseMode.h; sourceTree = "<group>"; };
-               8BEFAD9F15C476DC00823AEC /* NJOutputSwitchMouseMode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NJOutputSwitchMouseMode.m; sourceTree = "<group>"; };
                8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
                8D1107320486CEB800E47090 /* Enjoyable.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Enjoyable.app; sourceTree = BUILT_PRODUCTS_DIR; };
                D549CA4B0FBB441B00BC8203 /* Credits.rtf */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; path = Credits.rtf; sourceTree = "<group>"; };
                                8BD9B54215C230FE00929C5D /* NJOutputMouseMove.m */,
                                8BEFAD9A15C46BFF00823AEC /* NJOutputMouseScroll.h */,
                                8BEFAD9B15C46BFF00823AEC /* NJOutputMouseScroll.m */,
-                               8BEFAD9E15C476DC00823AEC /* NJOutputSwitchMouseMode.h */,
-                               8BEFAD9F15C476DC00823AEC /* NJOutputSwitchMouseMode.m */,
                        );
                        name = Classes;
                        sourceTree = "<group>";
                                8BD9B54315C230FF00929C5D /* NJOutputMouseMove.m in Sources */,
                                8B7E476C15C314A200C588FA /* NJOutputMouseButton.m in Sources */,
                                8BEFAD9C15C46BFF00823AEC /* NJOutputMouseScroll.m in Sources */,
-                               8BEFADA015C476DC00823AEC /* NJOutputSwitchMouseMode.m in Sources */,
                                EE1D7C9216E01E7000B000EB /* NSView+FirstResponder.m in Sources */,
                                EE1D7C9616E0ECCF00B000EB /* NSError+Description.m in Sources */,
                                EE96929416E54B480054A3C8 /* NSMenu+RepresentedObjectAccessors.m in Sources */,
index 4e50fa40e64114d4e80338d337896bceb7a2896d..f9221c0883433e611769b49051710f6525caca5b 100644 (file)
@@ -21,7 +21,6 @@
 
 @property (nonatomic, readonly) NJInput *selectedInput;
 @property (nonatomic, assign) NSPoint mouseLoc;
-@property (nonatomic, assign) BOOL frontWindowOnly;
 @property (nonatomic, assign) BOOL translatingEvents;
 
 - (void)setup;
index ab29ed891e87ec6a6f6de453da88ad01e49aa2a1..409b3e62308373a8cb8dabe64858ec7b44f2d6d0 100644 (file)
@@ -12,7 +12,6 @@
 #import "NJOutputMouseMove.h"
 #import "NJOutputMouseButton.h"
 #import "NJOutputMouseScroll.h"
-#import "NJOutputSwitchMouseMode.h"
 
 @implementation NJOutput {
     BOOL running;
@@ -47,8 +46,7 @@
                         NJOutputMapping.class,
                         NJOutputMouseMove.class,
                         NJOutputMouseButton.class,
-                        NJOutputMouseScroll.class,
-                        NJOutputSwitchMouseMode.class
+                        NJOutputMouseScroll.class
          ]) {
         if ([type isEqualToString:cls.serializationCode])
             return [cls outputDeserialize:serialization withMappings:mappings];
index f3eca24b79c50a6857e45e0f60214bf8a5b10196..b4152e9a825d7b31341e93e62ad94d9a15a4f88e 100644 (file)
@@ -19,7 +19,6 @@
 #import "NJOutputMouseButton.h"
 #import "NJOutputMouseMove.h"
 #import "NJOutputMouseScroll.h"
-#import "NJOutputSwitchMouseMode.h"
 
 @implementation NJOutputController
 
                 : 0.f;
             return ms;
         }
-        case 6: {
-            NJOutputSwitchMouseMode *tms = [[NJOutputSwitchMouseMode alloc] init];
-            return tms;
-        }
         default:
             return nil;
     }
         float speed = [(NJOutputMouseScroll *)output speed];
         scrollDirSelect.selectedSegment = (direction > 0) + !speed * 2;
         scrollSpeedSlider.floatValue = speed;
-    }
-    else if ([output isKindOfClass:NJOutputSwitchMouseMode.class]) {
-        [radioButtons selectCellAtRow:6 column:0];
     } else {
         [radioButtons selectCellAtRow:self.enabled ? 0 : -1 column:0];
     }
index bca5d2d042221ece61ede692a11250403fbe295b..4cafb1c58be70e2ad99c0a8792c751588d903149 100644 (file)
     CGEventSetType(move, kCGEventMouseMoved);
     CGEventSetIntegerValueField(move, kCGMouseEventDeltaX, (int)dx);
     CGEventSetIntegerValueField(move, kCGMouseEventDeltaY, (int)dy);
-    
-    if (jc.frontWindowOnly) {
-        ProcessSerialNumber psn;
-        GetFrontProcess(&psn);
-        CGEventPostToPSN(&psn, move);
-    }
-    else {
-        CGEventPost(kCGHIDEventTap, move);
-    }
-    
+    CGEventPost(kCGHIDEventTap, move);
     CFRelease(move);
     return YES;
 }
diff --git a/NJOutputSwitchMouseMode.h b/NJOutputSwitchMouseMode.h
deleted file mode 100644 (file)
index 790f84b..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-//
-//  NJOutputSwitchMouseMode.h
-//  Enjoy
-//
-//  Created by Yifeng Huang on 7/28/12.
-//
-
-#import "NJOutput.h"
-
-@interface NJOutputSwitchMouseMode : NJOutput
-
-@end
diff --git a/NJOutputSwitchMouseMode.m b/NJOutputSwitchMouseMode.m
deleted file mode 100644 (file)
index 130a2a0..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-//
-//  NJOutputSwitchMouseMode.m
-//  Enjoy
-//
-//  Created by Yifeng Huang on 7/28/12.
-//
-
-#import "NJOutputSwitchMouseMode.h"
-
-#import "EnjoyableApplicationDelegate.h"
-#import "NJDeviceController.h"
-
-@implementation NJOutputSwitchMouseMode
-
-+ (NSString *)serializationCode {
-    return @"switch mouse mode";
-}
-
-- (NSDictionary *)serialize {
-    return @{ @"type": self.class.serializationCode };
-}
-
-+ (NJOutput *)outputDeserialize:(NSDictionary *)serialization
-                  withMappings:(NSArray *)mappings {
-    return [[NJOutputSwitchMouseMode alloc] init];
-}
-- (void)trigger {
-    // FIXME: It's hacky to get at the controller this way, but it's
-    // also hacky to pass it. Shouldn't need to do either.
-    EnjoyableApplicationDelegate *ac = NSApplication.sharedApplication.delegate;
-    NJDeviceController *jc = ac.inputController;
-    jc.frontWindowOnly = !jc.frontWindowOnly;
-}
-
-@end