From: Joe Wreschnig Date: Wed, 6 Mar 2013 00:04:31 +0000 (+0100) Subject: Start help book. Tweak UI to deal with issues discovered trying to explain it. X-Git-Tag: version-1.0~33 X-Git-Url: https://git.yukkurigames.com/?a=commitdiff_plain;h=ce24f5cc4eb879f248f3363663c5330a06b1046f;p=enjoyable.git Start help book. Tweak UI to deal with issues discovered trying to explain it. --- diff --git a/English.lproj/MainMenu.xib b/English.lproj/MainMenu.xib index cc6ba01..402d345 100644 --- a/English.lproj/MainMenu.xib +++ b/English.lproj/MainMenu.xib @@ -62,7 +62,7 @@ Enjoyable - + CA 1048576 2147483647 @@ -299,6 +299,30 @@ _NSWindowsMenu + + + Help + + 2147483647 + + + submenuAction: + + Help + + + + Enjoyable Help + ? + 1048576 + 2147483647 + + + + + _NSHelpMenu + + _NSMainMenu @@ -321,106 +345,100 @@ 2 1 - + - 4AC66688-76E8-47ED-AC0A-7462220A4019 + 2CB21E35-9CF1-4C67-9670-31139C914D10 - Mapping Selector - Mapping Selector + Enabled + Enabled - - + + 268 - {{0, 14}, {140, 25}} + {{7, 14}, {36, 25}} + + + _NS:9 YES - + 67108864 134217728 - (default) + LucidaGrande 13 1044 _NS:9 - - 918306816 + + -1228128256 163 - + NSImage - NSListViewTemplate + NSRightFacingTriangleTemplate - 400 - 75 + 200 + 25 NO - + - {13, 25} - {141, 25} + {36, 25} + {36, 25} YES - NO + YES 0 YES 0 - + - 94389EFE-310F-4DB5-95F6-D4AEE8839979 + 4AC66688-76E8-47ED-AC0A-7462220A4019 - Translation Switch - Translation Switch + Mapping Selector + Mapping Selector - - + + 268 - {{19, 14}, {67, 25}} + {{0, 14}, {140, 25}} + + + _NS:9 YES - + 67108864 - 0 + 134217728 + (default) _NS:9 - - - - 32 - - NSImage - NSActionTemplate - - Show and remap inputs - YES - 0 - - - 32 - - NSImage - NSRightFacingTriangleTemplate - - Run mapped actions - 1 - 0 - - - 4 + + 918306816 + 163 + + NSImage + NSListViewTemplate + + + + 400 + 75 NO - + - {67, 25} - {67, 25} + {13, 25} + {141, 25} YES - YES + NO 0 YES 0 @@ -455,13 +473,13 @@ - + - + @@ -493,7 +511,7 @@ {200, 298} - + YES NO YES @@ -623,7 +641,7 @@ {202, 300} - + 150034 @@ -687,6 +705,7 @@ {{227, 55}, {180, 24}} + _NS:9 YES @@ -824,7 +843,7 @@ 603979776 0 - Press a key: + Press a key 1211912448 @@ -852,7 +871,7 @@ 603979776 0 - Mouse movement + Move the mouse 1211912448 @@ -866,7 +885,7 @@ 603979776 0 - Mouse button + Press a mouse button 1211912448 @@ -880,7 +899,7 @@ 603979776 0 - Mouse scroll + Scroll the mouse 1211912448 @@ -1031,7 +1050,7 @@ {198, 198} - + YES NO YES @@ -1123,7 +1142,7 @@ {{0, 20}, {200, 200}} - + 150034 @@ -1139,6 +1158,7 @@ {{66, -1}, {134, 23}} + _NS:22 YES @@ -1270,6 +1290,14 @@ 732 + + + showHelp: + + + + 870 + orderFrontStandardAboutPanel: @@ -1366,21 +1394,29 @@ 826 + + + translatingEventsMenu + + + + 877 + translatingEventsChanged: - + - 858 + 878 - translatingEventsSetting + translatingEventsButton - + - 859 + 879 @@ -1622,6 +1658,14 @@ 818 + + + performClick: + + + + 871 + view @@ -1646,6 +1690,14 @@ 853 + + + performClick: + + + + 880 + @@ -1680,6 +1732,7 @@ + Main Menu @@ -1903,8 +1956,8 @@ - + @@ -2213,28 +2266,6 @@ - - 842 - - - - - - Translation Switch - - - 840 - - - - - - - - 841 - - - 849 @@ -2285,6 +2316,48 @@ + + 866 + + + + + + + + 867 + + + + + + + + 868 + + + + + 874 + + + + + + + + 872 + + + + + + + + 873 + + + @@ -2322,8 +2395,24 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + + ToolTip + + ToolTip + + Create a new mapping + + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + + ToolTip + + ToolTip + + Remove the selected mapping + + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -2373,26 +2462,44 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + + ToolTip + + ToolTip + + Change the active mapping + + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + ToolTip + + ToolTip + + Enable mapped actions + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - 865 + 880 @@ -2446,7 +2553,8 @@ NJMappingsController NSOutlineView NJOutputController - NSSegmentedControl + NSButton + NSMenuItem @@ -2461,9 +2569,13 @@ outputController NJOutputController - - translatingEventsSetting - NSSegmentedControl + + translatingEventsButton + NSButton + + + translatingEventsMenu + NSMenuItem @@ -2644,7 +2756,6 @@ YES 3 - {15, 15} {8, 8} {11, 10} {11, 11} diff --git a/Enjoyable Help/Enjoyable Help.helpindex b/Enjoyable Help/Enjoyable Help.helpindex new file mode 100644 index 0000000..54568b5 Binary files /dev/null and b/Enjoyable Help/Enjoyable Help.helpindex differ diff --git a/Enjoyable Help/Enjoyable Help.html b/Enjoyable Help/Enjoyable Help.html new file mode 100644 index 0000000..6a78ca4 --- /dev/null +++ b/Enjoyable Help/Enjoyable Help.html @@ -0,0 +1,73 @@ + + + + + Enjoyable Help + + + + + + + + + + + + +
+
+ Enjoyable Icon +
+
+

Enjoyable Help

+
+
+ +

+ Enjoyable helps you use a joystick or gamepad to control + applications which normally require a keyboard and mouse. +

+ +
+

Quick Start

+
    +
  • Connect a joystick or gamepad.
  • +
  • Press a button on it, then the keyboard key you want to use.
  • +
  • Press the ▶ button in the upper-right.
  • +
  • Start up your game and use your gamepad!
  • + +
+ +
+

+ + Keyboard Events +
+ Map buttons to keys on a keyboard. +

+

+ + Mouse Events +
+ Use analog axes and buttons to simulate a mouse. +

+

+ + Application Mappings +
+ Create and share mappings for different applications. +

+
+ +

+ + Visit the Enjoyable website. + +

+ + + diff --git a/Enjoyable Help/gfx/Icon.png b/Enjoyable Help/gfx/Icon.png new file mode 100644 index 0000000..36c4254 Binary files /dev/null and b/Enjoyable Help/gfx/Icon.png differ diff --git a/Enjoyable Help/pgs/keyboard.html b/Enjoyable Help/pgs/keyboard.html new file mode 100644 index 0000000..99c414d --- /dev/null +++ b/Enjoyable Help/pgs/keyboard.html @@ -0,0 +1,59 @@ + + + + + Keyboard Events + + + + + + + + + + +
+
+ Enjoyable Icon +
+

Keyboard Events

+
+ +

+ Enjoyable supports mapping joystick buttons, hat switches, and + axis thresholds to simulate keyboard keys. To do this, first + press the button on the joystick you want to map. This will + select it on the left-hand side of the screen. +

+ +

+ If the button wasn't mapped, or was mapped to a key press + already, the key input field activates and you can simply press + the key you want to use. Otherwise, click on the Press a + key label or input field, then press the key. +

+ +

Clearing the Selection

+

+ To clear a mapped key, either select the Do nothing + option, or press ⌥⌫ when the key input field is selected. +

+ +

Cancelling the Selection

+

+ If you select the key input field by mistake, you can press ⌥⎋ + to cancel the selection without changing the current setting. +

+ + diff --git a/Enjoyable Help/pgs/mappings.html b/Enjoyable Help/pgs/mappings.html new file mode 100644 index 0000000..c6d8af4 --- /dev/null +++ b/Enjoyable Help/pgs/mappings.html @@ -0,0 +1,49 @@ + + + + + Discover Sample App + + + + + + + + + +
+
+$APPNAME$$ Icon +
+
+

Manage Application Mappings

+
+
+ +

Changing Dynamically

+Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas auctor leo in lorem dapibus eu tincidunt lacus viverra. Integer auctor tortor vel mauris pellentesque ultricies. Nulla lobortis, leo in facilisis cursus, elit felis viverra orci, ac luctus tellus sapien vel lectus. Aliquam ac accumsan risus. Nullam posuere, lectus commodo vestibulum luctus, mauris quam porta velit, ut pretium purus quam eu lacus. Nam in dui a sapien viverra euismod. Proin vel mauris nisi, sed tincidunt mi. Phasellus id ligula vitae mauris dapibus suscipit. Sed id erat nunc, in ultricies arcu. + +Nulla semper, magna non aliquam fringilla, turpis est convallis tortor, ut blandit elit orci nec elit. Phasellus id urna justo, a tristique mauris. Morbi sed nulla et lacus facilisis posuere et a purus. Morbi a dui quam. Nunc luctus ipsum ut purus sollicitudin cursus. Nulla facilisi. In vestibulum orci eu nunc euismod ut iaculis lacus commodo. Sed leo dolor, sagittis eu vulputate eget, accumsan eu leo. + +Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas auctor leo in lorem dapibus eu tincidunt lacus viverra. Integer auctor tortor vel mauris pellentesque ultricies. Nulla lobortis, leo in facilisis cursus, elit felis viverra orci, ac luctus tellus sapien vel lectus. Aliquam ac accumsan risus. Nullam posuere, lectus commodo vestibulum luctus, mauris quam porta velit, ut pretium purus quam eu lacus. Nam in dui a sapien viverra euismod. Proin vel mauris nisi, sed tincidunt mi. Phasellus id ligula vitae mauris dapibus suscipit. Sed id erat nunc, in ultricies arcu. + +Nulla semper, magna non aliquam fringilla, turpis est convallis tortor, ut blandit elit orci nec elit. Phasellus id urna justo, a tristique mauris. Morbi sed nulla et lacus facilisis posuere et a purus. Morbi a dui quam. Nunc luctus ipsum ut purus sollicitudin cursus. Nulla facilisi. In vestibulum orci eu nunc euismod ut iaculis lacus commodo. Sed leo dolor, sagittis eu vulputate eget, accumsan eu leo. + + + +

Automatic Switching

+ +

Sharing Mappings

+ + + diff --git a/Enjoyable Help/pgs/template.html b/Enjoyable Help/pgs/template.html new file mode 100644 index 0000000..daba5e5 --- /dev/null +++ b/Enjoyable Help/pgs/template.html @@ -0,0 +1,41 @@ + + + + + Title + + + + + + + + + + +
+
+ Icon +
+

Title

+
+ +

+ Content starts here. +

+ + diff --git a/Enjoyable Help/sty/default.css b/Enjoyable Help/sty/default.css new file mode 100644 index 0000000..58b7747 --- /dev/null +++ b/Enjoyable Help/sty/default.css @@ -0,0 +1 @@ +body { font-size: 8pt; font-family: "Lucida Grande", Arial, sans-serif; line-height: 12pt; text-decoration: none; margin-right: 1em; margin-left: 1em; } #navbox { background-color: #f2f2f2; position: fixed; top: 0; left: 0; width: 100%; height: 1.5em; float: left; border-bottom: 1px solid #bfbfbf } #navleftbox { position: absolute; top: 1px; left: 15px } #navrightbox { background-color: #f2f2f2; padding-right: 25px; float: right; padding-bottom: 1px; border-left: 1px solid #bfbfbf } #navbox a { font-size: 8pt; color: #666; font-weight: normal; margin: -9px 0 -6px; } #headerbox { margin-top: 36px; padding-right: 6px; margin-bottom: 2em; } #iconbox { float: left; } h1 { margin-left: 40px; width: 88%; font-size: 15pt; line-height: 15pt; font-weight: bold; padding-top: 6px; margin-bottom: 0; } h2 { font-size: 11pt; line-height: 12pt; font-weight: bold; color: black; margin-top: 0; margin-bottom: 11px; } h3 { font-size: 8pt; font-weight: bold; letter-spacing: 0.1em; line-height: 8pt; color: #666; margin-top: 1em; margin-bottom: 0px; padding-bottom: 0.5em; } p { margin-left: 0px; margin-top: 0px; margin-bottom: 0.5em; } ul { margin-left: 2em; margin-top: 6px; margin-bottom: 0px; padding-left: 0px; } li { margin-left: 0px; } a { color: #778fbd; font-size: 9pt; font-weight: bold; text-decoration: none; } a:hover { text-decoration: underline; } .weblink { color: #666; font-weight: normal; } \ No newline at end of file diff --git a/Enjoyable.xcodeproj/project.pbxproj b/Enjoyable.xcodeproj/project.pbxproj index c2f3246..4537688 100644 --- a/Enjoyable.xcodeproj/project.pbxproj +++ b/Enjoyable.xcodeproj/project.pbxproj @@ -32,6 +32,7 @@ D594BF830FAE9661007A85F2 /* EnjoyableApplicationDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = D594BF820FAE9661007A85F2 /* EnjoyableApplicationDelegate.m */; }; D5F809710FB093400006A4DE /* NJOutputMapping.m in Sources */ = {isa = PBXBuildFile; fileRef = D5F809700FB093400006A4DE /* NJOutputMapping.m */; }; D5F80A9D0FB0A2FF0006A4DE /* icon.icns in Resources */ = {isa = PBXBuildFile; fileRef = D5617A080FAEAF8300928B3A /* icon.icns */; }; + EE03150D16E63481002B2DCE /* Enjoyable Help in Resources */ = {isa = PBXBuildFile; fileRef = EE03150C16E63481002B2DCE /* Enjoyable Help */; }; EE1D7C9216E01E7000B000EB /* NSView+FirstResponder.m in Sources */ = {isa = PBXBuildFile; fileRef = EE1D7C9116E01E7000B000EB /* NSView+FirstResponder.m */; }; EE1D7C9616E0ECCF00B000EB /* NSError+Description.m in Sources */ = {isa = PBXBuildFile; fileRef = EE1D7C9516E0ECCF00B000EB /* NSError+Description.m */; }; EE96929416E54B480054A3C8 /* NSMenu+RepresentedObjectAccessors.m in Sources */ = {isa = PBXBuildFile; fileRef = EE96929316E54B480054A3C8 /* NSMenu+RepresentedObjectAccessors.m */; }; @@ -86,6 +87,7 @@ D594BF820FAE9661007A85F2 /* EnjoyableApplicationDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EnjoyableApplicationDelegate.m; sourceTree = ""; }; D5F8096F0FB093400006A4DE /* NJOutputMapping.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NJOutputMapping.h; sourceTree = ""; }; D5F809700FB093400006A4DE /* NJOutputMapping.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NJOutputMapping.m; sourceTree = ""; }; + EE03150C16E63481002B2DCE /* Enjoyable Help */ = {isa = PBXFileReference; lastKnownFileType = folder; path = "Enjoyable Help"; sourceTree = ""; }; EE1D7C9016E01E7000B000EB /* NSView+FirstResponder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSView+FirstResponder.h"; sourceTree = ""; }; EE1D7C9116E01E7000B000EB /* NSView+FirstResponder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSView+FirstResponder.m"; sourceTree = ""; }; EE1D7C9416E0ECCF00B000EB /* NSError+Description.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSError+Description.h"; sourceTree = ""; }; @@ -205,6 +207,7 @@ 29B97317FDCFA39411CA2CEA /* Resources */ = { isa = PBXGroup; children = ( + EE03150C16E63481002B2DCE /* Enjoyable Help */, D549CA4B0FBB441B00BC8203 /* Credits.rtf */, D5617A080FAEAF8300928B3A /* icon.icns */, 8D1107310486CEB800E47090 /* Info.plist */, @@ -293,6 +296,7 @@ 1DDD58160DA1D0A300B32029 /* MainMenu.xib in Resources */, D5F80A9D0FB0A2FF0006A4DE /* icon.icns in Resources */, D549CA4C0FBB441B00BC8203 /* Credits.rtf in Resources */, + EE03150D16E63481002B2DCE /* Enjoyable Help in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/Info.plist b/Info.plist index 2940aaf..4a530d9 100644 --- a/Info.plist +++ b/Info.plist @@ -2,6 +2,10 @@ + CFBundleHelpBookName + Enjoyable Help + CFBundleHelpBookFolder + Enjoyable Help NSSupportsAutomaticTermination YES NSSupportsSuddenTermination diff --git a/NJDeviceController.h b/NJDeviceController.h index cfa6d99..4e50fa4 100644 --- a/NJDeviceController.h +++ b/NJDeviceController.h @@ -15,7 +15,8 @@ IBOutlet NSOutlineView *outlineView; IBOutlet NJOutputController *outputController; IBOutlet NJMappingsController *mappingsController; - IBOutlet NSSegmentedControl *translatingEventsSetting; + IBOutlet NSButton *translatingEventsButton; + IBOutlet NSMenuItem *translatingEventsMenu; } @property (nonatomic, readonly) NJInput *selectedInput; diff --git a/NJDeviceController.m b/NJDeviceController.m index f5da6dd..7993842 100644 --- a/NJDeviceController.m +++ b/NJDeviceController.m @@ -224,7 +224,9 @@ objectValueForTableColumn:(NSTableColumn *)tableColumn - (void)setTranslatingEvents:(BOOL)translatingEvents { if (translatingEvents != _translatingEvents) { _translatingEvents = translatingEvents; - translatingEventsSetting.selectedSegment = !!translatingEvents; + NSInteger state = translatingEvents ? NSOnState : NSOffState; + translatingEventsButton.state = state; + translatingEventsMenu.title = translatingEvents ? @"Disable" : @"Enable"; NSString *name = translatingEvents ? NJEventTranslationActivated : NJEventTranslationDeactivated; @@ -233,8 +235,8 @@ objectValueForTableColumn:(NSTableColumn *)tableColumn } } -- (IBAction)translatingEventsChanged:(id)sender { - self.translatingEvents = translatingEventsSetting.selectedSegment; +- (IBAction)translatingEventsChanged:(NSButton *)sender { + self.translatingEvents = sender.state == NSOnState; } diff --git a/NJKeyInputField.m b/NJKeyInputField.m index b159aa3..ec08150 100644 --- a/NJKeyInputField.m +++ b/NJKeyInputField.m @@ -176,10 +176,14 @@ CGKeyCode NJKeyInputFieldEmpty = 0xFFFF; - (void)keyDown:(NSEvent *)theEvent { if (!theEvent.isARepeat) { if ((theEvent.modifierFlags & NSAlternateKeyMask) - && theEvent.keyCode == 0x35) { - // Allow Alt+Escape to clear the field. + && theEvent.keyCode == 0x33) { + // Allow Alt+Backspace to clear the field. self.keyCode = NJKeyInputFieldEmpty; [self.keyDelegate keyInputFieldDidClear:self]; + } else if ((theEvent.modifierFlags & NSAlternateKeyMask) + && theEvent.keyCode == 0x35) { + // Allow Alt+Escape to cancel. + ; } else { self.keyCode = theEvent.keyCode; [self.keyDelegate keyInputField:self didChangeKey:_keyCode];