From 7509e2cc66447be620a3b2a7295e5273e8da6e01 Mon Sep 17 00:00:00 2001 From: Joe Wreschnig Date: Wed, 6 Mar 2013 13:23:09 +0100 Subject: [PATCH] Mouse mode toggle creates really confusing situations right now, disable it. --- English.lproj/MainMenu.xib | 64 ++++++++++------------------- Enjoyable.xcodeproj/project.pbxproj | 6 --- NJDeviceController.h | 1 - NJOutput.m | 4 +- NJOutputController.m | 8 ---- NJOutputMouseMove.m | 11 +---- NJOutputSwitchMouseMode.h | 12 ------ NJOutputSwitchMouseMode.m | 35 ---------------- 8 files changed, 23 insertions(+), 118 deletions(-) delete mode 100644 NJOutputSwitchMouseMode.h delete mode 100644 NJOutputSwitchMouseMode.m diff --git a/English.lproj/MainMenu.xib b/English.lproj/MainMenu.xib index 9cce48b..ad2d58d 100644 --- a/English.lproj/MainMenu.xib +++ b/English.lproj/MainMenu.xib @@ -331,7 +331,7 @@ 15 2 - {{355, 59}, {640, 300}} + {{355, 59}, {640, 270}} 1685585920 Enjoyable NSWindow @@ -480,7 +480,7 @@ - {640, 300} + {640, 270} 256 @@ -504,7 +504,7 @@ 256 - {200, 298} + {200, 268} @@ -600,7 +600,7 @@ NO - {{1, 1}, {200, 298}} + {{1, 1}, {200, 268}} @@ -634,7 +634,7 @@ 0.99789030000000001 - {202, 300} + {202, 270} @@ -648,7 +648,7 @@ 1 - {202, 300} + {202, 270} @@ -661,7 +661,7 @@ 268 - {{228, 52}, {140, 12}} + {{228, 22}, {140, 12}} _NS:9 @@ -686,7 +686,7 @@ 268 - {{228, 120}, {176, 12}} + {{228, 90}, {176, 12}} @@ -712,7 +712,7 @@ 265 - {{227, 132}, {178, 15}} + {{227, 102}, {178, 15}} @@ -759,7 +759,7 @@ 265 - {{227, 64}, {178, 15}} + {{227, 34}, {178, 15}} @@ -804,7 +804,7 @@ 265 - {{226, 89}, {180, 24}} + {{226, 59}, {180, 24}} @@ -841,7 +841,7 @@ 265 - {{228, 190}, {176, 24}} + {{228, 160}, {176, 24}} @@ -851,7 +851,7 @@ 265 - {{225, 156}, {182, 26}} + {{225, 126}, {182, 26}} @@ -884,12 +884,12 @@ 268 - {{20, 16}, {200, 236}} + {{20, 20}, {200, 202}} NO - 7 + 6 1 @@ -983,20 +983,6 @@ 400 75 - - 603979776 - 0 - Switch mouse mode - - - 1211912448 - 0 - - - - 400 - 75 - {200, 32} {4, 2} @@ -1029,7 +1015,7 @@ 266 - {{0, 269}, {429, 17}} + {{0, 239}, {429, 17}} @@ -1053,7 +1039,7 @@ 10 - {{12, 258}, {405, 5}} + {{12, 228}, {405, 5}} @@ -1080,27 +1066,27 @@ NO - {{211, 0}, {429, 300}} + {{211, 0}, {429, 270}} NSView - {640, 300} + {640, 270} YES - {640, 300} + {640, 270} {{0, 0}, {1440, 878}} - {640, 355} + {640, 325} {10000000000000, 10000000000000} Enjoyable YES @@ -2185,7 +2171,6 @@ - Output Types @@ -2292,12 +2277,6 @@ - - 748 - - - Switch Mouse Mode - 749 @@ -2576,7 +2555,6 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin diff --git a/Enjoyable.xcodeproj/project.pbxproj b/Enjoyable.xcodeproj/project.pbxproj index 4537688..2cc0bfe 100644 --- a/Enjoyable.xcodeproj/project.pbxproj +++ b/Enjoyable.xcodeproj/project.pbxproj @@ -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 = ""; }; 8BEFAD9A15C46BFF00823AEC /* NJOutputMouseScroll.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NJOutputMouseScroll.h; sourceTree = ""; }; 8BEFAD9B15C46BFF00823AEC /* NJOutputMouseScroll.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NJOutputMouseScroll.m; sourceTree = ""; }; - 8BEFAD9E15C476DC00823AEC /* NJOutputSwitchMouseMode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NJOutputSwitchMouseMode.h; sourceTree = ""; }; - 8BEFAD9F15C476DC00823AEC /* NJOutputSwitchMouseMode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NJOutputSwitchMouseMode.m; sourceTree = ""; }; 8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 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 = ""; }; @@ -149,8 +146,6 @@ 8BD9B54215C230FE00929C5D /* NJOutputMouseMove.m */, 8BEFAD9A15C46BFF00823AEC /* NJOutputMouseScroll.h */, 8BEFAD9B15C46BFF00823AEC /* NJOutputMouseScroll.m */, - 8BEFAD9E15C476DC00823AEC /* NJOutputSwitchMouseMode.h */, - 8BEFAD9F15C476DC00823AEC /* NJOutputSwitchMouseMode.m */, ); name = Classes; sourceTree = ""; @@ -325,7 +320,6 @@ 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 */, diff --git a/NJDeviceController.h b/NJDeviceController.h index 4e50fa4..f9221c0 100644 --- a/NJDeviceController.h +++ b/NJDeviceController.h @@ -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; diff --git a/NJOutput.m b/NJOutput.m index ab29ed8..409b3e6 100644 --- a/NJOutput.m +++ b/NJOutput.m @@ -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]; diff --git a/NJOutputController.m b/NJOutputController.m index f3eca24..b4152e9 100644 --- a/NJOutputController.m +++ b/NJOutputController.m @@ -19,7 +19,6 @@ #import "NJOutputMouseButton.h" #import "NJOutputMouseMove.h" #import "NJOutputMouseScroll.h" -#import "NJOutputSwitchMouseMode.h" @implementation NJOutputController @@ -185,10 +184,6 @@ : 0.f; return ms; } - case 6: { - NJOutputSwitchMouseMode *tms = [[NJOutputSwitchMouseMode alloc] init]; - return tms; - } default: return nil; } @@ -252,9 +247,6 @@ 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]; } diff --git a/NJOutputMouseMove.m b/NJOutputMouseMove.m index bca5d2d..4cafb1c 100644 --- a/NJOutputMouseMove.m +++ b/NJOutputMouseMove.m @@ -68,16 +68,7 @@ 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 index 790f84b..0000000 --- a/NJOutputSwitchMouseMode.h +++ /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 index 130a2a0..0000000 --- a/NJOutputSwitchMouseMode.m +++ /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 -- 2.20.1