From 5f3311b43f99187a9bfe2c0b38da7e64d6986da1 Mon Sep 17 00:00:00 2001 From: Joe Wreschnig Date: Sat, 9 Mar 2013 19:57:54 +0100 Subject: [PATCH] Select mouse button by tag; expose buttons 4 and 5 in the UI. --- Classes/NJOutputController.m | 4 +- Classes/NJOutputMouseButton.h | 4 -- Classes/NJOutputMouseButton.m | 18 ------- Info.plist | 2 +- Resources/English.lproj/MainMenu.xib | 75 ++++++++++++++-------------- 5 files changed, 41 insertions(+), 62 deletions(-) diff --git a/Classes/NJOutputController.m b/Classes/NJOutputController.m index ebedb1b..d022406 100644 --- a/Classes/NJOutputController.m +++ b/Classes/NJOutputController.m @@ -175,7 +175,7 @@ } case 4: { NJOutputMouseButton *mb = [[NJOutputMouseButton alloc] init]; - mb.humanIndexedButton = mouseBtnSelect.selectedSegment; + mb.button = [mouseBtnSelect.cell tagForSegment:mouseBtnSelect.selectedSegment]; return mb; } case 5: { @@ -242,7 +242,7 @@ } else if ([output isKindOfClass:NJOutputMouseButton.class]) { [radioButtons selectCellAtRow:4 column:0]; - mouseBtnSelect.selectedSegment = [(NJOutputMouseButton *)output humanIndexedButton]; + [mouseBtnSelect selectSegmentWithTag:[(NJOutputMouseButton *)output button]]; } else if ([output isKindOfClass:NJOutputMouseScroll.class]) { [radioButtons selectCellAtRow:5 column:0]; diff --git a/Classes/NJOutputMouseButton.h b/Classes/NJOutputMouseButton.h index 24d39b0..4d790e5 100644 --- a/Classes/NJOutputMouseButton.h +++ b/Classes/NJOutputMouseButton.h @@ -10,9 +10,5 @@ @interface NJOutputMouseButton : NJOutput @property (nonatomic, assign) CGMouseButton button; - // Indexed as left, right, center. - -@property (nonatomic, assign) int humanIndexedButton; - // Indexed as left, center, right. @end diff --git a/Classes/NJOutputMouseButton.m b/Classes/NJOutputMouseButton.m index c9fe0eb..5ddb69d 100644 --- a/Classes/NJOutputMouseButton.m +++ b/Classes/NJOutputMouseButton.m @@ -81,22 +81,4 @@ CFRelease(click); } -- (int)humanIndexedButton { - switch (_button) { - case kCGMouseButtonLeft: return 0; - case kCGMouseButtonCenter: return 1; - case kCGMouseButtonRight: return 2; - default: return 0; - } -} - -- (void)setHumanIndexedButton:(int)humanIndexedButton { - switch (humanIndexedButton) { - case 0: _button = kCGMouseButtonLeft; break; - case 1: _button = kCGMouseButtonCenter; break; - case 2: _button = kCGMouseButtonRight; break; - default: _button = kCGMouseButtonLeft; - } -} - @end diff --git a/Info.plist b/Info.plist index b9ce686..4ad3f41 100644 --- a/Info.plist +++ b/Info.plist @@ -46,7 +46,7 @@ CFBundleSignature ???? CFBundleVersion - 63 + 69 LSApplicationCategoryType public.app-category.utilities NSHumanReadableCopyright diff --git a/Resources/English.lproj/MainMenu.xib b/Resources/English.lproj/MainMenu.xib index 0c4cdf5..772132e 100644 --- a/Resources/English.lproj/MainMenu.xib +++ b/Resources/English.lproj/MainMenu.xib @@ -321,7 +321,7 @@ 15 2 - {{355, 59}, {620, 323}} + {{355, 59}, {664, 323}} 1685585920 Enjoyable NSWindow @@ -470,7 +470,7 @@ - {620, 323} + {664, 323} 256 @@ -679,7 +679,7 @@ aW5nLg 265 - {{189, 117}, {180, 20}} + {{189, 117}, {224, 20}} @@ -693,23 +693,23 @@ aW5nLg - 44 + 55 ← 0 - 44 + 55 → 1 0 - 42 + 53 ↑ 0 - 41 + 52 ↓ 0 @@ -721,7 +721,7 @@ aW5nLg 265 - {{189, 33}, {180, 20}} + {{189, 33}, {224, 20}} @@ -735,13 +735,13 @@ aW5nLg - 64 + 86 ↑ Scroll up continuously 0 - 63 + 85 ↓ Scroll down continuously 1 @@ -765,7 +765,7 @@ aW5nLg 265 - {{191, 24}, {130, 16}} + {{191, 24}, {176, 16}} @@ -791,7 +791,7 @@ aW5nLg 265 - {{189, 70}, {180, 24}} + {{189, 70}, {224, 24}} @@ -814,13 +814,27 @@ aW5nLg 0 + 60 Center - 1 + 2 0 55 Right + 1 + 0 + + + 22 + 4 + 3 + 0 + + + 22 + 5 + 4 0 @@ -831,7 +845,7 @@ aW5nLg 265 - {{191, 108}, {176, 16}} + {{191, 108}, {220, 16}} @@ -857,7 +871,7 @@ aW5nLg 265 - {{191, 196}, {176, 23}} + {{191, 196}, {220, 23}} @@ -867,13 +881,13 @@ aW5nLg 265 - {{188, 153}, {182, 26}} + {{188, 153}, {226, 26}} YES - -1539309504 + -2076180416 2048 @@ -1082,7 +1096,7 @@ aW5nLg NO - {{233, 0}, {387, 323}} + {{233, 0}, {431, 323}} @@ -1090,19 +1104,19 @@ aW5nLg NSView - {620, 323} + {664, 323} {{0, 0}, {1440, 878}} - {620, 378} + {664, 378} {10000000000000, 10000000000000} Enjoyable YES - + 256 @@ -1118,8 +1132,7 @@ aW5nLg 256 {198, 198} - - + YES NO YES @@ -1176,7 +1189,6 @@ aW5nLg {{1, 1}, {198, 198}} - @@ -1187,7 +1199,6 @@ aW5nLg -2147483392 {{306, 1}, {15, 403}} - NO @@ -1199,7 +1210,6 @@ aW5nLg -2147483392 {{-100, -100}, {366, 16}} - NO 1 @@ -1210,8 +1220,7 @@ aW5nLg {{0, 20}, {200, 200}} - - + 150034 @@ -1226,7 +1235,6 @@ aW5nLg 268 {{66, -1}, {68, 23}} - _NS:22 YES @@ -1255,7 +1263,6 @@ aW5nLg 292 {{0, -1}, {34, 23}} - YES @@ -1282,8 +1289,6 @@ aW5nLg 292 {{166, -1}, {34, 23}} - - YES 67108864 @@ -1305,7 +1310,6 @@ aW5nLg 292 {{133, -1}, {34, 23}} - YES @@ -1328,7 +1332,6 @@ aW5nLg 292 {{33, -1}, {34, 23}} - YES @@ -1352,8 +1355,6 @@ aW5nLg {200, 220} - - NSView @@ -2953,7 +2954,7 @@ aW5nLg - 941 + 945 -- 2.20.1