Clean up root folder.
authorJoe Wreschnig <joe.wreschnig@gmail.com>
Thu, 7 Mar 2013 13:56:08 +0000 (14:56 +0100)
committerJoe Wreschnig <joe.wreschnig@gmail.com>
Thu, 7 Mar 2013 13:56:08 +0000 (14:56 +0100)
128 files changed:
Categories/NSError+Description.h [new file with mode: 0644]
Categories/NSError+Description.m [new file with mode: 0644]
Categories/NSFileManager+UniqueNames.h [new file with mode: 0644]
Categories/NSFileManager+UniqueNames.m [new file with mode: 0644]
Categories/NSMenu+RepresentedObjectAccessors.h [new file with mode: 0644]
Categories/NSMenu+RepresentedObjectAccessors.m [new file with mode: 0644]
Categories/NSMutableArray+MoveObject.h [new file with mode: 0644]
Categories/NSMutableArray+MoveObject.m [new file with mode: 0644]
Categories/NSString+FixFilename.h [new file with mode: 0644]
Categories/NSString+FixFilename.m [new file with mode: 0644]
Categories/NSView+FirstResponder.h [new file with mode: 0644]
Categories/NSView+FirstResponder.m [new file with mode: 0644]
Classes/EnjoyableApplicationDelegate.h [new file with mode: 0644]
Classes/EnjoyableApplicationDelegate.m [new file with mode: 0644]
Classes/NJDevice.h [new file with mode: 0644]
Classes/NJDevice.m [new file with mode: 0644]
Classes/NJDeviceController.h [new file with mode: 0644]
Classes/NJDeviceController.m [new file with mode: 0644]
Classes/NJInput.h [new file with mode: 0644]
Classes/NJInput.m [new file with mode: 0644]
Classes/NJInputAnalog.h [new file with mode: 0644]
Classes/NJInputAnalog.m [new file with mode: 0644]
Classes/NJInputButton.h [new file with mode: 0644]
Classes/NJInputButton.m [new file with mode: 0644]
Classes/NJInputHat.h [new file with mode: 0644]
Classes/NJInputHat.m [new file with mode: 0644]
Classes/NJInputPathElement.h [new file with mode: 0644]
Classes/NJKeyInputField.h [new file with mode: 0644]
Classes/NJKeyInputField.m [new file with mode: 0644]
Classes/NJMapping.h [new file with mode: 0644]
Classes/NJMapping.m [new file with mode: 0644]
Classes/NJMappingsController.h [new file with mode: 0644]
Classes/NJMappingsController.m [new file with mode: 0644]
Classes/NJOutput.h [new file with mode: 0644]
Classes/NJOutput.m [new file with mode: 0644]
Classes/NJOutputController.h [new file with mode: 0644]
Classes/NJOutputController.m [new file with mode: 0644]
Classes/NJOutputKeyPress.h [new file with mode: 0644]
Classes/NJOutputKeyPress.m [new file with mode: 0644]
Classes/NJOutputMapping.h [new file with mode: 0644]
Classes/NJOutputMapping.m [new file with mode: 0644]
Classes/NJOutputMouseButton.h [new file with mode: 0644]
Classes/NJOutputMouseButton.m [new file with mode: 0644]
Classes/NJOutputMouseMove.h [new file with mode: 0644]
Classes/NJOutputMouseMove.m [new file with mode: 0644]
Classes/NJOutputMouseScroll.h [new file with mode: 0644]
Classes/NJOutputMouseScroll.m [new file with mode: 0644]
English.lproj/InfoPlist.strings [deleted file]
English.lproj/MainMenu.xib [deleted file]
EnjoyableApplicationDelegate.h [deleted file]
EnjoyableApplicationDelegate.m [deleted file]
Enjoyable_Prefix.pch [deleted file]
Help/Contents/Info.plist [deleted file]
Help/Contents/Resources/English.lproj/Makefile [deleted file]
Help/Contents/Resources/English.lproj/gfx/Icon.png [deleted file]
Help/Contents/Resources/English.lproj/index.html [deleted file]
Help/Contents/Resources/English.lproj/pgs/boring.html [deleted file]
Help/Contents/Resources/English.lproj/pgs/keyboard.html [deleted file]
Help/Contents/Resources/English.lproj/pgs/mappings.html [deleted file]
Help/Contents/Resources/English.lproj/pgs/mouse.html [deleted file]
Help/Contents/Resources/English.lproj/pgs/problems.html [deleted file]
Help/Contents/Resources/English.lproj/sty/default.css [deleted file]
NJDevice.h [deleted file]
NJDevice.m [deleted file]
NJDeviceController.h [deleted file]
NJDeviceController.m [deleted file]
NJEvents.h [deleted file]
NJInput.h [deleted file]
NJInput.m [deleted file]
NJInputAnalog.h [deleted file]
NJInputAnalog.m [deleted file]
NJInputButton.h [deleted file]
NJInputButton.m [deleted file]
NJInputHat.h [deleted file]
NJInputHat.m [deleted file]
NJInputPathElement.h [deleted file]
NJKeyInputField.h [deleted file]
NJKeyInputField.m [deleted file]
NJMapping.h [deleted file]
NJMapping.m [deleted file]
NJMappingsController.h [deleted file]
NJMappingsController.m [deleted file]
NJOutput.h [deleted file]
NJOutput.m [deleted file]
NJOutputController.h [deleted file]
NJOutputController.m [deleted file]
NJOutputKeyPress.h [deleted file]
NJOutputKeyPress.m [deleted file]
NJOutputMapping.h [deleted file]
NJOutputMapping.m [deleted file]
NJOutputMouseButton.h [deleted file]
NJOutputMouseButton.m [deleted file]
NJOutputMouseMove.h [deleted file]
NJOutputMouseMove.m [deleted file]
NJOutputMouseScroll.h [deleted file]
NJOutputMouseScroll.m [deleted file]
NSError+Description.h [deleted file]
NSError+Description.m [deleted file]
NSFileManager+UniqueNames.h [deleted file]
NSFileManager+UniqueNames.m [deleted file]
NSMenu+RepresentedObjectAccessors.h [deleted file]
NSMenu+RepresentedObjectAccessors.m [deleted file]
NSMutableArray+MoveObject.h [deleted file]
NSMutableArray+MoveObject.m [deleted file]
NSString+FixFilename.h [deleted file]
NSString+FixFilename.m [deleted file]
NSView+FirstResponder.h [deleted file]
NSView+FirstResponder.m [deleted file]
Other Sources/Enjoyable_Prefix.pch [new file with mode: 0644]
Other Sources/NJEvents.h [new file with mode: 0644]
Other Sources/main.m [new file with mode: 0644]
Resources/English.lproj/InfoPlist.strings [new file with mode: 0644]
Resources/English.lproj/MainMenu.xib [new file with mode: 0644]
Resources/Help/Contents/Info.plist [new file with mode: 0644]
Resources/Help/Contents/Resources/English.lproj/Makefile [new file with mode: 0644]
Resources/Help/Contents/Resources/English.lproj/gfx/Icon.png [new file with mode: 0644]
Resources/Help/Contents/Resources/English.lproj/index.html [new file with mode: 0644]
Resources/Help/Contents/Resources/English.lproj/pgs/boring.html [new file with mode: 0644]
Resources/Help/Contents/Resources/English.lproj/pgs/keyboard.html [new file with mode: 0644]
Resources/Help/Contents/Resources/English.lproj/pgs/mappings.html [new file with mode: 0644]
Resources/Help/Contents/Resources/English.lproj/pgs/mouse.html [new file with mode: 0644]
Resources/Help/Contents/Resources/English.lproj/pgs/problems.html [new file with mode: 0644]
Resources/Help/Contents/Resources/English.lproj/sty/default.css [new file with mode: 0644]
Resources/Icon.icns [new file with mode: 0644]
Resources/com.yukkurigames.Enjoyable.mapping.icns [new file with mode: 0644]
com.yukkurigames.Enjoyable.mapping.icns [deleted file]
icon.icns [deleted file]
main.m [deleted file]

diff --git a/Categories/NSError+Description.h b/Categories/NSError+Description.h
new file mode 100644 (file)
index 0000000..a722e9e
--- /dev/null
@@ -0,0 +1,9 @@
+#import <Foundation/Foundation.h>
+
+@interface NSError (Description)
+
++ (NSError *)errorWithDomain:(NSString *)domain
+                        code:(NSInteger)code
+                 description:(NSString *)description;
+
+@end
diff --git a/Categories/NSError+Description.m b/Categories/NSError+Description.m
new file mode 100644 (file)
index 0000000..126bb17
--- /dev/null
@@ -0,0 +1,13 @@
+#import "NSError+Description.h"
+
+@implementation NSError (Description)
+
++ (NSError *)errorWithDomain:(NSString *)domain
+                        code:(NSInteger)code
+                 description:(NSString *)description {
+    NSDictionary *errorDict = @{ NSLocalizedDescriptionKey : description };
+    return [NSError errorWithDomain:domain code:code userInfo:errorDict];
+
+}
+
+@end
diff --git a/Categories/NSFileManager+UniqueNames.h b/Categories/NSFileManager+UniqueNames.h
new file mode 100644 (file)
index 0000000..82c57d4
--- /dev/null
@@ -0,0 +1,26 @@
+//
+//  NSFileManager+UniqueNames.h
+//  Enjoyable
+//
+//  Created by Joe Wreschnig on 3/7/13.
+//
+//
+
+#import <Foundation/Foundation.h>
+
+@interface NSFileManager (UniqueNames)
+
+- (NSURL *)generateUniqueURLWithBase:(NSURL *)canonical;
+    // Generate a probably-unique URL by trying sequential indices, e.g.
+    //     file://Test.txt
+    //     file://Test (1).txt
+    //     file://Test (2).txt
+    // and so on.
+    //
+    // The URL is only probably unique. It is subject to the usual
+    // race conditions associated with generating a filename before
+    // actually opening it. It also does not check remote resources,
+    // as it operates synchronously. Finally, it gives up after 10,000
+    // indices.
+
+@end
diff --git a/Categories/NSFileManager+UniqueNames.m b/Categories/NSFileManager+UniqueNames.m
new file mode 100644 (file)
index 0000000..c7eb768
--- /dev/null
@@ -0,0 +1,31 @@
+//
+//  NSFileManager+UniqueNames.m
+//  Enjoyable
+//
+//  Created by Joe Wreschnig on 3/7/13.
+//
+//
+
+#import "NSFileManager+UniqueNames.h"
+
+@implementation NSFileManager (UniqueNames)
+
+- (NSURL *)generateUniqueURLWithBase:(NSURL *)canonical {
+    // Punt for cases that are just too hard.
+    if (!canonical.isFileURL)
+        return canonical;
+
+    NSString *trying = canonical.path;
+    NSString *dirname = [trying stringByDeletingLastPathComponent];
+    NSString *basename = [trying.lastPathComponent stringByDeletingPathExtension];
+    NSString *extension = trying.pathExtension;
+    int index = 1;
+    while ([self fileExistsAtPath:trying] && index < 10000) {
+        NSString *indexName = [NSString stringWithFormat:@"%@ (%d)", basename, index++];
+        indexName = [indexName stringByAppendingPathExtension:extension];
+        trying = [dirname stringByAppendingPathComponent:indexName];
+    }
+    return [NSURL fileURLWithPath:trying];
+}
+
+@end
diff --git a/Categories/NSMenu+RepresentedObjectAccessors.h b/Categories/NSMenu+RepresentedObjectAccessors.h
new file mode 100644 (file)
index 0000000..ecb28a6
--- /dev/null
@@ -0,0 +1,47 @@
+//
+//  NSMenu+RepresentedObjectAccessors.h
+//  Enjoyable
+//
+//  Created by Joe Wreschnig on 3/4/13.
+//
+//
+
+#import <Cocoa/Cocoa.h>
+
+@interface NSMenu (RepresentedObjectAccessors)
+    // Helpers for using represented objects in menu items.
+
+- (NSMenuItem *)itemWithRepresentedObject:(id)object;
+    // Returns the first menu item in the receiver that has a given
+    // represented object.
+
+- (void)removeItemWithRepresentedObject:(id)object;
+    // Removes the first menu item representing the given object in the
+    // receiver.
+    //
+    // After it removes the menu item, this method posts an
+    // NSMenuDidRemoveItemNotification.
+
+- (NSMenuItem *)lastItem;
+    // Return the last menu item in the receiver, or nil if the menu
+    // has no items.
+
+- (void)removeLastItem;
+    // Removes the last menu item in the receiver, if there is one.
+    //
+    // After and if it removes the menu item, this method posts an
+    // NSMenuDidRemoveItemNotification.
+
+@end
+
+@interface NSPopUpButton (RepresentedObjectAccessors)
+
+- (NSMenuItem *)itemWithRepresentedObject:(id)object;
+    // Returns the first item in the receiver's menu that has a given
+    // represented object.
+
+- (void)selectItemWithRepresentedObject:(id)object;
+    // Selects the first item in the receiver's menu that has a give
+    // represented object.
+
+@end
diff --git a/Categories/NSMenu+RepresentedObjectAccessors.m b/Categories/NSMenu+RepresentedObjectAccessors.m
new file mode 100644 (file)
index 0000000..a63f083
--- /dev/null
@@ -0,0 +1,48 @@
+//
+//  NSMenu+RepresentedObjectAccessors.m
+//  Enjoyable
+//
+//  Created by Joe Wreschnig on 3/4/13.
+//
+//
+
+#import "NSMenu+RepresentedObjectAccessors.h"
+
+@implementation NSMenu (RepresentedObjectAccessors)
+
+- (NSMenuItem *)itemWithRepresentedObject:(id)object {
+    for (NSMenuItem *item in self.itemArray)
+        if ([item.representedObject isEqual:object])
+            return item;
+    return nil;
+}
+
+- (void)removeItemWithRepresentedObject:(id)object {
+    NSInteger idx = [self indexOfItemWithRepresentedObject:object];
+    if (idx != -1)
+        [self removeItemAtIndex:idx];
+}
+
+- (NSMenuItem *)lastItem {
+    return self.itemArray.lastObject;
+}
+
+- (void)removeLastItem {
+    if (self.numberOfItems)
+        [self removeItemAtIndex:self.numberOfItems - 1];
+}
+
+@end
+
+@implementation NSPopUpButton (RepresentedObjectAccessors)
+
+- (NSMenuItem *)itemWithRepresentedObject:(id)object {
+    return [self.menu itemWithRepresentedObject:object];
+}
+
+- (void)selectItemWithRepresentedObject:(id)object {
+    [self selectItemAtIndex:[self indexOfItemWithRepresentedObject:object]];
+}
+
+
+@end
diff --git a/Categories/NSMutableArray+MoveObject.h b/Categories/NSMutableArray+MoveObject.h
new file mode 100644 (file)
index 0000000..c1c60d2
--- /dev/null
@@ -0,0 +1,15 @@
+//
+//  NSMutableArray+MoveObject.h
+//  Enjoyable
+//
+//  Created by Joe Wreschnig on 3/7/13.
+//
+//
+
+#import <Foundation/Foundation.h>
+
+@interface NSMutableArray (MoveObject)
+
+- (void)moveObjectAtIndex:(NSUInteger)src toIndex:(NSUInteger)dst;
+
+@end
diff --git a/Categories/NSMutableArray+MoveObject.m b/Categories/NSMutableArray+MoveObject.m
new file mode 100644 (file)
index 0000000..8d9a4ee
--- /dev/null
@@ -0,0 +1,19 @@
+//
+//  NSMutableArray+MoveObject.m
+//  Enjoyable
+//
+//  Created by Joe Wreschnig on 3/7/13.
+//
+//
+
+#import "NSMutableArray+MoveObject.h"
+
+@implementation NSMutableArray (MoveObject)
+
+- (void)moveObjectAtIndex:(NSUInteger)src toIndex:(NSUInteger)dst {
+    id obj = self[src];
+    [self removeObjectAtIndex:src];
+    [self insertObject:obj atIndex:dst > src ? dst - 1 : dst];
+}
+
+@end
diff --git a/Categories/NSString+FixFilename.h b/Categories/NSString+FixFilename.h
new file mode 100644 (file)
index 0000000..b3e318f
--- /dev/null
@@ -0,0 +1,28 @@
+//
+//  NSString+FixFilename.h
+//  Enjoyable
+//
+//  Created by Joe Wreschnig on 3/7/13.
+//
+//
+
+#import <Foundation/Foundation.h>
+
+@interface NSCharacterSet (FixFilename)
+
++ (NSCharacterSet *)invalidPathComponentCharacterSet;
+    // A character set containing the characters that are invalid to
+    // use in path components on common filesystems.
+
+@end
+
+@interface NSString (FixFilename)
+
+- (NSString *)stringByFixingPathComponent;
+    // Does various operations to make this string suitable for use as
+    // a single path component of a normal filename. Removes
+    // characters that are invalid. Strips whitespace from the
+    // beginning and end. If the first character is a . or a -, a _ is
+    // added to the front.
+
+@end
diff --git a/Categories/NSString+FixFilename.m b/Categories/NSString+FixFilename.m
new file mode 100644 (file)
index 0000000..06a837c
--- /dev/null
@@ -0,0 +1,35 @@
+//
+//  NSString+FixFilename.m
+//  Enjoyable
+//
+//  Created by Joe Wreschnig on 3/7/13.
+//
+//
+
+#import "NSString+FixFilename.h"
+
+@implementation NSCharacterSet (FixFilename)
+
++ (NSCharacterSet *)invalidPathComponentCharacterSet {
+    return [NSCharacterSet characterSetWithCharactersInString:@"\"\\/:*?<>|"];
+}
+
+@end
+
+@implementation NSString (FixFilename)
+
+- (NSString *)stringByFixingPathComponent {
+    NSCharacterSet *invalid = NSCharacterSet.invalidPathComponentCharacterSet;
+    NSCharacterSet *whitespace = NSCharacterSet.whitespaceAndNewlineCharacterSet;
+    NSArray *parts = [self componentsSeparatedByCharactersInSet:invalid];
+    NSString *name = [parts componentsJoinedByString:@"_"];
+    name = [name stringByTrimmingCharactersInSet:whitespace];
+    if (!name.length)
+        return @"_";
+    unichar first = [name characterAtIndex:0];
+    if (first == '.' || first == '-')
+        name = [@"_" stringByAppendingString:name];
+    return name;
+}
+
+@end
diff --git a/Categories/NSView+FirstResponder.h b/Categories/NSView+FirstResponder.h
new file mode 100644 (file)
index 0000000..cd89aa5
--- /dev/null
@@ -0,0 +1,11 @@
+#import <Cocoa/Cocoa.h>
+
+@interface NSView (FirstResponder)
+
+- (BOOL)resignIfFirstResponder;
+    // Resign first responder status if this view is the active first
+    // responder in its window. Returns whether first responder status
+    // was resigned; YES if it was and NO if refused or the view was
+    // not the first responder.
+
+@end
diff --git a/Categories/NSView+FirstResponder.m b/Categories/NSView+FirstResponder.m
new file mode 100644 (file)
index 0000000..0575b0d
--- /dev/null
@@ -0,0 +1,12 @@
+#import "NSView+FirstResponder.h"
+
+@implementation NSView (FirstResponder)
+
+- (BOOL)resignIfFirstResponder {
+    NSWindow *window = self.window;
+    return window.firstResponder == self
+        ? [window makeFirstResponder:nil]
+        : NO;
+}
+
+@end
diff --git a/Classes/EnjoyableApplicationDelegate.h b/Classes/EnjoyableApplicationDelegate.h
new file mode 100644 (file)
index 0000000..b795a92
--- /dev/null
@@ -0,0 +1,23 @@
+//
+//  EnjoyableApplicationDelegate.h
+//  Enjoy
+//
+//  Created by Sam McCall on 4/05/09.
+//  Copyright 2009 University of Otago. All rights reserved.
+//
+
+@class NJDeviceController;
+@class NJOutputController;
+@class NJMappingsController;
+
+@interface EnjoyableApplicationDelegate : NSObject <NSApplicationDelegate,
+                                                    NSSplitViewDelegate>
+{
+    IBOutlet NSMenu *dockMenuBase;
+    IBOutlet NSWindow *window;
+}
+
+@property (nonatomic, strong) IBOutlet NJDeviceController *inputController;
+@property (nonatomic, strong) IBOutlet NJMappingsController *mappingsController;
+
+@end
diff --git a/Classes/EnjoyableApplicationDelegate.m b/Classes/EnjoyableApplicationDelegate.m
new file mode 100644 (file)
index 0000000..c477511
--- /dev/null
@@ -0,0 +1,155 @@
+//
+//  EnjoyableApplicationDelegate.m
+//  Enjoy
+//
+//  Created by Sam McCall on 4/05/09.
+//
+
+#import "EnjoyableApplicationDelegate.h"
+
+#import "NJMapping.h"
+#import "NJMappingsController.h"
+#import "NJDeviceController.h"
+#import "NJOutputController.h"
+#import "NJEvents.h"
+
+@implementation EnjoyableApplicationDelegate
+
+- (void)didSwitchApplication:(NSNotification *)note {
+    NSRunningApplication *activeApp = note.userInfo[NSWorkspaceApplicationKey];
+    NSString *name = activeApp.localizedName;
+    if (!name)
+        name = activeApp.bundleIdentifier;
+    if (name && ![name isEqualToString:NSRunningApplication.currentApplication.localizedName])
+        [self.mappingsController activateMappingForProcess:name];
+}
+
+- (void)applicationDidFinishLaunching:(NSNotification *)notification {
+    [NSNotificationCenter.defaultCenter
+        addObserver:self
+        selector:@selector(mappingDidChange:)
+        name:NJEventMappingChanged
+        object:nil];
+    [NSNotificationCenter.defaultCenter
+        addObserver:self
+        selector:@selector(mappingListDidChange:)
+        name:NJEventMappingListChanged
+        object:nil];
+    [NSNotificationCenter.defaultCenter
+        addObserver:self
+        selector:@selector(eventTranslationActivated:)
+        name:NJEventTranslationActivated
+        object:nil];
+    [NSNotificationCenter.defaultCenter
+        addObserver:self
+        selector:@selector(eventTranslationDeactivated:)
+        name:NJEventTranslationDeactivated
+        object:nil];
+
+    [self.inputController setup];
+    [self.mappingsController load];
+}
+
+- (void)applicationDidBecomeActive:(NSNotification *)notification {
+    [window makeKeyAndOrderFront:nil];
+}
+
+- (BOOL)applicationShouldHandleReopen:(NSApplication *)theApplication
+                    hasVisibleWindows:(BOOL)flag {
+    [window makeKeyAndOrderFront:nil];
+    return NO;
+}
+
+- (void)eventTranslationActivated:(NSNotification *)note {
+    [NSProcessInfo.processInfo disableAutomaticTermination:@"Input translation is active."];
+    [NSWorkspace.sharedWorkspace.notificationCenter
+        addObserver:self
+        selector:@selector(didSwitchApplication:)
+        name:NSWorkspaceDidActivateApplicationNotification
+        object:nil];
+    NSLog(@"Listening for application changes.");
+}
+
+- (void)eventTranslationDeactivated:(NSNotification *)note {
+    [NSProcessInfo.processInfo enableAutomaticTermination:@"Input translation is active."];
+    [NSWorkspace.sharedWorkspace.notificationCenter
+        removeObserver:self
+        name:NSWorkspaceDidActivateApplicationNotification
+        object:nil];
+    NSLog(@"Ignoring application changes.");
+}
+
+- (void)mappingListDidChange:(NSNotification *)note {
+    NSArray *mappings = note.object;
+    while (dockMenuBase.lastItem.representedObject)
+        [dockMenuBase removeLastItem];
+    int added = 0;
+    for (NJMapping *mapping in mappings) {
+        NSString *keyEquiv = ++added < 10 ? @(added).stringValue : @"";
+        NSMenuItem *item = [[NSMenuItem alloc] initWithTitle:mapping.name
+                                                      action:@selector(chooseMapping:)
+                                               keyEquivalent:keyEquiv];
+        item.representedObject = mapping;
+        item.state = mapping == self.mappingsController.currentMapping;
+        [dockMenuBase addItem:item];
+    }
+}
+
+- (void)mappingDidChange:(NSNotification *)note {
+    NJMapping *current = note.object;
+    for (NSMenuItem *item in dockMenuBase.itemArray)
+        if (item.representedObject)
+            item.state = item.representedObject == current;
+}
+
+- (void)chooseMapping:(NSMenuItem *)sender {
+    NJMapping *chosen = sender.representedObject;
+    [self.mappingsController activateMapping:chosen];
+}
+
+#define OUTPUT_PANE_MIN_WIDTH 390
+
+- (CGFloat)splitView:(NSSplitView *)sender constrainMaxCoordinate:(CGFloat)proposedMax ofSubviewAt:(NSInteger)offset {
+    return proposedMax - OUTPUT_PANE_MIN_WIDTH;
+}
+
+- (void)splitView:(NSSplitView *)splitView resizeSubviewsWithOldSize:(NSSize)oldSize {
+    NSView *inputView = splitView.subviews[0];
+    NSView *outputView = splitView.subviews[1];
+    if (outputView.frame.size.width < OUTPUT_PANE_MIN_WIDTH) {
+        NSSize frameSize = splitView.frame.size;
+        CGFloat inputWidth = frameSize.width - OUTPUT_PANE_MIN_WIDTH - splitView.dividerThickness;
+        inputView.frame = NSMakeRect(inputWidth, frameSize.height,
+                                    inputView.frame.size.width,
+                                    inputView.frame.size.height);
+        outputView.frame = NSMakeRect(inputWidth + splitView.dividerThickness,
+                                     0,
+                                     OUTPUT_PANE_MIN_WIDTH,
+                                     frameSize.height);
+    } else
+        [splitView adjustSubviews];
+}
+
+- (NSMenu *)applicationDockMenu:(NSApplication *)sender {
+    NSMenu *menu = [[NSMenu alloc] init];
+    int added = 0;
+    for (NJMapping *mapping in self.mappingsController) {
+        NSString *keyEquiv = ++added < 10 ? @(added).stringValue : @"";
+        NSMenuItem *item = [[NSMenuItem alloc] initWithTitle:mapping.name
+                                                      action:@selector(chooseMapping:)
+                                               keyEquivalent:keyEquiv];
+        item.representedObject = mapping;
+        item.state = mapping == self.mappingsController.currentMapping;
+        [menu addItem:item];
+    }
+    return menu;
+}
+
+- (BOOL)application:(NSApplication *)sender openFile:(NSString *)filename {
+    NSURL *url = [NSURL fileURLWithPath:filename];
+    [self.mappingsController addMappingWithContentsOfURL:url];
+    return YES;
+}
+
+
+@end
diff --git a/Classes/NJDevice.h b/Classes/NJDevice.h
new file mode 100644 (file)
index 0000000..ec607ac
--- /dev/null
@@ -0,0 +1,26 @@
+//
+//  NJDevice.h
+//  Enjoy
+//
+//  Created by Sam McCall on 4/05/09.
+//  Copyright 2009 University of Otago. All rights reserved.
+//
+
+#import "NJInputPathElement.h"
+
+@class NJInput;
+
+@interface NJDevice : NSObject <NJInputPathElement>
+
+@property (nonatomic, assign) int index;
+@property (nonatomic, copy) NSString *productName;
+@property (nonatomic, assign) IOHIDDeviceRef device;
+@property (nonatomic, copy) NSArray *children;
+@property (nonatomic, readonly) NSString *name;
+@property (readonly) NSString *uid;
+
+- (id)initWithDevice:(IOHIDDeviceRef)device;
+- (NJInput *)handlerForEvent:(IOHIDValueRef)value;
+- (NJInput *)inputForEvent:(IOHIDValueRef)value;
+
+@end
diff --git a/Classes/NJDevice.m b/Classes/NJDevice.m
new file mode 100644 (file)
index 0000000..69775d8
--- /dev/null
@@ -0,0 +1,109 @@
+//
+//  NJDevice.m
+//  Enjoy
+//
+//  Created by Sam McCall on 4/05/09.
+//
+
+#import "NJDevice.h"
+
+#import "NJInput.h"
+#import "NJInputAnalog.h"
+#import "NJInputHat.h"
+#import "NJInputButton.h"
+
+static NSArray *InputsForElement(IOHIDDeviceRef device, id base) {
+    CFArrayRef elements = IOHIDDeviceCopyMatchingElements(device, NULL, kIOHIDOptionsTypeNone);
+    NSMutableArray *children = [NSMutableArray arrayWithCapacity:CFArrayGetCount(elements)];
+    
+    int buttons = 0;
+    int axes = 0;
+    int hats = 0;
+    
+    for (int i = 0; i < CFArrayGetCount(elements); i++) {
+        IOHIDElementRef element = (IOHIDElementRef)CFArrayGetValueAtIndex(elements, i);
+        int type = IOHIDElementGetType(element);
+        unsigned usage = IOHIDElementGetUsage(element);
+        unsigned usagePage = IOHIDElementGetUsagePage(element);
+        long max = IOHIDElementGetPhysicalMax(element);
+        long min = IOHIDElementGetPhysicalMin(element);
+        CFStringRef elName = IOHIDElementGetName(element);
+        
+        NJInput *input = nil;
+        
+        if (!(type == kIOHIDElementTypeInput_Misc
+              || type == kIOHIDElementTypeInput_Axis
+              || type == kIOHIDElementTypeInput_Button))
+             continue;
+        
+        if (max - min == 1 || usagePage == kHIDPage_Button || type == kIOHIDElementTypeInput_Button) {
+            input = [[NJInputButton alloc] initWithName:(__bridge NSString *)elName
+                                                    idx:++buttons
+                                                    max:max];
+        } else if (usage == kHIDUsage_GD_Hatswitch) {
+            input = [[NJInputHat alloc] initWithIndex:++hats];
+        } else if (usage >= kHIDUsage_GD_X && usage <= kHIDUsage_GD_Rz) {
+            input = [[NJInputAnalog alloc] initWithIndex:++axes
+                                                  rawMin:min
+                                                  rawMax:max];
+        } else {
+            continue;
+        }
+        
+        // TODO(jfw): Should be moved into better constructors.
+        input.base = base;
+        input.cookie = IOHIDElementGetCookie(element);
+        [children addObject:input];
+    }
+
+    CFRelease(elements);
+    return children;
+}
+
+@implementation NJDevice {
+    int vendorId;
+    int productId;
+}
+
+- (id)initWithDevice:(IOHIDDeviceRef)dev {
+    if ((self = [super init])) {
+        self.device = dev;
+        self.productName = (__bridge NSString *)IOHIDDeviceGetProperty(dev, CFSTR(kIOHIDProductKey));
+        vendorId = [(__bridge NSNumber *)IOHIDDeviceGetProperty(dev, CFSTR(kIOHIDVendorIDKey)) intValue];
+        productId = [(__bridge NSNumber *)IOHIDDeviceGetProperty(dev, CFSTR(kIOHIDProductIDKey)) intValue];
+        self.children = InputsForElement(dev, self);
+    }
+    return self;
+}
+
+- (NSString *)name {
+    return [NSString stringWithFormat:@"%@ #%d", _productName, _index];
+}
+
+- (id)base {
+    return nil;
+}
+
+- (NSString *)uid {
+    return [NSString stringWithFormat: @"%d:%d:%d", vendorId, productId, _index];
+}
+
+- (NJInput *)findInputByCookie:(IOHIDElementCookie)cookie {
+    for (NJInput *child in _children)
+        if (child.cookie == cookie)
+            return child;
+    return nil;
+}
+
+- (NJInput *)handlerForEvent:(IOHIDValueRef)value {
+    NJInput *mainInput = [self inputForEvent:value];
+    return [mainInput findSubInputForValue:value];
+}
+
+- (NJInput *)inputForEvent:(IOHIDValueRef)value {
+    IOHIDElementRef elt = IOHIDValueGetElement(value);
+    IOHIDElementCookie cookie = IOHIDElementGetCookie(elt);
+    return [self findInputByCookie:cookie];
+}
+
+@end
diff --git a/Classes/NJDeviceController.h b/Classes/NJDeviceController.h
new file mode 100644 (file)
index 0000000..7658c64
--- /dev/null
@@ -0,0 +1,31 @@
+//
+//  NJDeviceController.h
+//  Enjoy
+//
+//  Created by Sam McCall on 4/05/09.
+//  Copyright 2009 University of Otago. All rights reserved.
+//
+
+@class NJDevice;
+@class NJInput;
+@class NJMappingsController;
+@class NJOutputController;
+
+@interface NJDeviceController : NSObject <NSOutlineViewDataSource, NSOutlineViewDelegate> {
+    IBOutlet NSOutlineView *outlineView;
+    IBOutlet NJOutputController *outputController;
+    IBOutlet NJMappingsController *mappingsController;
+    IBOutlet NSButton *translatingEventsButton;
+    IBOutlet NSMenuItem *translatingEventsMenu;
+}
+
+@property (nonatomic, readonly) NJInput *selectedInput;
+@property (nonatomic, assign) NSPoint mouseLoc;
+@property (nonatomic, assign) BOOL translatingEvents;
+
+- (void)setup;
+- (NJDevice *)findDeviceByRef:(IOHIDDeviceRef)device;
+
+- (IBAction)translatingEventsChanged:(id)sender;
+
+@end
diff --git a/Classes/NJDeviceController.m b/Classes/NJDeviceController.m
new file mode 100644 (file)
index 0000000..d553d7d
--- /dev/null
@@ -0,0 +1,243 @@
+//
+//  NJDeviceController.m
+//  Enjoy
+//
+//  Created by Sam McCall on 4/05/09.
+//
+
+#import "NJDeviceController.h"
+
+#import "NJMapping.h"
+#import "NJMappingsController.h"
+#import "NJDevice.h"
+#import "NJInput.h"
+#import "NJOutput.h"
+#import "NJOutputController.h"
+#import "NJEvents.h"
+
+@implementation NJDeviceController {
+    IOHIDManagerRef hidManager;
+    NSTimer *continuousTimer;
+    NSMutableArray *runningOutputs;
+    NSMutableArray *_devices;
+}
+
+- (id)init {
+    if ((self = [super init])) {
+        _devices = [[NSMutableArray alloc] initWithCapacity:16];
+        runningOutputs = [[NSMutableArray alloc] initWithCapacity:32];
+    }
+    return self;
+}
+
+- (void)dealloc {
+    [continuousTimer invalidate];
+    IOHIDManagerClose(hidManager, kIOHIDOptionsTypeNone);
+    CFRelease(hidManager);
+}
+
+- (void)expandRecursive:(id <NJInputPathElement>)pathElement {
+    if (pathElement) {
+        [self expandRecursive:pathElement.base];
+        [outlineView expandItem:pathElement];
+    }
+}
+
+- (void)addRunningOutput:(NJOutput *)output {
+    if (![runningOutputs containsObject:output]) {
+        [runningOutputs addObject:output];
+    }
+    if (!continuousTimer) {
+        continuousTimer = [NSTimer scheduledTimerWithTimeInterval:1.f/60.f
+                                                           target:self
+                                                         selector:@selector(updateContinuousInputs:)
+                                                         userInfo:nil
+                                                          repeats:YES];
+        NSLog(@"Scheduled continuous output timer.");
+    }
+}
+
+- (void)runOutputForDevice:(IOHIDDeviceRef)device value:(IOHIDValueRef)value {
+    NJDevice *dev = [self findDeviceByRef:device];
+    NJInput *mainInput = [dev inputForEvent:value];
+    [mainInput notifyEvent:value];
+    NSArray *children = mainInput.children ? mainInput.children : mainInput ? @[mainInput] : @[];
+    for (NJInput *subInput in children) {
+        NJOutput *output = mappingsController.currentMapping[subInput];
+        output.magnitude = subInput.magnitude;
+        output.running = subInput.active;
+        if ((output.running || output.magnitude) && output.isContinuous)
+            [self addRunningOutput:output];
+    }
+}
+
+- (void)showOutputForDevice:(IOHIDDeviceRef)device value:(IOHIDValueRef)value {
+    NJDevice *dev = [self findDeviceByRef:device];
+    NJInput *handler = [dev handlerForEvent:value];
+    if (!handler)
+        return;
+    
+    [self expandRecursive:handler];
+    [outlineView selectRowIndexes:[NSIndexSet indexSetWithIndex:[outlineView rowForItem:handler]] byExtendingSelection: NO];
+    [outputController focusKey];
+}
+
+static void input_callback(void *ctx, IOReturn inResult, void *inSender, IOHIDValueRef value) {
+    NJDeviceController *controller = (__bridge NJDeviceController *)ctx;
+    IOHIDDeviceRef device = IOHIDQueueGetDevice(inSender);
+    
+    if (controller.translatingEvents) {
+        [controller runOutputForDevice:device value:value];
+    } else if ([NSApplication sharedApplication].mainWindow.isVisible) {
+        [controller showOutputForDevice:device value:value];
+    }
+}
+
+static int findAvailableIndex(NSArray *list, NJDevice *dev) {
+    for (int index = 1; ; index++) {
+        BOOL available = YES;
+        for (NJDevice *used in list) {
+            if ([used.productName isEqualToString:dev.productName] && used.index == index) {
+                available = NO;
+                break;
+            }
+        }
+        if (available)
+            return index;
+    }
+}
+
+- (void)addDeviceForDevice:(IOHIDDeviceRef)device {
+    IOHIDDeviceRegisterInputValueCallback(device, input_callback, (__bridge void*)self);
+    NJDevice *dev = [[NJDevice alloc] initWithDevice:device];
+    dev.index = findAvailableIndex(_devices, dev);
+    [_devices addObject:dev];
+    [outlineView reloadData];
+}
+
+static void add_callback(void *ctx, IOReturn inResult, void *inSender, IOHIDDeviceRef device) {
+    NJDeviceController *controller = (__bridge NJDeviceController *)ctx;
+    [controller addDeviceForDevice:device];
+}
+
+- (NJDevice *)findDeviceByRef:(IOHIDDeviceRef)device {
+    for (NJDevice *dev in _devices)
+        if (dev.device == device)
+            return dev;
+    return nil;
+}
+
+static void remove_callback(void *ctx, IOReturn inResult, void *inSender, IOHIDDeviceRef device) {
+    NJDeviceController *controller = (__bridge NJDeviceController *)ctx;
+    [controller removeDeviceForDevice:device];
+}
+
+- (void)removeDeviceForDevice:(IOHIDDeviceRef)device {
+    NJDevice *match = [self findDeviceByRef:device];
+    IOHIDDeviceRegisterInputValueCallback(device, NULL, NULL);
+    if (match) {
+        [_devices removeObject:match];
+        [outlineView reloadData];
+    }
+    
+}
+
+- (void)updateContinuousInputs:(NSTimer *)timer {
+    self.mouseLoc = [NSEvent mouseLocation];
+    for (NJOutput *output in [runningOutputs copy]) {
+        if (![output update:self]) {
+            [runningOutputs removeObject:output];
+        }
+    }
+    if (!runningOutputs.count) {
+        [continuousTimer invalidate];
+        continuousTimer = nil;
+        NSLog(@"Unscheduled continuous output timer.");
+    }
+}
+
+#define NSSTR(e) ((NSString *)CFSTR(e))
+
+- (void)setup {
+    hidManager = IOHIDManagerCreate(kCFAllocatorDefault, kIOHIDOptionsTypeNone);
+    NSArray *criteria = @[ @{ NSSTR(kIOHIDDeviceUsagePageKey) : @(kHIDPage_GenericDesktop),
+                              NSSTR(kIOHIDDeviceUsageKey) : @(kHIDUsage_GD_Joystick) },
+                           @{ NSSTR(kIOHIDDeviceUsagePageKey) : @(kHIDPage_GenericDesktop),
+                              NSSTR(kIOHIDDeviceUsageKey) : @(kHIDUsage_GD_GamePad) },
+                           @{ NSSTR(kIOHIDDeviceUsagePageKey) : @(kHIDPage_GenericDesktop),
+                              NSSTR(kIOHIDDeviceUsageKey) : @(kHIDUsage_GD_MultiAxisController) }
+                           ];
+    IOHIDManagerSetDeviceMatchingMultiple(hidManager, (__bridge CFArrayRef)criteria);
+    
+    IOHIDManagerScheduleWithRunLoop(hidManager, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode);
+    IOReturn ret = IOHIDManagerOpen(hidManager, kIOHIDOptionsTypeNone);
+    if (ret != kIOReturnSuccess) {
+        [[NSAlert alertWithMessageText:@"Input devices are unavailable"
+                         defaultButton:nil
+                       alternateButton:nil
+                           otherButton:nil
+             informativeTextWithFormat:@"Error 0x%08x occured trying to access your devices. "
+                                       @"Input may not be correctly detected or mapped.",
+                                       ret]
+         beginSheetModalForWindow:outlineView.window
+                    modalDelegate:nil
+                   didEndSelector:nil
+                      contextInfo:nil];
+    }
+    
+    IOHIDManagerRegisterDeviceMatchingCallback(hidManager, add_callback, (__bridge void *)self);
+    IOHIDManagerRegisterDeviceRemovalCallback(hidManager, remove_callback, (__bridge void *)self);
+}
+
+- (NJInput *)selectedInput {
+    id <NJInputPathElement> item = [outlineView itemAtRow:outlineView.selectedRow];
+    return (!item.children && item.base) ? item : nil;
+}
+
+- (NSInteger)outlineView:(NSOutlineView *)outlineView
+  numberOfChildrenOfItem:(id <NJInputPathElement>)item {
+    return item ? item.children.count : _devices.count;
+}
+
+- (BOOL)outlineView:(NSOutlineView *)outlineView
+   isItemExpandable:(id <NJInputPathElement>)item {
+    return item ? [[item children] count] > 0: YES;
+}
+
+- (id)outlineView:(NSOutlineView *)outlineView
+            child:(NSInteger)index
+           ofItem:(id <NJInputPathElement>)item {
+    return item ? item.children[index] : _devices[index];
+}
+
+- (id)outlineView:(NSOutlineView *)outlineView
+objectValueForTableColumn:(NSTableColumn *)tableColumn
+           byItem:(id <NJInputPathElement>)item  {
+    return item ? item.name : @"root";
+}
+
+- (void)outlineViewSelectionDidChange:(NSNotification *)notification {
+    
+    [outputController loadCurrent];
+}
+
+- (void)setTranslatingEvents:(BOOL)translatingEvents {
+    if (translatingEvents != _translatingEvents) {
+        _translatingEvents = translatingEvents;
+        NSInteger state = translatingEvents ? NSOnState : NSOffState;
+        translatingEventsButton.state = state;
+        translatingEventsMenu.title = translatingEvents ? @"Disable" : @"Enable";
+        NSString *name = translatingEvents
+            ? NJEventTranslationActivated
+            : NJEventTranslationDeactivated;
+        [NSNotificationCenter.defaultCenter postNotificationName:name
+                                                          object:self];
+    }
+}
+
+- (IBAction)translatingEventsChanged:(NSButton *)sender {
+    self.translatingEvents = sender.state == NSOnState;
+}
+
+
+@end
diff --git a/Classes/NJInput.h b/Classes/NJInput.h
new file mode 100644 (file)
index 0000000..380e858
--- /dev/null
@@ -0,0 +1,26 @@
+//
+//  NJInput.h
+//  Enjoy
+//
+//  Created by Sam McCall on 4/05/09.
+//  Copyright 2009 University of Otago. All rights reserved.
+//
+
+#import "NJInputPathElement.h"
+
+@interface NJInput : NSObject <NJInputPathElement>
+
+@property (nonatomic, assign) IOHIDElementCookie cookie;
+@property (nonatomic, copy) NSArray *children;
+@property (nonatomic, weak) id base;
+@property (nonatomic, copy) NSString *name;
+@property (nonatomic, assign) BOOL active;
+@property (nonatomic, assign) float magnitude;
+@property (readonly) NSString *uid;
+
+- (id)initWithName:(NSString *)newName base:(id <NJInputPathElement>)newBase;
+
+- (void)notifyEvent:(IOHIDValueRef)value;
+- (id)findSubInputForValue:(IOHIDValueRef)value;
+
+@end
diff --git a/Classes/NJInput.m b/Classes/NJInput.m
new file mode 100644 (file)
index 0000000..077dac8
--- /dev/null
@@ -0,0 +1,32 @@
+//
+//  NJInput.m
+//  Enjoy
+//
+//  Created by Sam McCall on 4/05/09.
+//
+
+#import "NJInput.h"
+
+@implementation NJInput
+
+- (id)initWithName:(NSString *)newName base:(id <NJInputPathElement>)newBase {
+    if ((self = [super init])) {
+        self.name = newName;
+        self.base = newBase;
+    }
+    return self;
+}
+
+- (id)findSubInputForValue:(IOHIDValueRef)value {
+    return NULL;
+}
+
+- (NSString *)uid {
+    return [NSString stringWithFormat:@"%@~%@", [_base uid], _name];
+}
+
+- (void)notifyEvent:(IOHIDValueRef)value {
+    [self doesNotRecognizeSelector:_cmd];
+}
+
+@end
diff --git a/Classes/NJInputAnalog.h b/Classes/NJInputAnalog.h
new file mode 100644 (file)
index 0000000..e79ed89
--- /dev/null
@@ -0,0 +1,17 @@
+//
+//  NJInputAnalog.h
+//  Enjoy
+//
+//  Created by Sam McCall on 5/05/09.
+//  Copyright 2009 University of Otago. All rights reserved.
+//
+
+#import <Cocoa/Cocoa.h>
+
+#import "NJInput.h"
+
+@interface NJInputAnalog : NJInput
+
+- (id)initWithIndex:(int)index rawMin:(long)rawMin rawMax:(long)rawMax;
+
+@end
diff --git a/Classes/NJInputAnalog.m b/Classes/NJInputAnalog.m
new file mode 100644 (file)
index 0000000..7b4b15a
--- /dev/null
@@ -0,0 +1,55 @@
+//
+//  NJInputAnalog.m
+//  Enjoy
+//
+//  Created by Sam McCall on 5/05/09.
+//
+
+#define DEAD_ZONE 0.3
+
+#import "NJInputAnalog.h"
+
+static float normalize(long p, long min, long max) {
+    return 2 * (p - min) / (float)(max - min) - 1;
+}
+
+@implementation NJInputAnalog {
+    float magnitude;
+    long rawMin;
+    long rawMax;
+}
+
+- (id)initWithIndex:(int)index rawMin:(long)rawMin_ rawMax:(long)rawMax_ {
+    if ((self = [super init])) {
+        self.name = [[NSString alloc] initWithFormat: @"Axis %d", index];
+        self.children = @[[[NJInput alloc] initWithName:@"Low" base:self],
+                          [[NJInput alloc] initWithName:@"High" base:self]];
+        rawMax = rawMax_;
+        rawMin = rawMin_;
+    }
+    return self;
+}
+
+- (id)findSubInputForValue:(IOHIDValueRef)value {
+    float mag = normalize(IOHIDValueGetIntegerValue(value), rawMin, rawMax);
+    if (mag < -DEAD_ZONE)
+        return self.children[0];
+    else if (mag > DEAD_ZONE)
+        return self.children[1];
+    else
+        return nil;
+}
+
+- (void)notifyEvent:(IOHIDValueRef)value {
+    magnitude = normalize(IOHIDValueGetIntegerValue(value), rawMin, rawMax);
+    [self.children[0] setMagnitude:fabsf(MIN(magnitude, 0))];
+    [self.children[1] setMagnitude:fabsf(MAX(magnitude, 0))];
+    [self.children[0] setActive:magnitude < -DEAD_ZONE];
+    [self.children[1] setActive:magnitude > DEAD_ZONE];
+}
+
+- (float)magnitude {
+    return magnitude;
+}
+
+@end
diff --git a/Classes/NJInputButton.h b/Classes/NJInputButton.h
new file mode 100644 (file)
index 0000000..31cba73
--- /dev/null
@@ -0,0 +1,15 @@
+//
+//  NJInputButton.h
+//  Enjoy
+//
+//  Created by Sam McCall on 5/05/09.
+//  Copyright 2009 University of Otago. All rights reserved.
+//
+
+#import "NJInput.h"
+
+@interface NJInputButton : NJInput
+
+- (id)initWithName:(NSString *)name idx:(int)idx max:(long)max;
+
+@end
diff --git a/Classes/NJInputButton.m b/Classes/NJInputButton.m
new file mode 100644 (file)
index 0000000..0c3b0ce
--- /dev/null
@@ -0,0 +1,34 @@
+//
+//  NJInputButton.m
+//  Enjoy
+//
+//  Created by Sam McCall on 5/05/09.
+//
+
+#import "NJInputButton.h"
+
+@implementation NJInputButton {
+    long _max;
+}
+
+- (id)initWithName:(NSString *)name idx:(int)idx max:(long)max {
+    if ((self = [super init])) {
+        _max = max;
+        if (name.length)
+            self.name = [NSString stringWithFormat:@"Button %d - %@", idx, name];
+        else
+            self.name = [NSString stringWithFormat:@"Button %d", idx];
+    }
+    return self;
+}
+
+- (id)findSubInputForValue:(IOHIDValueRef)val {
+    return (IOHIDValueGetIntegerValue(val) == _max) ? self : nil;
+}
+
+- (void)notifyEvent:(IOHIDValueRef)value {
+    self.active = IOHIDValueGetIntegerValue(value) == _max;
+    self.magnitude = IOHIDValueGetIntegerValue(value) / (float)_max;
+}
+
+@end
diff --git a/Classes/NJInputHat.h b/Classes/NJInputHat.h
new file mode 100644 (file)
index 0000000..5290d71
--- /dev/null
@@ -0,0 +1,15 @@
+//
+//  NJInputHat.h
+//  Enjoy
+//
+//  Created by Sam McCall on 5/05/09.
+//  Copyright 2009 University of Otago. All rights reserved.
+//
+
+#import "NJInput.h"
+
+@interface NJInputHat : NJInput
+
+- (id)initWithIndex:(int)index;
+
+@end
diff --git a/Classes/NJInputHat.m b/Classes/NJInputHat.m
new file mode 100644 (file)
index 0000000..e0e127f
--- /dev/null
@@ -0,0 +1,99 @@
+//
+//  NJInputHat.m
+//  Enjoy
+//
+//  Created by Sam McCall on 5/05/09.
+//
+
+#import "NJInputHat.h"
+
+static BOOL active_eightway[36] = {
+    NO,  NO,  NO,  NO , // center
+    YES, NO,  NO,  NO , // N
+    YES, NO,  NO,  YES, // NE
+    NO,  NO,  NO,  YES, // E
+    NO,  YES, NO,  YES, // SE
+    NO,  YES, NO,  NO , // S
+    NO,  YES, YES, NO , // SW
+    NO,  NO,  YES, NO , // W
+    YES, NO,  YES, NO , // NW
+};
+
+static BOOL active_fourway[20] = {
+    NO,  NO,  NO,  NO , // center
+    YES, NO,  NO,  NO , // N
+    NO,  NO,  NO,  YES, // E
+    NO,  YES, NO,  NO , // S
+    NO,  NO,  YES, NO , // W
+};
+
+@implementation NJInputHat
+
+- (id)initWithIndex:(int)index {
+    if ((self = [super init])) {
+        self.children = @[[[NJInput alloc] initWithName:@"Up" base:self],
+                          [[NJInput alloc] initWithName:@"Down" base:self],
+                          [[NJInput alloc] initWithName:@"Left" base:self],
+                          [[NJInput alloc] initWithName:@"Right" base:self]];
+        self.name = [NSString stringWithFormat:@"Hat Switch %d", index];
+    }
+    return self;
+}
+
+- (id)findSubInputForValue:(IOHIDValueRef)value {
+    long parsed = IOHIDValueGetIntegerValue(value);
+    switch (IOHIDElementGetLogicalMax(IOHIDValueGetElement(value))) {
+        case 7: // 8-way switch, 0-7.
+            switch (parsed) {
+                case 0: return self.children[0];
+                case 4: return self.children[1];
+                case 6: return self.children[2];
+                case 2: return self.children[3];
+                default: return nil;
+            }
+        case 8: // 8-way switch, 1-8 (neutral 0).
+            switch (parsed) {
+                case 1: return self.children[0];
+                case 5: return self.children[1];
+                case 7: return self.children[2];
+                case 3: return self.children[3];
+                default: return nil;
+            }
+        case 3: // 4-way switch, 0-3.
+            switch (parsed) {
+                case 0: return self.children[0];
+                case 2: return self.children[1];
+                case 3: return self.children[2];
+                case 1: return self.children[3];
+                default: return nil;
+            }
+        case 4: // 4-way switch, 1-4 (neutral 0).
+            switch (parsed) {
+                case 1: return self.children[0];
+                case 3: return self.children[1];
+                case 4: return self.children[2];
+                case 2: return self.children[3];
+                default: return nil;
+            }
+        default:
+            return nil;
+    }
+}
+
+- (void)notifyEvent:(IOHIDValueRef)value {
+    long parsed = IOHIDValueGetIntegerValue(value);
+    long size = IOHIDElementGetLogicalMax(IOHIDValueGetElement(value));
+    // Skip first row in table if 0 is not neutral.
+    if (size & 1) {
+        parsed++;
+        size++;
+    }
+    BOOL *activechildren = (size == 8) ? active_eightway : active_fourway;
+    for (unsigned i = 0; i < 4; i++) {
+        BOOL active = activechildren[parsed * 4 + i];
+        [self.children[i] setActive:active];
+        [self.children[i] setMagnitude:active];
+    }
+}
+
+@end
diff --git a/Classes/NJInputPathElement.h b/Classes/NJInputPathElement.h
new file mode 100644 (file)
index 0000000..8fe5c65
--- /dev/null
@@ -0,0 +1,9 @@
+#import <Foundation/Foundation.h>
+
+@protocol NJInputPathElement <NSObject>
+
+- (NSArray *)children;
+- (id <NJInputPathElement>) base;
+- (NSString *)name;
+
+@end
diff --git a/Classes/NJKeyInputField.h b/Classes/NJKeyInputField.h
new file mode 100644 (file)
index 0000000..ad026d3
--- /dev/null
@@ -0,0 +1,45 @@
+//
+//  NJKeyInputField.h
+//  Enjoyable
+//
+//  Copyright 2013 Joe Wreschnig.
+//
+
+#import <Cocoa/Cocoa.h>
+
+extern CGKeyCode NJKeyInputFieldEmpty;
+
+@protocol NJKeyInputFieldDelegate;
+
+@interface NJKeyInputField : NSTextField
+    // An NJKeyInputField is a NSTextField-like widget that receives
+    // exactly one key press, and displays the name of that key, then
+    // resigns its first responder status. It can also inform a
+    // special delegate when its content changes.
+
++ (NSString *)stringForKeyCode:(CGKeyCode)keyCode;
+    // Give the string name for a virtual key code.
+
+@property (nonatomic, weak) IBOutlet id <NJKeyInputFieldDelegate> keyDelegate;
+
+@property (nonatomic, assign) CGKeyCode keyCode;
+    // The currently displayed key code, or NJKeyInputFieldEmpty if no
+    // key is active.  Changing this will update the display but not
+    // inform the delegate.
+
+@property (nonatomic, readonly) BOOL hasKeyCode;
+    // True if any key is active, false otherwise.
+
+- (void)clear;
+    // Clear the currently active key and call the delegate.
+
+@end
+
+@protocol NJKeyInputFieldDelegate <NSObject>
+
+- (void)keyInputField:(NJKeyInputField *)keyInput
+         didChangeKey:(CGKeyCode)keyCode;
+- (void)keyInputFieldDidClear:(NJKeyInputField *)keyInput;
+
+@end
+
diff --git a/Classes/NJKeyInputField.m b/Classes/NJKeyInputField.m
new file mode 100644 (file)
index 0000000..ec08150
--- /dev/null
@@ -0,0 +1,213 @@
+//
+//  NJKeyInputField.h
+//  Enjoyable
+//
+//  Copyright 2013 Joe Wreschnig.
+//
+
+#import "NJKeyInputField.h"
+
+CGKeyCode NJKeyInputFieldEmpty = 0xFFFF;
+
+@implementation NJKeyInputField
+
+- (id)initWithFrame:(NSRect)frameRect {
+    if ((self = [super initWithFrame:frameRect])) {
+        self.alignment = NSCenterTextAlignment;
+        [self setEditable:NO];
+        [self setSelectable:NO];
+    }
+    return self;
+}
+
+- (void)clear {
+    self.keyCode = NJKeyInputFieldEmpty;
+    [self.keyDelegate keyInputFieldDidClear:self];
+    [self resignIfFirstResponder];
+}
+
+- (BOOL)hasKeyCode {
+    return self.keyCode != NJKeyInputFieldEmpty;
+}
+
++ (NSString *)stringForKeyCode:(CGKeyCode)keyCode {
+    switch (keyCode) {
+        case 0xffff: return @"";
+        case 0x7a: return @"F1";
+        case 0x78: return @"F2";
+        case 0x63: return @"F3";
+        case 0x76: return @"F4";
+        case 0x60: return @"F5";
+        case 0x61: return @"F6";
+        case 0x62: return @"F7";
+        case 0x64: return @"F8";
+        case 0x65: return @"F9";
+        case 0x6d: return @"F10";
+        case 0x67: return @"F11";
+        case 0x6f: return @"F12";
+        case 0x69: return @"F13";
+        case 0x6b: return @"F14";
+        case 0x71: return @"F15";
+        case 0x6a: return @"F16";
+        case 0x40: return @"F17";
+        case 0x4f: return @"F18";
+        case 0x50: return @"F19";
+            
+        case 0x35: return @"Esc";
+        case 0x32: return @"`";
+            
+        case 0x12: return @"1";
+        case 0x13: return @"2";
+        case 0x14: return @"3";
+        case 0x15: return @"4";
+        case 0x17: return @"5";
+        case 0x16: return @"6";
+        case 0x1a: return @"7";
+        case 0x1c: return @"8";
+        case 0x19: return @"9";
+        case 0x1d: return @"0";
+        case 0x1b: return @"-";
+        case 0x18: return @"=";
+            
+        case 0x3f: return @"Fn";
+        case 0x36: return @"Right Command";
+        case 0x37: return @"Left Command";
+        case 0x38: return @"Left Shift";
+        case 0x39: return @"Caps Lock";
+        case 0x3a: return @"Left Option";
+        case 0x3b: return @"Left Control";
+        case 0x3c: return @"Right Shift";
+        case 0x3d: return @"Right Option";
+        case 0x3e: return @"Right Control";
+            
+        case 0x73: return @"Home";
+        case 0x74: return @"Page Up";
+        case 0x75: return @"Delete";
+        case 0x77: return @"End";
+        case 0x79: return @"Page Down";
+            
+        case 0x30: return @"Tab";
+        case 0x33: return @"Backspace";
+        case 0x24: return @"Return";
+        case 0x31: return @"Space";
+            
+        case 0x0c: return @"Q";
+        case 0x0d: return @"W";
+        case 0x0e: return @"E";
+        case 0x0f: return @"R";
+        case 0x11: return @"T";
+        case 0x10: return @"Y";
+        case 0x20: return @"U";
+        case 0x22: return @"I";
+        case 0x1f: return @"O";
+        case 0x23: return @"P";
+        case 0x21: return @"[";
+        case 0x1e: return @"]";
+        case 0x2a: return @"\\";
+        case 0x00: return @"A";
+        case 0x01: return @"S";
+        case 0x02: return @"D";
+        case 0x03: return @"F";
+        case 0x05: return @"G";
+        case 0x04: return @"H";
+        case 0x26: return @"J";
+        case 0x28: return @"K";
+        case 0x25: return @"L";
+        case 0x29: return @";";
+        case 0x27: return @"'";
+        case 0x06: return @"Z";
+        case 0x07: return @"X";
+        case 0x08: return @"C";
+        case 0x09: return @"V";
+        case 0x0b: return @"B";
+        case 0x2d: return @"N";
+        case 0x2e: return @"M";
+        case 0x2b: return @",";
+        case 0x2f: return @".";
+        case 0x2c: return @"/";
+            
+        case 0x47: return @"Clear";
+        case 0x51: return @"Keypad =";
+        case 0x4b: return @"Keypad /";
+        case 0x43: return @"Keypad *";
+        case 0x59: return @"Keypad 7";
+        case 0x5b: return @"Keypad 8";
+        case 0x5c: return @"Keypad 9";
+        case 0x4e: return @"Keypad -";
+        case 0x56: return @"Keypad 4";
+        case 0x57: return @"Keypad 5";
+        case 0x58: return @"Keypad 6";
+        case 0x45: return @"Keypad +";
+        case 0x53: return @"Keypad 1";
+        case 0x54: return @"Keypad 2";
+        case 0x55: return @"Keypad 3";
+        case 0x52: return @"Keypad 0";
+        case 0x41: return @"Keypad .";
+        case 0x4c: return @"Enter";
+            
+        case 0x7e: return @"Up";
+        case 0x7d: return @"Down";
+        case 0x7b: return @"Left";
+        case 0x7c: return @"Right";
+        default:
+            return [[NSString alloc] initWithFormat:@"Key 0x%x", keyCode];
+    }
+}
+
+- (BOOL)acceptsFirstResponder {
+    return self.isEnabled;
+}
+
+- (BOOL)becomeFirstResponder {
+    self.backgroundColor = NSColor.selectedTextBackgroundColor;
+    return [super becomeFirstResponder];
+}
+
+- (BOOL)resignFirstResponder {
+    self.backgroundColor = NSColor.textBackgroundColor;
+    return [super resignFirstResponder];
+}
+
+- (void)setKeyCode:(CGKeyCode)keyCode {
+    _keyCode = keyCode;
+    self.stringValue = [NJKeyInputField stringForKeyCode:keyCode];
+}
+
+- (void)keyDown:(NSEvent *)theEvent {
+    if (!theEvent.isARepeat) {
+        if ((theEvent.modifierFlags & NSAlternateKeyMask)
+            && 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];
+        }
+        [self resignIfFirstResponder];
+    }
+}
+
+- (void)mouseDown:(NSEvent *)theEvent {
+    if (self.acceptsFirstResponder)
+        [self.window makeFirstResponder:self];
+}
+
+- (void)flagsChanged:(NSEvent *)theEvent {
+    // Many keys are only available on MacBook keyboards by using the
+    // Fn modifier key (e.g. Fn+Left for Home), so delay processing
+    // modifiers until the up event is received in order to let the
+    // user type these virtual keys. However, there is no actual event
+    // for modifier key up - so detect it by checking to see if any
+    // modifiers are still down.
+    if (!(theEvent.modifierFlags & NSDeviceIndependentModifierFlagsMask)) {
+        self.keyCode = theEvent.keyCode;
+        [self.keyDelegate keyInputField:self didChangeKey:_keyCode];
+    }
+}
+
+@end
diff --git a/Classes/NJMapping.h b/Classes/NJMapping.h
new file mode 100644 (file)
index 0000000..5653745
--- /dev/null
@@ -0,0 +1,25 @@
+//
+//  NJMapping.h
+//  Enjoy
+//
+//  Created by Sam McCall on 4/05/09.
+//  Copyright 2009 University of Otago. All rights reserved.
+//
+
+@class NJOutput;
+@class NJInput;
+
+@interface NJMapping : NSObject
+
+@property (nonatomic, copy) NSString *name;
+@property (nonatomic, readonly) NSMutableDictionary *entries;
+
+- (id)initWithName:(NSString *)name;
+- (NJOutput *)objectForKeyedSubscript:(NJInput *)input;
+- (void)setObject:(NJOutput *)output forKeyedSubscript:(NJInput *)input;
+- (NSDictionary *)serialize;
+- (BOOL)writeToURL:(NSURL *)url error:(NSError **)error;
+
++ (id)mappingWithContentsOfURL:(NSURL *)url mappings:(NSArray *)mappings error:(NSError **)error;
+
+@end
diff --git a/Classes/NJMapping.m b/Classes/NJMapping.m
new file mode 100644 (file)
index 0000000..8cc5724
--- /dev/null
@@ -0,0 +1,91 @@
+//
+//  NJMapping.m
+//  Enjoy
+//
+//  Created by Sam McCall on 4/05/09.
+//
+
+#import "NJMapping.h"
+
+#import "NJInput.h"
+#import "NJOutput.h"
+
+@implementation NJMapping
+
+- (id)initWithName:(NSString *)name {
+    if ((self = [super init])) {
+        self.name = name ? name : @"Untitled";
+        _entries = [[NSMutableDictionary alloc] init];
+    }
+    return self;
+}
+
+- (NJOutput *)objectForKeyedSubscript:(NJInput *)input {
+    return input ? _entries[input.uid] : nil;
+}
+
+- (void)setObject:(NJOutput *)output forKeyedSubscript:(NJInput *)input {
+    if (input) {
+        if (output)
+            _entries[input.uid] = output;
+        else
+            [_entries removeObjectForKey:input.uid];
+    }
+}
+
+- (NSDictionary *)serialize {
+    NSMutableDictionary *entries = [[NSMutableDictionary alloc] initWithCapacity:_entries.count];
+    for (id key in _entries) {
+        id serialized = [_entries[key] serialize];
+        if (serialized)
+            entries[key] = serialized;
+    }
+    return @{ @"name": _name, @"entries": entries };
+}
+
+- (BOOL)writeToURL:(NSURL *)url error:(NSError **)error {
+    [NSProcessInfo.processInfo disableSuddenTermination];
+    NSDictionary *serialization = [self serialize];
+    NSData *json = [NSJSONSerialization dataWithJSONObject:serialization
+                                                   options:NSJSONWritingPrettyPrinted
+                                                     error:error];
+    BOOL success = json && [json writeToURL:url options:NSDataWritingAtomic error:error];
+    [NSProcessInfo.processInfo enableSuddenTermination];
+    return success;
+}
+
++ (id)mappingWithContentsOfURL:(NSURL *)url mappings:(NSArray *)mappings error:(NSError **)error {
+    NSInputStream *stream = [NSInputStream inputStreamWithURL:url];
+    [stream open];
+    NSDictionary *serialization = stream && !*error
+        ? [NSJSONSerialization JSONObjectWithStream:stream options:0 error:error]
+        : nil;
+    [stream close];
+    
+    if (!serialization && error)
+        return nil;
+    
+    if (!([serialization isKindOfClass:NSDictionary.class]
+          && [serialization[@"name"] isKindOfClass:NSString.class]
+          && [serialization[@"entries"] isKindOfClass:NSDictionary.class])) {
+        *error = [NSError errorWithDomain:@"Enjoyable"
+                                     code:0
+                              description:@"This isn't a valid mapping file."];
+        return nil;
+    }
+    
+    NSDictionary *entries = serialization[@"entries"];
+    NJMapping *mapping = [[NJMapping alloc] initWithName:serialization[@"name"]];
+    for (id key in entries) {
+        NSDictionary *value = entries[key];
+        if ([key isKindOfClass:NSString.class]) {
+            NJOutput *output = [NJOutput outputDeserialize:value
+                                              withMappings:mappings];
+            if (output)
+                mapping.entries[key] = output;
+        }
+    }
+    return mapping;
+}
+
+@end
diff --git a/Classes/NJMappingsController.h b/Classes/NJMappingsController.h
new file mode 100644 (file)
index 0000000..b252904
--- /dev/null
@@ -0,0 +1,46 @@
+//
+//  NJMappingsController.h
+//  Enjoy
+//
+//  Created by Sam McCall on 4/05/09.
+//  Copyright 2009 University of Otago. All rights reserved.
+//
+
+@class NJMapping;
+@class NJOutputController;
+
+@interface NJMappingsController : NSObject <NSTableViewDataSource,
+                                            NSTableViewDelegate,
+                                            NSOpenSavePanelDelegate,
+                                            NSPopoverDelegate,
+                                            NSFastEnumeration>
+{
+    IBOutlet NSButton *removeButton;
+    IBOutlet NSTableView *tableView;
+    IBOutlet NJOutputController *outputController;
+    IBOutlet NSButton *popoverActivate;
+    IBOutlet NSPopover *popover;
+    IBOutlet NSButton *moveUp;
+    IBOutlet NSButton *moveDown;
+}
+
+@property (nonatomic, readonly) NJMapping *currentMapping;
+@property (nonatomic, readonly) NSArray *mappings;
+
+- (NJMapping *)objectForKeyedSubscript:(NSString *)name;
+- (NJMapping *)objectAtIndexedSubscript:(NSUInteger)idx;
+- (void)addMappingWithContentsOfURL:(NSURL *)url;
+- (void)activateMapping:(NJMapping *)mapping;
+- (void)activateMappingForProcess:(NSString *)processName;
+- (void)save;
+- (void)load;
+
+- (IBAction)mappingPressed:(id)sender;
+- (IBAction)addPressed:(id)sender;
+- (IBAction)removePressed:(id)sender;
+- (IBAction)moveUpPressed:(id)sender;
+- (IBAction)moveDownPressed:(id)sender;
+- (IBAction)importPressed:(id)sender;
+- (IBAction)exportPressed:(id)sender;
+
+@end
diff --git a/Classes/NJMappingsController.m b/Classes/NJMappingsController.m
new file mode 100644 (file)
index 0000000..ea8137f
--- /dev/null
@@ -0,0 +1,436 @@
+//
+//  NJMappingsController.m
+//  Enjoy
+//
+//  Created by Sam McCall on 4/05/09.
+//
+
+#import "NJMappingsController.h"
+
+#import "NJMapping.h"
+#import "NJMappingsController.h"
+#import "NJOutput.h"
+#import "NJOutputController.h"
+#import "NJEvents.h"
+
+#define PB_ROW @"com.yukkurigames.Enjoyable.MappingRow"
+
+@implementation NJMappingsController {
+    NSMutableArray *_mappings;
+    NJMapping *manualMapping;
+    NSString *draggingName;
+}
+
+- (id)init {
+    if ((self = [super init])) {
+        _mappings = [[NSMutableArray alloc] init];
+        _currentMapping = [[NJMapping alloc] initWithName:@"(default)"];
+        manualMapping = _currentMapping;
+        [_mappings addObject:_currentMapping];
+    }
+    return self;
+}
+
+- (void)awakeFromNib {
+    [tableView registerForDraggedTypes:@[PB_ROW, NSURLPboardType]];
+    [tableView setDraggingSourceOperationMask:NSDragOperationCopy forLocal:NO];
+}
+
+- (NJMapping *)objectForKeyedSubscript:(NSString *)name {
+    for (NJMapping *mapping in _mappings)
+        if ([name isEqualToString:mapping.name])
+            return mapping;
+    return nil;
+}
+
+- (NJMapping *)objectAtIndexedSubscript:(NSUInteger)idx {
+    return idx < _mappings.count ? _mappings[idx] : nil;
+}
+
+- (void)mappingsChanged {
+    [self save];
+    [tableView reloadData];
+    popoverActivate.title = _currentMapping.name;
+    [self updateInterfaceForCurrentMapping];
+    [NSNotificationCenter.defaultCenter
+        postNotificationName:NJEventMappingListChanged
+        object:_mappings];
+}
+
+- (NSUInteger)countByEnumeratingWithState:(NSFastEnumerationState *)state
+                                  objects:(__unsafe_unretained id [])buffer
+                                    count:(NSUInteger)len {
+    return [_mappings countByEnumeratingWithState:state
+                                          objects:buffer
+                                            count:len];
+}
+
+- (void)activateMappingForProcess:(NSString *)processName {
+    if ([manualMapping.name.lowercaseString isEqualToString:@"@application"]) {
+        manualMapping.name = processName;
+        [self mappingsChanged];
+    } else {
+        NJMapping *oldMapping = manualMapping;
+        NJMapping *newMapping = self[processName];
+        if (!newMapping)
+            newMapping = oldMapping;
+        if (newMapping != _currentMapping)
+            [self activateMapping:newMapping];
+        manualMapping = oldMapping;
+    }
+}
+
+- (void)updateInterfaceForCurrentMapping {
+    NSUInteger selected = [_mappings indexOfObject:_currentMapping];
+    [removeButton setEnabled:selected != 0];
+    [moveDown setEnabled:selected && selected != _mappings.count - 1];
+    [moveUp setEnabled:selected > 1];
+    popoverActivate.title = _currentMapping.name;
+    [tableView selectRowIndexes:[NSIndexSet indexSetWithIndex:selected] byExtendingSelection:NO];
+    [NSUserDefaults.standardUserDefaults setInteger:selected forKey:@"selected"];
+}
+
+- (void)activateMapping:(NJMapping *)mapping {
+    if (!mapping)
+        mapping = manualMapping;
+    if (mapping == _currentMapping)
+        return;
+    NSLog(@"Switching to mapping %@.", mapping.name);
+    manualMapping = mapping;
+    _currentMapping = mapping;
+    [self updateInterfaceForCurrentMapping];
+    [outputController loadCurrent];
+    [NSNotificationCenter.defaultCenter postNotificationName:NJEventMappingChanged
+                                                      object:_currentMapping];
+}
+
+- (IBAction)addPressed:(id)sender {
+    NJMapping *newMapping = [[NJMapping alloc] initWithName:@"Untitled"];
+    [_mappings addObject:newMapping];
+    [self activateMapping:newMapping];
+    [self mappingsChanged];
+    [tableView editColumn:0 row:_mappings.count - 1 withEvent:nil select:YES];
+}
+
+- (IBAction)removePressed:(id)sender {
+    if (tableView.selectedRow == 0)
+        return;
+    
+    NSInteger selectedRow = tableView.selectedRow;
+    [_mappings removeObjectAtIndex:selectedRow];
+    [self activateMapping:_mappings[MIN(selectedRow, _mappings.count - 1)]];
+    [self mappingsChanged];
+}
+
+- (void)tableViewSelectionDidChange:(NSNotification *)notify {
+    [self activateMapping:self[tableView.selectedRow]];
+}
+
+- (id)tableView:(NSTableView *)view objectValueForTableColumn:(NSTableColumn *)column row:(NSInteger)index {
+    return self[index].name;
+}
+
+- (void)tableView:(NSTableView *)view
+   setObjectValue:(NSString *)obj
+   forTableColumn:(NSTableColumn *)col
+              row:(NSInteger)index {
+    self[index].name = obj;
+    [self mappingsChanged];
+}
+
+- (NSInteger)numberOfRowsInTableView:(NSTableView *)tableView {
+    return _mappings.count;
+}
+
+- (BOOL)tableView:(NSTableView *)view shouldEditTableColumn:(NSTableColumn *)column row:(NSInteger)index {
+    return YES;
+}
+
+- (void)save {
+    NSLog(@"Saving mappings to defaults.");
+    NSMutableArray *ary = [[NSMutableArray alloc] initWithCapacity:_mappings.count];
+    for (NJMapping *mapping in _mappings)
+        [ary addObject:[mapping serialize]];
+    [NSUserDefaults.standardUserDefaults setObject:ary forKey:@"mappings"];
+}
+
+- (void)load {
+    NSUInteger selected = [NSUserDefaults.standardUserDefaults integerForKey:@"selected"];
+    NSArray *mappings = [NSUserDefaults.standardUserDefaults arrayForKey:@"mappings"];
+    [self loadAllFrom:mappings andActivate:selected];
+}
+
+- (void)loadAllFrom:(NSArray *)storedMappings andActivate:(NSUInteger)selected {
+    NSMutableArray* newMappings = [[NSMutableArray alloc] initWithCapacity:storedMappings.count];
+
+    // have to do two passes in case mapping1 refers to mapping2 via a NJOutputMapping
+    for (NSDictionary *storedMapping in storedMappings) {
+        NJMapping *mapping = [[NJMapping alloc] initWithName:storedMapping[@"name"]];
+        [newMappings addObject:mapping];
+    }
+
+    for (unsigned i = 0; i < storedMappings.count; ++i) {
+        NSDictionary *entries = storedMappings[i][@"entries"];
+        NJMapping *mapping = newMappings[i];
+        for (id key in entries) {
+            NJOutput *output = [NJOutput outputDeserialize:entries[key]
+                                              withMappings:newMappings];
+            if (output)
+                mapping.entries[key] = output;
+        }
+    }
+    
+    if (newMappings.count) {
+        _mappings = newMappings;
+        if (selected >= newMappings.count)
+            selected = 0;
+        [self activateMapping:_mappings[selected]];
+        [self mappingsChanged];
+    }
+}
+
+- (NJMapping *)mappingWithURL:(NSURL *)url error:(NSError **)error {
+    NSInputStream *stream = [NSInputStream inputStreamWithURL:url];
+    [stream open];
+    NSDictionary *serialization = !*error
+        ? [NSJSONSerialization JSONObjectWithStream:stream options:0 error:error]
+        : nil;
+    [stream close];
+    
+    if (!([serialization isKindOfClass:NSDictionary.class]
+          && [serialization[@"name"] isKindOfClass:NSString.class]
+          && [serialization[@"entries"] isKindOfClass:NSDictionary.class])) {
+        *error = [NSError errorWithDomain:@"Enjoyable"
+                                     code:0
+                              description:@"This isn't a valid mapping file."];
+        return nil;
+    }
+
+    NSDictionary *entries = serialization[@"entries"];
+    NJMapping *mapping = [[NJMapping alloc] initWithName:serialization[@"name"]];
+    for (id key in entries) {
+        NSDictionary *value = entries[key];
+        if ([key isKindOfClass:NSString.class]) {
+            NJOutput *output = [NJOutput outputDeserialize:value
+                                              withMappings:_mappings];
+            if (output)
+                mapping.entries[key] = output;
+        }
+    }
+    return mapping;
+}
+
+- (void)addMappingWithContentsOfURL:(NSURL *)url {
+    NSWindow *window = popoverActivate.window;
+    NSError *error;
+    NJMapping *mapping = [NJMapping mappingWithContentsOfURL:url
+                                                    mappings:_mappings
+                                                       error:&error];
+    
+    if (mapping && !error) {
+        BOOL conflict = NO;
+        NJMapping *mergeInto = self[mapping.name];
+        for (id key in mapping.entries) {
+            if (mergeInto.entries[key]
+                && ![mergeInto.entries[key] isEqual:mapping.entries[key]]) {
+                conflict = YES;
+                break;
+            }
+        }
+        
+        if (conflict) {
+            NSAlert *conflictAlert = [[NSAlert alloc] init];
+            conflictAlert.messageText = @"Replace existing mappings?";
+            conflictAlert.informativeText =
+            [NSString stringWithFormat:
+             @"This file contains inputs you've already mapped in \"%@\". Do you "
+             @"want to merge them and replace your existing mappings, or import this "
+             @"as a separate mapping?", mapping.name];
+            [conflictAlert addButtonWithTitle:@"Merge"];
+            [conflictAlert addButtonWithTitle:@"Cancel"];
+            [conflictAlert addButtonWithTitle:@"New Mapping"];
+            NSInteger res = [conflictAlert runModal];
+            if (res == NSAlertSecondButtonReturn)
+                return;
+            else if (res == NSAlertThirdButtonReturn)
+                mergeInto = nil;
+        }
+        
+        if (mergeInto) {
+            [mergeInto.entries addEntriesFromDictionary:mapping.entries];
+            mapping = mergeInto;
+        } else {
+            [_mappings addObject:mapping];
+        }
+        
+        [self activateMapping:mapping];
+        [self mappingsChanged];
+        
+        if (conflict && !mergeInto) {
+            [tableView selectRowIndexes:[NSIndexSet indexSetWithIndex:_mappings.count - 1] byExtendingSelection:NO];
+            [tableView editColumn:0 row:_mappings.count - 1 withEvent:nil select:YES];
+        }
+    }
+    
+    if (error) {
+        [window presentError:error
+              modalForWindow:window
+                    delegate:nil
+          didPresentSelector:nil
+                 contextInfo:nil];
+    }
+}
+
+- (void)importPressed:(id)sender {
+    NSOpenPanel *panel = [NSOpenPanel openPanel];
+    panel.allowedFileTypes = @[ @"enjoyable", @"json", @"txt" ];
+    NSWindow *window = NSApplication.sharedApplication.keyWindow;
+    [panel beginSheetModalForWindow:window
+                  completionHandler:^(NSInteger result) {
+                      if (result != NSFileHandlingPanelOKButton)
+                          return;
+                      [panel close];
+                      [self addMappingWithContentsOfURL:panel.URL];
+                  }];
+    
+}
+
+- (void)exportPressed:(id)sender {
+    NSSavePanel *panel = [NSSavePanel savePanel];
+    panel.allowedFileTypes = @[ @"enjoyable" ];
+    NJMapping *mapping = _currentMapping;
+    panel.nameFieldStringValue = [mapping.name stringByFixingPathComponent];
+    NSWindow *window = NSApplication.sharedApplication.keyWindow;
+    [panel beginSheetModalForWindow:window
+                  completionHandler:^(NSInteger result) {
+                      if (result != NSFileHandlingPanelOKButton)
+                          return;
+                      [panel close];
+                      NSError *error;
+                      [mapping writeToURL:panel.URL error:&error];
+                      if (error) {
+                          [window presentError:error
+                                modalForWindow:window
+                                      delegate:nil
+                            didPresentSelector:nil
+                                   contextInfo:nil];
+                      }
+                  }];
+}
+
+- (IBAction)mappingPressed:(id)sender {
+    [popover showRelativeToRect:popoverActivate.bounds
+                         ofView:popoverActivate
+                  preferredEdge:NSMinXEdge];
+}
+
+- (void)popoverWillShow:(NSNotification *)notification {
+    popoverActivate.state = NSOnState;
+}
+
+- (void)popoverWillClose:(NSNotification *)notification {
+    popoverActivate.state = NSOffState;
+}
+
+- (IBAction)moveUpPressed:(id)sender {
+    NSUInteger idx = [_mappings indexOfObject:_currentMapping];
+    if (idx > 1 && idx != NSNotFound) {
+        [_mappings exchangeObjectAtIndex:idx withObjectAtIndex:idx - 1];
+        [self mappingsChanged];
+    }
+}
+
+- (IBAction)moveDownPressed:(id)sender {
+    NSUInteger idx = [_mappings indexOfObject:_currentMapping];
+    if (idx < _mappings.count - 1) {
+        [_mappings exchangeObjectAtIndex:idx withObjectAtIndex:idx + 1];
+        [self mappingsChanged];
+    }
+}
+
+- (BOOL)tableView:(NSTableView *)tableView_
+       acceptDrop:(id <NSDraggingInfo>)info
+              row:(NSInteger)row
+    dropOperation:(NSTableViewDropOperation)dropOperation {
+    NSPasteboard *pboard = [info draggingPasteboard];
+    if ([pboard.types containsObject:PB_ROW]) {
+        NSString *value = [pboard stringForType:PB_ROW];
+        NSUInteger srcRow = [value intValue];
+        [_mappings moveObjectAtIndex:srcRow toIndex:row];
+        [self mappingsChanged];
+        return YES;
+    } else if ([pboard.types containsObject:NSURLPboardType]) {
+        NSURL *url = [NSURL URLFromPasteboard:pboard];
+        NSError *error;
+        NJMapping *mapping = [NJMapping mappingWithContentsOfURL:url
+                                                        mappings:_mappings
+                                                           error:&error];
+        if (error) {
+            [tableView_ presentError:error];
+            return NO;
+        } else {
+            [_mappings insertObject:mapping atIndex:row];
+            [self mappingsChanged];
+            return YES;
+        }
+    } else {
+        return NO;
+    }
+}
+
+- (NSDragOperation)tableView:(NSTableView *)tableView_
+                validateDrop:(id <NSDraggingInfo>)info
+                 proposedRow:(NSInteger)row
+       proposedDropOperation:(NSTableViewDropOperation)dropOperation {
+    NSPasteboard *pboard = [info draggingPasteboard];
+    if ([pboard.types containsObject:PB_ROW]) {
+        [tableView_ setDropRow:MAX(1, row) dropOperation:NSTableViewDropAbove];
+        return NSDragOperationMove;
+    } else if ([pboard.types containsObject:NSURLPboardType]) {
+        NSURL *url = [NSURL URLFromPasteboard:pboard];
+        if ([url.pathExtension isEqualToString:@"enjoyable"]) {
+            [tableView_ setDropRow:MAX(1, row) dropOperation:NSTableViewDropAbove];
+            return NSDragOperationCopy;
+        } else {
+            return NSDragOperationNone;
+        }
+    } else {
+        return NSDragOperationNone;
+    }
+}
+
+- (NSArray *)tableView:(NSTableView *)tableView_
+namesOfPromisedFilesDroppedAtDestination:(NSURL *)dropDestination
+forDraggedRowsWithIndexes:(NSIndexSet *)indexSet {
+    NJMapping *toSave = self[indexSet.firstIndex];
+    NSString *filename = [[toSave.name stringByFixingPathComponent]
+                          stringByAppendingPathExtension:@"enjoyable"];
+    NSURL *dst = [dropDestination URLByAppendingPathComponent:filename];
+    dst = [NSFileManager.defaultManager generateUniqueURLWithBase:dst];     
+    NSError *error;
+    if (![toSave writeToURL:dst error:&error]) {
+        [tableView_ presentError:error];
+        return @[];
+    } else {
+        return @[dst.lastPathComponent];
+    }
+}
+
+- (BOOL)tableView:(NSTableView *)tableView_
+writeRowsWithIndexes:(NSIndexSet *)rowIndexes
+     toPasteboard:(NSPasteboard *)pboard {
+    if (rowIndexes.count == 1 && rowIndexes.firstIndex != 0) {
+        [pboard declareTypes:@[PB_ROW, NSFilesPromisePboardType] owner:nil];
+        [pboard setString:@(rowIndexes.firstIndex).stringValue forType:PB_ROW];
+        [pboard setPropertyList:@[@"enjoyable"] forType:NSFilesPromisePboardType];
+        return YES;
+    } else if (rowIndexes.count == 1 && rowIndexes.firstIndex == 0) {
+        [pboard declareTypes:@[NSFilesPromisePboardType] owner:nil];
+        [pboard setPropertyList:@[@"enjoyable"] forType:NSFilesPromisePboardType];
+        return YES;
+    } else {
+        return NO;
+    }
+}
+
+@end
diff --git a/Classes/NJOutput.h b/Classes/NJOutput.h
new file mode 100644 (file)
index 0000000..b82c4e7
--- /dev/null
@@ -0,0 +1,26 @@
+//
+//  NJOutput.h
+//  Enjoy
+//
+//  Created by Sam McCall on 5/05/09.
+//  Copyright 2009 University of Otago. All rights reserved.
+//
+
+@class NJDeviceController;
+
+@interface NJOutput : NSObject
+
+@property (nonatomic, assign) float magnitude;
+@property (nonatomic, assign) BOOL running;
+@property (nonatomic, readonly) BOOL isContinuous;
+
+- (void)trigger;
+- (void)untrigger;
+- (BOOL)update:(NJDeviceController *)jc;
+
+- (NSDictionary *)serialize;
++ (NJOutput *)outputDeserialize:(NSDictionary *)serialization
+                   withMappings:(NSArray *)mappings;
++ (NSString *)serializationCode;
+
+@end
diff --git a/Classes/NJOutput.m b/Classes/NJOutput.m
new file mode 100644 (file)
index 0000000..409b3e6
--- /dev/null
@@ -0,0 +1,87 @@
+//
+//  NJOutput.m
+//  Enjoy
+//
+//  Created by Sam McCall on 5/05/09.
+//
+
+#import "NJOutput.h"
+
+#import "NJOutputKeyPress.h"
+#import "NJOutputMapping.h"
+#import "NJOutputMouseMove.h"
+#import "NJOutputMouseButton.h"
+#import "NJOutputMouseScroll.h"
+
+@implementation NJOutput {
+    BOOL running;
+}
+
++ (NSString *)serializationCode {
+    [self doesNotRecognizeSelector:_cmd];
+    return nil;
+}
+
+- (NSDictionary *)serialize {
+    [self doesNotRecognizeSelector:_cmd];
+    return nil;    
+}
+
+- (BOOL)isEqual:(id)object {
+    return [object isKindOfClass:NJOutput.class]
+        && [[self serialize] isEqual:[object serialize]];
+}
+
+- (NSUInteger)hash {
+    return [[self serialize] hash];
+}
+
++ (NJOutput *)outputDeserialize:(NSDictionary *)serialization
+                  withMappings:(NSArray *)mappings {
+    // Don't crash loading old/bad mappings (but don't load them either).
+    if (![serialization isKindOfClass:NSDictionary.class])
+        return nil;
+    NSString *type = serialization[@"type"];
+    for (Class cls in @[NJOutputKeyPress.class,
+                        NJOutputMapping.class,
+                        NJOutputMouseMove.class,
+                        NJOutputMouseButton.class,
+                        NJOutputMouseScroll.class
+         ]) {
+        if ([type isEqualToString:cls.serializationCode])
+            return [cls outputDeserialize:serialization withMappings:mappings];
+    }
+    
+    return nil;
+}
+
+- (void)trigger {
+}
+
+- (void)untrigger {
+}
+
+- (BOOL)update:(NJDeviceController *)jc {
+    return NO;
+}
+
+- (BOOL)isContinuous {
+    return NO;
+}
+
+- (BOOL)running {
+    return running;
+}
+
+- (void)setRunning:(BOOL)newRunning {
+    if (running != newRunning) {
+        running = newRunning;
+        if (running)
+            [self trigger];
+        else
+            [self untrigger];
+    }
+}
+
+
+@end
diff --git a/Classes/NJOutputController.h b/Classes/NJOutputController.h
new file mode 100644 (file)
index 0000000..f8052e7
--- /dev/null
@@ -0,0 +1,42 @@
+//
+//  NJOutputController.h
+//  Enjoy
+//
+//  Created by Sam McCall on 5/05/09.
+//  Copyright 2009 University of Otago. All rights reserved.
+//
+
+#import "NJKeyInputField.h"
+
+@class NJMappingsController;
+@class NJDeviceController;
+@class NJOutput;
+@class NJOutputMouseMove;
+
+@interface NJOutputController : NSObject <NJKeyInputFieldDelegate> {
+    IBOutlet NJKeyInputField *keyInput;
+    IBOutlet NSMatrix *radioButtons;
+    IBOutlet NSSegmentedControl *mouseDirSelect;
+    IBOutlet NSSlider *mouseSpeedSlider;
+    IBOutlet NSSegmentedControl *mouseBtnSelect;
+    IBOutlet NSSegmentedControl *scrollDirSelect;
+    IBOutlet NSSlider *scrollSpeedSlider;
+    IBOutlet NSTextField *title;
+    IBOutlet NSPopUpButton *mappingPopup;
+    IBOutlet NJMappingsController *mappingsController;
+    IBOutlet NJDeviceController *inputController;
+}
+
+@property (assign) BOOL enabled;
+
+- (void)loadCurrent;
+- (IBAction)radioChanged:(id)sender;
+- (IBAction)mdirChanged:(id)sender;
+- (IBAction)mbtnChanged:(id)sender;
+- (IBAction)sdirChanged:(id)sender;
+- (IBAction)mouseSpeedChanged:(id)sender;
+- (IBAction)scrollSpeedChanged:(id)sender;
+
+- (void)focusKey;
+
+@end
diff --git a/Classes/NJOutputController.m b/Classes/NJOutputController.m
new file mode 100644 (file)
index 0000000..bcafe0d
--- /dev/null
@@ -0,0 +1,283 @@
+//
+//  NJOutputController.m
+//  Enjoy
+//
+//  Created by Sam McCall on 5/05/09.
+//
+
+#import "NJOutputController.h"
+
+#import "NJMappingsController.h"
+#import "NJMapping.h"
+#import "NJInput.h"
+#import "NJEvents.h"
+#import "NJDeviceController.h"
+#import "NJKeyInputField.h"
+#import "NJOutputMapping.h"
+#import "NJOutputController.h"
+#import "NJOutputKeyPress.h"
+#import "NJOutputMouseButton.h"
+#import "NJOutputMouseMove.h"
+#import "NJOutputMouseScroll.h"
+
+@implementation NJOutputController
+
+- (id)init {
+    if ((self = [super init])) {
+        [NSNotificationCenter.defaultCenter
+            addObserver:self
+            selector:@selector(mappingListDidChange:)
+            name:NJEventMappingListChanged
+            object:nil];
+    }
+    return self;
+}
+
+- (void)dealloc {
+    [NSNotificationCenter.defaultCenter removeObserver:self];
+}
+
+- (void)cleanUpInterface {
+    NSInteger row = radioButtons.selectedRow;
+    
+    if (row != 1) {
+        keyInput.keyCode = NJKeyInputFieldEmpty;
+        [keyInput resignIfFirstResponder];
+    }
+    
+    if (row != 2) {
+        [mappingPopup selectItemAtIndex:-1];
+        [mappingPopup resignIfFirstResponder];
+    } else if (!mappingPopup.selectedItem)
+        [mappingPopup selectItemAtIndex:0];
+    
+    if (row != 3) {
+        mouseDirSelect.selectedSegment = -1;
+        mouseSpeedSlider.floatValue = mouseSpeedSlider.minValue;
+        [mouseDirSelect resignIfFirstResponder];
+    } else {
+        if (mouseDirSelect.selectedSegment == -1)
+            mouseDirSelect.selectedSegment = 0;
+        if (!mouseSpeedSlider.floatValue)
+            mouseSpeedSlider.floatValue = 4;
+    }
+    
+    if (row != 4) {
+        mouseBtnSelect.selectedSegment = -1;
+        [mouseBtnSelect resignIfFirstResponder];
+    } else if (mouseBtnSelect.selectedSegment == -1)
+        mouseBtnSelect.selectedSegment = 0;
+    
+    if (row != 5) {
+        scrollDirSelect.selectedSegment = -1;
+        scrollSpeedSlider.floatValue = scrollSpeedSlider.minValue;
+        [scrollDirSelect resignIfFirstResponder];
+    } else {
+        if (scrollDirSelect.selectedSegment == -1)
+            scrollDirSelect.selectedSegment = 0;
+        if (scrollDirSelect.selectedSegment < 2
+            && !scrollSpeedSlider.floatValue)
+            scrollSpeedSlider.floatValue = 15.f;
+        else if (scrollDirSelect.selectedSegment >= 2
+                 && scrollSpeedSlider.floatValue)
+            scrollSpeedSlider.floatValue = scrollSpeedSlider.minValue;
+    }
+        
+}
+
+- (IBAction)radioChanged:(NSView *)sender {
+    [sender.window makeFirstResponder:sender];
+    if (radioButtons.selectedRow == 1)
+        [keyInput.window makeFirstResponder:keyInput];
+    [self commit];
+}
+
+- (void)keyInputField:(NJKeyInputField *)keyInput didChangeKey:(CGKeyCode)keyCode {
+    [radioButtons selectCellAtRow:1 column:0];
+    [radioButtons.window makeFirstResponder:radioButtons];
+    [self commit];
+}
+
+- (void)keyInputFieldDidClear:(NJKeyInputField *)keyInput {
+    [radioButtons selectCellAtRow:0 column:0];
+    [self commit];
+}
+
+- (void)mappingChosen:(id)sender {
+    [radioButtons selectCellAtRow:2 column:0];
+    [mappingPopup.window makeFirstResponder:mappingPopup];
+    [self commit];
+}
+
+- (void)mdirChanged:(NSView *)sender {
+    [radioButtons selectCellAtRow:3 column:0];
+    [sender.window makeFirstResponder:sender];
+    [self commit];
+}
+
+- (void)mouseSpeedChanged:(NSSlider *)sender {
+    [radioButtons selectCellAtRow:3 column:0];
+    [sender.window makeFirstResponder:sender];
+    [self commit];
+}
+
+- (void)mbtnChanged:(NSView *)sender {
+    [radioButtons selectCellAtRow:4 column:0];
+    [sender.window makeFirstResponder:sender];
+    [self commit];
+}
+
+- (void)sdirChanged:(NSView *)sender {
+    [radioButtons selectCellAtRow:5 column:0];
+    [sender.window makeFirstResponder:sender];
+    [self commit];
+}
+
+- (void)scrollSpeedChanged:(NSSlider *)sender {
+    [radioButtons selectCellAtRow:5 column:0];
+    [sender.window makeFirstResponder:sender];
+    if (!sender.floatValue && scrollDirSelect.selectedSegment < 2)
+        scrollDirSelect.selectedSegment += 2;
+    else if (sender.floatValue && scrollDirSelect.selectedSegment >= 2)
+        scrollDirSelect.selectedSegment -= 2;
+    [self commit];
+}
+
+- (NJOutput *)currentOutput {
+    return mappingsController.currentMapping[inputController.selectedInput];
+}
+
+- (NJOutput *)makeOutput {
+    switch (radioButtons.selectedRow) {
+        case 0:
+            return nil;
+        case 1:
+            if (keyInput.hasKeyCode) {
+                NJOutputKeyPress *k = [[NJOutputKeyPress alloc] init];
+                k.vk = keyInput.keyCode;
+                return k;
+            } else {
+                return nil;
+            }
+            break;
+        case 2: {
+            NJOutputMapping *c = [[NJOutputMapping alloc] init];
+            c.mapping = mappingsController[mappingPopup.indexOfSelectedItem];
+            return c;
+        }
+        case 3: {
+            NJOutputMouseMove *mm = [[NJOutputMouseMove alloc] init];
+            mm.axis = mouseDirSelect.selectedSegment;
+            mm.speed = mouseSpeedSlider.floatValue;
+            return mm;
+        }
+        case 4: {
+            NJOutputMouseButton *mb = [[NJOutputMouseButton alloc] init];
+            mb.button = mouseBtnSelect.selectedSegment == 0 ? kCGMouseButtonLeft : kCGMouseButtonRight;
+            return mb;
+        }
+        case 5: {
+            NJOutputMouseScroll *ms = [[NJOutputMouseScroll alloc] init];
+            ms.direction = (scrollDirSelect.selectedSegment & 1) ? 1 : -1;
+            ms.speed = scrollDirSelect.selectedSegment < 2
+                ? scrollSpeedSlider.floatValue
+                : 0.f;
+            return ms;
+        }
+        default:
+            return nil;
+    }
+}
+
+- (void)commit {
+    [self cleanUpInterface];
+    mappingsController.currentMapping[inputController.selectedInput] = [self makeOutput];
+    [mappingsController save];
+}
+
+- (BOOL)enabled {
+    return [radioButtons isEnabled];
+}
+
+- (void)setEnabled:(BOOL)enabled {
+    [radioButtons setEnabled:enabled];
+    [keyInput setEnabled:enabled];
+    [mappingPopup setEnabled:enabled];
+    [mouseDirSelect setEnabled:enabled];
+    [mouseSpeedSlider setEnabled:enabled];
+    [mouseBtnSelect setEnabled:enabled];
+    [scrollDirSelect setEnabled:enabled];
+    [scrollSpeedSlider setEnabled:enabled];
+}
+
+- (void)loadOutput:(NJOutput *)output forInput:(NJInput *)input {
+    if (!input) {
+        self.enabled = NO;
+        title.stringValue = @"";
+    } else {
+        self.enabled = YES;
+        NSString *inpFullName = input.name;
+        for (id <NJInputPathElement> cur = input.base; cur; cur = cur.base) {
+            inpFullName = [[NSString alloc] initWithFormat:@"%@ > %@", cur.name, inpFullName];
+        }
+        title.stringValue = inpFullName;
+    }
+
+    if ([output isKindOfClass:NJOutputKeyPress.class]) {
+        [radioButtons selectCellAtRow:1 column:0];
+        keyInput.keyCode = [(NJOutputKeyPress*)output vk];
+    } else if ([output isKindOfClass:NJOutputMapping.class]) {
+        [radioButtons selectCellAtRow:2 column:0];
+        NSMenuItem *item = [mappingPopup itemWithRepresentedObject:[(NJOutputMapping *)output mapping]];
+        [mappingPopup selectItem:item];
+        if (!item)
+            [radioButtons selectCellAtRow:self.enabled ? 0 : -1 column:0];
+    }
+    else if ([output isKindOfClass:NJOutputMouseMove.class]) {
+        [radioButtons selectCellAtRow:3 column:0];
+        mouseDirSelect.selectedSegment = [(NJOutputMouseMove *)output axis];
+        mouseSpeedSlider.floatValue = [(NJOutputMouseMove *)output speed];
+    }
+    else if ([output isKindOfClass:NJOutputMouseButton.class]) {
+        [radioButtons selectCellAtRow:4 column:0];
+        mouseBtnSelect.selectedSegment = [(NJOutputMouseButton *)output button] == kCGMouseButtonLeft ? 0 : 1;
+    }
+    else if ([output isKindOfClass:NJOutputMouseScroll.class]) {
+        [radioButtons selectCellAtRow:5 column:0];
+        int direction = [(NJOutputMouseScroll *)output direction];
+        float speed = [(NJOutputMouseScroll *)output speed];
+        scrollDirSelect.selectedSegment = (direction > 0) + !speed * 2;
+        scrollSpeedSlider.floatValue = speed;
+    } else {
+        [radioButtons selectCellAtRow:self.enabled ? 0 : -1 column:0];
+    }
+    [self cleanUpInterface];
+}
+
+- (void)loadCurrent {
+    [self loadOutput:self.currentOutput forInput:inputController.selectedInput];
+}
+
+- (void)focusKey {
+    if (radioButtons.selectedRow <= 1)
+        [keyInput.window makeFirstResponder:keyInput];
+    else
+        [keyInput resignIfFirstResponder];
+}
+
+- (void)mappingListDidChange:(NSNotification *)note {
+    NSArray *mappings = note.object;
+    NJMapping *current = mappingPopup.selectedItem.representedObject;
+    [mappingPopup.menu removeAllItems];
+    for (NJMapping *mapping in mappings) {
+        NSMenuItem *item = [[NSMenuItem alloc] initWithTitle:mapping.name
+                                                      action:@selector(mappingChosen:)
+                                               keyEquivalent:@""];
+        item.target = self;
+        item.representedObject = mapping;
+        [mappingPopup.menu addItem:item];
+    }
+    [mappingPopup selectItemWithRepresentedObject:current];
+}
+
+@end
diff --git a/Classes/NJOutputKeyPress.h b/Classes/NJOutputKeyPress.h
new file mode 100644 (file)
index 0000000..052b010
--- /dev/null
@@ -0,0 +1,15 @@
+//
+//  NJOutputKeyPress.h
+//  Enjoy
+//
+//  Created by Sam McCall on 5/05/09.
+//  Copyright 2009 University of Otago. All rights reserved.
+//
+
+#import "NJOutput.h"
+
+@interface NJOutputKeyPress : NJOutput
+
+@property (nonatomic, assign) CGKeyCode vk;
+
+@end
diff --git a/Classes/NJOutputKeyPress.m b/Classes/NJOutputKeyPress.m
new file mode 100644 (file)
index 0000000..622cf41
--- /dev/null
@@ -0,0 +1,43 @@
+//
+//  NJOutputKeyPress.m
+//  Enjoy
+//
+//  Created by Sam McCall on 5/05/09.
+//
+
+#import "NJOutputKeyPress.h"
+
+#import "NJKeyInputField.h"
+
+@implementation NJOutputKeyPress
+
++ (NSString *)serializationCode {
+    return @"key press";
+}
+
+- (NSDictionary *)serialize {
+    return _vk != NJKeyInputFieldEmpty
+        ? @{ @"type": self.class.serializationCode, @"key": @(_vk) }
+        : nil;
+}
+
++ (NJOutput *)outputDeserialize:(NSDictionary *)serialization
+                  withMappings:(NSArray *)mappings {
+    NJOutputKeyPress *output = [[NJOutputKeyPress alloc] init];
+    output.vk = [serialization[@"key"] intValue];
+    return output;
+}
+
+- (void)trigger {
+    CGEventRef keyDown = CGEventCreateKeyboardEvent(NULL, _vk, YES);
+    CGEventPost(kCGHIDEventTap, keyDown);
+    CFRelease(keyDown);
+}
+
+- (void)untrigger {
+    CGEventRef keyUp = CGEventCreateKeyboardEvent(NULL, _vk, NO);
+    CGEventPost(kCGHIDEventTap, keyUp);
+    CFRelease(keyUp);
+}
+
+@end
diff --git a/Classes/NJOutputMapping.h b/Classes/NJOutputMapping.h
new file mode 100644 (file)
index 0000000..e8c3029
--- /dev/null
@@ -0,0 +1,17 @@
+//
+//  NJOutputMapping.h
+//  Enjoy
+//
+//  Created by Sam McCall on 6/05/09.
+//  Copyright 2009 University of Otago. All rights reserved.
+//
+
+#import "NJOutput.h"
+
+@class NJMapping;
+
+@interface NJOutputMapping : NJOutput
+
+@property (nonatomic, weak) NJMapping *mapping;
+
+@end
diff --git a/Classes/NJOutputMapping.m b/Classes/NJOutputMapping.m
new file mode 100644 (file)
index 0000000..fa8fda1
--- /dev/null
@@ -0,0 +1,44 @@
+//
+//  NJOutputMapping.m
+//  Enjoy
+//
+//  Created by Sam McCall on 6/05/09.
+//
+
+#import "NJOutputMapping.h"
+
+#import "EnjoyableApplicationDelegate.h"
+#import "NJMapping.h"
+#import "NJMappingsController.h"
+
+@implementation NJOutputMapping
+
++ (NSString *)serializationCode {
+    return @"mapping";
+}
+
+- (NSDictionary *)serialize {
+    return _mapping
+        ? @{ @"type": self.class.serializationCode, @"name": _mapping.name }
+        : nil;
+}
+
++ (NJOutputMapping *)outputDeserialize:(NSDictionary *)serialization
+                        withMappings:(NSArray *)mappings {
+    NSString *name = serialization[@"name"];
+    NJOutputMapping *output = [[NJOutputMapping alloc] init];
+    for (NJMapping *mapping in mappings) {
+        if ([mapping.name isEqualToString:name]) {
+            output.mapping = mapping;
+            return output;
+        }
+    }
+    return nil;
+}
+
+- (void)trigger {
+    EnjoyableApplicationDelegate *ctrl = (EnjoyableApplicationDelegate *)NSApplication.sharedApplication.delegate;
+    [ctrl.mappingsController activateMapping:_mapping];
+}
+
+@end
diff --git a/Classes/NJOutputMouseButton.h b/Classes/NJOutputMouseButton.h
new file mode 100644 (file)
index 0000000..4d790e5
--- /dev/null
@@ -0,0 +1,14 @@
+//
+//  NJOutputMouseButton.h
+//  Enjoy
+//
+//  Created by Yifeng Huang on 7/27/12.
+//
+
+#import "NJOutput.h"
+
+@interface NJOutputMouseButton : NJOutput
+
+@property (nonatomic, assign) CGMouseButton button;
+
+@end
diff --git a/Classes/NJOutputMouseButton.m b/Classes/NJOutputMouseButton.m
new file mode 100644 (file)
index 0000000..d5b1f16
--- /dev/null
@@ -0,0 +1,51 @@
+//
+//  NJOutputMouseButton.m
+//  Enjoy
+//
+//  Created by Yifeng Huang on 7/27/12.
+//
+
+#import "NJOutputMouseButton.h"
+
+@implementation NJOutputMouseButton
+
++ (NSString *)serializationCode {
+    return @"mouse button";
+}
+
+- (NSDictionary *)serialize {
+    return @{ @"type": self.class.serializationCode, @"button": @(_button) };
+}
+
++ (NJOutput *)outputDeserialize:(NSDictionary *)serialization
+                  withMappings:(NSArray *)mappings {
+    NJOutputMouseButton *output = [[NJOutputMouseButton alloc] init];
+    output.button = [serialization[@"button"] intValue];
+    return output;
+}
+
+- (void)trigger {
+    CGFloat height = NSScreen.mainScreen.frame.size.height;
+    NSPoint mouseLoc = NSEvent.mouseLocation;
+    CGEventType eventType = (_button == kCGMouseButtonLeft) ? kCGEventLeftMouseDown : kCGEventRightMouseDown;
+    CGEventRef click = CGEventCreateMouseEvent(NULL,
+                                               eventType,
+                                               CGPointMake(mouseLoc.x, height - mouseLoc.y),
+                                               _button);
+    CGEventPost(kCGHIDEventTap, click);
+    CFRelease(click);
+}
+
+- (void)untrigger {
+    CGFloat height = NSScreen.mainScreen.frame.size.height;
+    NSPoint mouseLoc = NSEvent.mouseLocation;
+    CGEventType eventType = (_button == kCGMouseButtonLeft) ? kCGEventLeftMouseUp : kCGEventRightMouseUp;
+    CGEventRef click = CGEventCreateMouseEvent(NULL,
+                                               eventType,
+                                               CGPointMake(mouseLoc.x, height - mouseLoc.y),
+                                               _button);
+    CGEventPost(kCGHIDEventTap, click);
+    CFRelease(click);
+}
+
+@end
diff --git a/Classes/NJOutputMouseMove.h b/Classes/NJOutputMouseMove.h
new file mode 100644 (file)
index 0000000..428416f
--- /dev/null
@@ -0,0 +1,15 @@
+//
+//  NJOutputMouseMove.h
+//  Enjoy
+//
+//  Created by Yifeng Huang on 7/26/12.
+//
+
+#import "NJOutput.h"
+
+@interface NJOutputMouseMove : NJOutput
+
+@property (nonatomic, assign) int axis;
+@property (nonatomic, assign) float speed;
+
+@end
diff --git a/Classes/NJOutputMouseMove.m b/Classes/NJOutputMouseMove.m
new file mode 100644 (file)
index 0000000..884a3d3
--- /dev/null
@@ -0,0 +1,76 @@
+//
+//  NJOutputMouseMove.m
+//  Enjoy
+//
+//  Created by Yifeng Huang on 7/26/12.
+//
+
+#import "NJOutputMouseMove.h"
+
+#import "NJDeviceController.h"
+
+@implementation NJOutputMouseMove
+
++ (NSString *)serializationCode {
+    return @"mouse move";
+}
+
+- (NSDictionary *)serialize {
+    return @{ @"type": self.class.serializationCode,
+              @"axis": @(_axis),
+              @"speed": @(_speed),
+              };
+}
+
++ (NJOutput *)outputDeserialize:(NSDictionary *)serialization
+                  withMappings:(NSArray *)mappings {
+    NJOutputMouseMove *output = [[NJOutputMouseMove alloc] init];
+    output.axis = [serialization[@"axis"] intValue];
+    output.speed = [serialization[@"speed"] floatValue];
+    if (!output.speed)
+        output.speed = 4;
+    return output;
+}
+
+- (BOOL)isContinuous {
+    return YES;
+}
+
+- (BOOL)update:(NJDeviceController *)jc {
+    if (self.magnitude < 0.05)
+        return NO; // dead zone
+    
+    CGFloat height = NSScreen.mainScreen.frame.size.height;
+    
+    float dx = 0.f, dy = 0.f;
+    switch (_axis) {
+        case 0:
+            dx = -self.magnitude * _speed;
+            break;
+        case 1:
+            dx = self.magnitude * _speed;
+            break;
+        case 2:
+            dy = -self.magnitude * _speed;
+            break;
+        case 3:
+            dy = self.magnitude * _speed;
+            break;
+    }
+    NSPoint mouseLoc = jc.mouseLoc;
+    mouseLoc.x += dx;
+    mouseLoc.y -= dy;
+    jc.mouseLoc = mouseLoc;
+    
+    CGEventRef move = CGEventCreateMouseEvent(NULL, kCGEventMouseMoved,
+                                              CGPointMake(mouseLoc.x, height - mouseLoc.y),
+                                              0);
+    CGEventSetType(move, kCGEventMouseMoved);
+    CGEventSetIntegerValueField(move, kCGMouseEventDeltaX, (int)dx);
+    CGEventSetIntegerValueField(move, kCGMouseEventDeltaY, (int)dy);
+    CGEventPost(kCGHIDEventTap, move);
+    CFRelease(move);
+    return YES;
+}
+
+@end
diff --git a/Classes/NJOutputMouseScroll.h b/Classes/NJOutputMouseScroll.h
new file mode 100644 (file)
index 0000000..dd0444a
--- /dev/null
@@ -0,0 +1,15 @@
+//
+//  NJOutputMouseScroll.h
+//  Enjoy
+//
+//  Created by Yifeng Huang on 7/28/12.
+//
+
+#import "NJOutput.h"
+
+@interface NJOutputMouseScroll : NJOutput
+
+@property (nonatomic, assign) int direction;
+@property (nonatomic, assign) float speed;
+
+@end
diff --git a/Classes/NJOutputMouseScroll.m b/Classes/NJOutputMouseScroll.m
new file mode 100644 (file)
index 0000000..812685f
--- /dev/null
@@ -0,0 +1,61 @@
+//
+//  NJOutputMouseScroll.m
+//  Enjoy
+//
+//  Created by Yifeng Huang on 7/28/12.
+//
+
+#import "NJOutputMouseScroll.h"
+
+@implementation NJOutputMouseScroll
+
++ (NSString *)serializationCode {
+    return @"mouse scroll";
+}
+
+- (NSDictionary *)serialize {
+    return @{ @"type": self.class.serializationCode,
+              @"direction": @(_direction),
+              @"speed": @(_speed)
+              };
+}
+
++ (NJOutput *)outputDeserialize:(NSDictionary *)serialization
+                  withMappings:(NSArray *)mappings {
+    NJOutputMouseScroll *output = [[NJOutputMouseScroll alloc] init];
+    output.direction = [serialization[@"direction"] intValue];
+    output.speed = [serialization[@"direction"] floatValue];
+    return output;
+}
+
+- (BOOL)isContinuous {
+    return !!self.speed;
+}
+
+- (void)trigger {
+    if (!self.speed) {
+        CGEventRef scroll = CGEventCreateScrollWheelEvent(NULL,
+                                                          kCGScrollEventUnitLine,
+                                                          1,
+                                                          _direction);
+        CGEventPost(kCGHIDEventTap, scroll);
+        CFRelease(scroll);
+    }
+}
+
+- (BOOL)update:(NJDeviceController *)jc {
+    if (self.magnitude < 0.05f)
+        return NO; // dead zone
+    
+    int amount = (int)(_speed * self.magnitude * _direction);
+    CGEventRef scroll = CGEventCreateScrollWheelEvent(NULL,
+                                                      kCGScrollEventUnitPixel,
+                                                      1,
+                                                      amount);
+    CGEventPost(kCGHIDEventTap, scroll);
+    CFRelease(scroll);
+
+    return YES;
+}
+
+@end
diff --git a/English.lproj/InfoPlist.strings b/English.lproj/InfoPlist.strings
deleted file mode 100644 (file)
index 84fe32f..0000000
Binary files a/English.lproj/InfoPlist.strings and /dev/null differ
diff --git a/English.lproj/MainMenu.xib b/English.lproj/MainMenu.xib
deleted file mode 100644 (file)
index cd9a1b9..0000000
+++ /dev/null
@@ -1,3084 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="8.00">
-       <data>
-               <int key="IBDocument.SystemTarget">1080</int>
-               <string key="IBDocument.SystemVersion">12C2034</string>
-               <string key="IBDocument.InterfaceBuilderVersion">3084</string>
-               <string key="IBDocument.AppKitVersion">1187.34</string>
-               <string key="IBDocument.HIToolboxVersion">625.00</string>
-               <object class="NSMutableDictionary" key="IBDocument.PluginVersions">
-                       <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                       <string key="NS.object.0">3084</string>
-               </object>
-               <array key="IBDocument.IntegratedClassDependencies">
-                       <string>NSBox</string>
-                       <string>NSButton</string>
-                       <string>NSButtonCell</string>
-                       <string>NSCustomObject</string>
-                       <string>NSCustomView</string>
-                       <string>NSMatrix</string>
-                       <string>NSMenu</string>
-                       <string>NSMenuItem</string>
-                       <string>NSOutlineView</string>
-                       <string>NSPopUpButton</string>
-                       <string>NSPopUpButtonCell</string>
-                       <string>NSPopover</string>
-                       <string>NSScrollView</string>
-                       <string>NSScroller</string>
-                       <string>NSSegmentedCell</string>
-                       <string>NSSegmentedControl</string>
-                       <string>NSSlider</string>
-                       <string>NSSliderCell</string>
-                       <string>NSSplitView</string>
-                       <string>NSTableColumn</string>
-                       <string>NSTableView</string>
-                       <string>NSTextField</string>
-                       <string>NSTextFieldCell</string>
-                       <string>NSToolbar</string>
-                       <string>NSToolbarFlexibleSpaceItem</string>
-                       <string>NSToolbarItem</string>
-                       <string>NSView</string>
-                       <string>NSViewController</string>
-                       <string>NSWindowTemplate</string>
-               </array>
-               <array key="IBDocument.PluginDependencies">
-                       <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
-               </array>
-               <object class="NSMutableDictionary" key="IBDocument.Metadata">
-                       <string key="NS.key.0">PluginDependencyRecalculationVersion</string>
-                       <integer value="1" key="NS.object.0"/>
-               </object>
-               <array class="NSMutableArray" key="IBDocument.RootObjects" id="1048">
-                       <object class="NSCustomObject" id="1021">
-                               <string key="NSClassName">NSApplication</string>
-                       </object>
-                       <object class="NSCustomObject" id="1014">
-                               <string key="NSClassName">FirstResponder</string>
-                       </object>
-                       <object class="NSCustomObject" id="1050">
-                               <string key="NSClassName">NSApplication</string>
-                       </object>
-                       <object class="NSMenu" id="649796088">
-                               <string key="NSTitle">AMainMenu</string>
-                               <array class="NSMutableArray" key="NSMenuItems">
-                                       <object class="NSMenuItem" id="694149608">
-                                               <reference key="NSMenu" ref="649796088"/>
-                                               <string key="NSTitle">Enjoyable</string>
-                                               <string type="base64-UTF8" key="NSKeyEquiv">CA</string>
-                                               <int key="NSKeyEquivModMask">1048576</int>
-                                               <int key="NSMnemonicLoc">2147483647</int>
-                                               <object class="NSCustomResource" key="NSOnImage" id="35465992">
-                                                       <string key="NSClassName">NSImage</string>
-                                                       <string key="NSResourceName">NSMenuCheckmark</string>
-                                               </object>
-                                               <object class="NSCustomResource" key="NSMixedImage" id="502551668">
-                                                       <string key="NSClassName">NSImage</string>
-                                                       <string key="NSResourceName">NSMenuMixedState</string>
-                                               </object>
-                                               <string key="NSAction">submenuAction:</string>
-                                               <object class="NSMenu" key="NSSubmenu" id="110575045">
-                                                       <string key="NSTitle">Enjoyable</string>
-                                                       <array class="NSMutableArray" key="NSMenuItems">
-                                                               <object class="NSMenuItem" id="238522557">
-                                                                       <reference key="NSMenu" ref="110575045"/>
-                                                                       <string key="NSTitle">About Enjoyable</string>
-                                                                       <string key="NSKeyEquiv"/>
-                                                                       <int key="NSMnemonicLoc">2147483647</int>
-                                                                       <reference key="NSOnImage" ref="35465992"/>
-                                                                       <reference key="NSMixedImage" ref="502551668"/>
-                                                               </object>
-                                                               <object class="NSMenuItem" id="304266470">
-                                                                       <reference key="NSMenu" ref="110575045"/>
-                                                                       <bool key="NSIsDisabled">YES</bool>
-                                                                       <bool key="NSIsSeparator">YES</bool>
-                                                                       <string key="NSTitle"/>
-                                                                       <string key="NSKeyEquiv"/>
-                                                                       <int key="NSKeyEquivModMask">1048576</int>
-                                                                       <int key="NSMnemonicLoc">2147483647</int>
-                                                                       <reference key="NSOnImage" ref="35465992"/>
-                                                                       <reference key="NSMixedImage" ref="502551668"/>
-                                                               </object>
-                                                               <object class="NSMenuItem" id="1046388886">
-                                                                       <reference key="NSMenu" ref="110575045"/>
-                                                                       <string key="NSTitle">Services</string>
-                                                                       <string key="NSKeyEquiv"/>
-                                                                       <int key="NSKeyEquivModMask">1048576</int>
-                                                                       <int key="NSMnemonicLoc">2147483647</int>
-                                                                       <reference key="NSOnImage" ref="35465992"/>
-                                                                       <reference key="NSMixedImage" ref="502551668"/>
-                                                                       <string key="NSAction">submenuAction:</string>
-                                                                       <object class="NSMenu" key="NSSubmenu" id="752062318">
-                                                                               <string key="NSTitle">Services</string>
-                                                                               <array class="NSMutableArray" key="NSMenuItems"/>
-                                                                               <string key="NSName">_NSServicesMenu</string>
-                                                                       </object>
-                                                               </object>
-                                                               <object class="NSMenuItem" id="646227648">
-                                                                       <reference key="NSMenu" ref="110575045"/>
-                                                                       <bool key="NSIsDisabled">YES</bool>
-                                                                       <bool key="NSIsSeparator">YES</bool>
-                                                                       <string key="NSTitle"/>
-                                                                       <string key="NSKeyEquiv"/>
-                                                                       <int key="NSKeyEquivModMask">1048576</int>
-                                                                       <int key="NSMnemonicLoc">2147483647</int>
-                                                                       <reference key="NSOnImage" ref="35465992"/>
-                                                                       <reference key="NSMixedImage" ref="502551668"/>
-                                                               </object>
-                                                               <object class="NSMenuItem" id="755159360">
-                                                                       <reference key="NSMenu" ref="110575045"/>
-                                                                       <string key="NSTitle">Hide Enjoyable</string>
-                                                                       <string key="NSKeyEquiv">h</string>
-                                                                       <int key="NSKeyEquivModMask">1048576</int>
-                                                                       <int key="NSMnemonicLoc">2147483647</int>
-                                                                       <reference key="NSOnImage" ref="35465992"/>
-                                                                       <reference key="NSMixedImage" ref="502551668"/>
-                                                               </object>
-                                                               <object class="NSMenuItem" id="342932134">
-                                                                       <reference key="NSMenu" ref="110575045"/>
-                                                                       <string key="NSTitle">Hide Others</string>
-                                                                       <string key="NSKeyEquiv">h</string>
-                                                                       <int key="NSKeyEquivModMask">1572864</int>
-                                                                       <int key="NSMnemonicLoc">2147483647</int>
-                                                                       <reference key="NSOnImage" ref="35465992"/>
-                                                                       <reference key="NSMixedImage" ref="502551668"/>
-                                                               </object>
-                                                               <object class="NSMenuItem" id="908899353">
-                                                                       <reference key="NSMenu" ref="110575045"/>
-                                                                       <string key="NSTitle">Show All</string>
-                                                                       <string key="NSKeyEquiv"/>
-                                                                       <int key="NSKeyEquivModMask">1048576</int>
-                                                                       <int key="NSMnemonicLoc">2147483647</int>
-                                                                       <reference key="NSOnImage" ref="35465992"/>
-                                                                       <reference key="NSMixedImage" ref="502551668"/>
-                                                               </object>
-                                                               <object class="NSMenuItem" id="1056857174">
-                                                                       <reference key="NSMenu" ref="110575045"/>
-                                                                       <bool key="NSIsDisabled">YES</bool>
-                                                                       <bool key="NSIsSeparator">YES</bool>
-                                                                       <string key="NSTitle"/>
-                                                                       <string key="NSKeyEquiv"/>
-                                                                       <int key="NSKeyEquivModMask">1048576</int>
-                                                                       <int key="NSMnemonicLoc">2147483647</int>
-                                                                       <reference key="NSOnImage" ref="35465992"/>
-                                                                       <reference key="NSMixedImage" ref="502551668"/>
-                                                               </object>
-                                                               <object class="NSMenuItem" id="632727374">
-                                                                       <reference key="NSMenu" ref="110575045"/>
-                                                                       <string key="NSTitle">Quit Enjoyable</string>
-                                                                       <string key="NSKeyEquiv">q</string>
-                                                                       <int key="NSKeyEquivModMask">1048576</int>
-                                                                       <int key="NSMnemonicLoc">2147483647</int>
-                                                                       <reference key="NSOnImage" ref="35465992"/>
-                                                                       <reference key="NSMixedImage" ref="502551668"/>
-                                                               </object>
-                                                       </array>
-                                                       <string key="NSName">_NSAppleMenu</string>
-                                               </object>
-                                       </object>
-                                       <object class="NSMenuItem" id="379814623">
-                                               <reference key="NSMenu" ref="649796088"/>
-                                               <string key="NSTitle">Mappings</string>
-                                               <string key="NSKeyEquiv"/>
-                                               <int key="NSKeyEquivModMask">1048576</int>
-                                               <int key="NSMnemonicLoc">2147483647</int>
-                                               <reference key="NSOnImage" ref="35465992"/>
-                                               <reference key="NSMixedImage" ref="502551668"/>
-                                               <string key="NSAction">submenuAction:</string>
-                                               <object class="NSMenu" key="NSSubmenu" id="720053764">
-                                                       <string key="NSTitle">Mappings</string>
-                                                       <array class="NSMutableArray" key="NSMenuItems">
-                                                               <object class="NSMenuItem" id="632598200">
-                                                                       <reference key="NSMenu" ref="720053764"/>
-                                                                       <string key="NSTitle">Enable</string>
-                                                                       <string key="NSKeyEquiv">r</string>
-                                                                       <int key="NSKeyEquivModMask">1048576</int>
-                                                                       <int key="NSMnemonicLoc">2147483647</int>
-                                                                       <reference key="NSOnImage" ref="35465992"/>
-                                                                       <reference key="NSMixedImage" ref="502551668"/>
-                                                               </object>
-                                                               <object class="NSMenuItem" id="580069611">
-                                                                       <reference key="NSMenu" ref="720053764"/>
-                                                                       <bool key="NSIsDisabled">YES</bool>
-                                                                       <bool key="NSIsSeparator">YES</bool>
-                                                                       <string key="NSTitle"/>
-                                                                       <string key="NSKeyEquiv"/>
-                                                                       <int key="NSMnemonicLoc">2147483647</int>
-                                                                       <reference key="NSOnImage" ref="35465992"/>
-                                                                       <reference key="NSMixedImage" ref="502551668"/>
-                                                               </object>
-                                                               <object class="NSMenuItem" id="914355947">
-                                                                       <reference key="NSMenu" ref="720053764"/>
-                                                                       <string key="NSTitle">List</string>
-                                                                       <string key="NSKeyEquiv">l</string>
-                                                                       <int key="NSKeyEquivModMask">1048576</int>
-                                                                       <int key="NSMnemonicLoc">2147483647</int>
-                                                                       <reference key="NSOnImage" ref="35465992"/>
-                                                                       <reference key="NSMixedImage" ref="502551668"/>
-                                                               </object>
-                                                               <object class="NSMenuItem" id="187155117">
-                                                                       <reference key="NSMenu" ref="720053764"/>
-                                                                       <string key="NSTitle">Import…</string>
-                                                                       <string key="NSKeyEquiv">o</string>
-                                                                       <int key="NSKeyEquivModMask">1048576</int>
-                                                                       <int key="NSMnemonicLoc">2147483647</int>
-                                                                       <reference key="NSOnImage" ref="35465992"/>
-                                                                       <reference key="NSMixedImage" ref="502551668"/>
-                                                               </object>
-                                                               <object class="NSMenuItem" id="888617891">
-                                                                       <reference key="NSMenu" ref="720053764"/>
-                                                                       <string key="NSTitle">Export…</string>
-                                                                       <string key="NSKeyEquiv">s</string>
-                                                                       <int key="NSKeyEquivModMask">1048576</int>
-                                                                       <int key="NSMnemonicLoc">2147483647</int>
-                                                                       <reference key="NSOnImage" ref="35465992"/>
-                                                                       <reference key="NSMixedImage" ref="502551668"/>
-                                                               </object>
-                                                               <object class="NSMenuItem" id="773548144">
-                                                                       <reference key="NSMenu" ref="720053764"/>
-                                                                       <bool key="NSIsDisabled">YES</bool>
-                                                                       <bool key="NSIsSeparator">YES</bool>
-                                                                       <string key="NSTitle"/>
-                                                                       <string key="NSKeyEquiv"/>
-                                                                       <int key="NSMnemonicLoc">2147483647</int>
-                                                                       <reference key="NSOnImage" ref="35465992"/>
-                                                                       <reference key="NSMixedImage" ref="502551668"/>
-                                                                       <int key="NSTag">1</int>
-                                                               </object>
-                                                       </array>
-                                               </object>
-                                       </object>
-                                       <object class="NSMenuItem" id="713487014">
-                                               <reference key="NSMenu" ref="649796088"/>
-                                               <string key="NSTitle">Window</string>
-                                               <string key="NSKeyEquiv"/>
-                                               <int key="NSKeyEquivModMask">1048576</int>
-                                               <int key="NSMnemonicLoc">2147483647</int>
-                                               <reference key="NSOnImage" ref="35465992"/>
-                                               <reference key="NSMixedImage" ref="502551668"/>
-                                               <string key="NSAction">submenuAction:</string>
-                                               <object class="NSMenu" key="NSSubmenu" id="835318025">
-                                                       <string key="NSTitle">Window</string>
-                                                       <array class="NSMutableArray" key="NSMenuItems">
-                                                               <object class="NSMenuItem" id="1011231497">
-                                                                       <reference key="NSMenu" ref="835318025"/>
-                                                                       <string key="NSTitle">Minimize</string>
-                                                                       <string key="NSKeyEquiv">m</string>
-                                                                       <int key="NSKeyEquivModMask">1048576</int>
-                                                                       <int key="NSMnemonicLoc">2147483647</int>
-                                                                       <reference key="NSOnImage" ref="35465992"/>
-                                                                       <reference key="NSMixedImage" ref="502551668"/>
-                                                               </object>
-                                                               <object class="NSMenuItem" id="575023229">
-                                                                       <reference key="NSMenu" ref="835318025"/>
-                                                                       <string key="NSTitle">Zoom</string>
-                                                                       <string key="NSKeyEquiv"/>
-                                                                       <int key="NSKeyEquivModMask">1048576</int>
-                                                                       <int key="NSMnemonicLoc">2147483647</int>
-                                                                       <reference key="NSOnImage" ref="35465992"/>
-                                                                       <reference key="NSMixedImage" ref="502551668"/>
-                                                               </object>
-                                                               <object class="NSMenuItem" id="299356726">
-                                                                       <reference key="NSMenu" ref="835318025"/>
-                                                                       <bool key="NSIsDisabled">YES</bool>
-                                                                       <bool key="NSIsSeparator">YES</bool>
-                                                                       <string key="NSTitle"/>
-                                                                       <string key="NSKeyEquiv"/>
-                                                                       <int key="NSKeyEquivModMask">1048576</int>
-                                                                       <int key="NSMnemonicLoc">2147483647</int>
-                                                                       <reference key="NSOnImage" ref="35465992"/>
-                                                                       <reference key="NSMixedImage" ref="502551668"/>
-                                                               </object>
-                                                               <object class="NSMenuItem" id="625202149">
-                                                                       <reference key="NSMenu" ref="835318025"/>
-                                                                       <string key="NSTitle">Bring All to Front</string>
-                                                                       <string key="NSKeyEquiv"/>
-                                                                       <int key="NSKeyEquivModMask">1048576</int>
-                                                                       <int key="NSMnemonicLoc">2147483647</int>
-                                                                       <reference key="NSOnImage" ref="35465992"/>
-                                                                       <reference key="NSMixedImage" ref="502551668"/>
-                                                               </object>
-                                                       </array>
-                                                       <string key="NSName">_NSWindowsMenu</string>
-                                               </object>
-                                       </object>
-                                       <object class="NSMenuItem" id="693056251">
-                                               <reference key="NSMenu" ref="649796088"/>
-                                               <string key="NSTitle">Help</string>
-                                               <string key="NSKeyEquiv"/>
-                                               <int key="NSMnemonicLoc">2147483647</int>
-                                               <reference key="NSOnImage" ref="35465992"/>
-                                               <reference key="NSMixedImage" ref="502551668"/>
-                                               <string key="NSAction">submenuAction:</string>
-                                               <object class="NSMenu" key="NSSubmenu" id="997802319">
-                                                       <string key="NSTitle">Help</string>
-                                                       <array class="NSMutableArray" key="NSMenuItems">
-                                                               <object class="NSMenuItem" id="842970531">
-                                                                       <reference key="NSMenu" ref="997802319"/>
-                                                                       <string key="NSTitle">Enjoyable Help</string>
-                                                                       <string key="NSKeyEquiv">?</string>
-                                                                       <int key="NSKeyEquivModMask">1048576</int>
-                                                                       <int key="NSMnemonicLoc">2147483647</int>
-                                                                       <reference key="NSOnImage" ref="35465992"/>
-                                                                       <reference key="NSMixedImage" ref="502551668"/>
-                                                               </object>
-                                                       </array>
-                                                       <string key="NSName">_NSHelpMenu</string>
-                                               </object>
-                                       </object>
-                               </array>
-                               <string key="NSName">_NSMainMenu</string>
-                       </object>
-                       <object class="NSWindowTemplate" id="808667431">
-                               <int key="NSWindowStyleMask">15</int>
-                               <int key="NSWindowBacking">2</int>
-                               <string key="NSWindowRect">{{355, 59}, {640, 320}}</string>
-                               <int key="NSWTFlags">1685585920</int>
-                               <string key="NSWindowTitle">Enjoyable</string>
-                               <string key="NSWindowClass">NSWindow</string>
-                               <object class="NSToolbar" key="NSViewClass" id="1043384830">
-                                       <object class="NSMutableString" key="NSToolbarIdentifier">
-                                               <characters key="NS.bytes">AC1F5C48-4C16-4C9D-9779-B783AF35E2E1</characters>
-                                       </object>
-                                       <nil key="NSToolbarDelegate"/>
-                                       <bool key="NSToolbarPrefersToBeShown">YES</bool>
-                                       <bool key="NSToolbarShowsBaselineSeparator">YES</bool>
-                                       <bool key="NSToolbarAllowsUserCustomization">NO</bool>
-                                       <bool key="NSToolbarAutosavesConfiguration">YES</bool>
-                                       <int key="NSToolbarDisplayMode">2</int>
-                                       <int key="NSToolbarSizeMode">1</int>
-                                       <dictionary class="NSMutableDictionary" key="NSToolbarIBIdentifiedItems">
-                                               <object class="NSToolbarItem" key="2CB21E35-9CF1-4C67-9670-31139C914D10" id="985167622">
-                                                       <object class="NSMutableString" key="NSToolbarItemIdentifier">
-                                                               <characters key="NS.bytes">2CB21E35-9CF1-4C67-9670-31139C914D10</characters>
-                                                       </object>
-                                                       <string key="NSToolbarItemLabel">Enabled</string>
-                                                       <string key="NSToolbarItemPaletteLabel">Enabled</string>
-                                                       <nil key="NSToolbarItemToolTip"/>
-                                                       <object class="NSButton" key="NSToolbarItemView" id="385218002">
-                                                               <nil key="NSNextResponder"/>
-                                                               <int key="NSvFlags">268</int>
-                                                               <string key="NSFrame">{{7, 14}, {36, 25}}</string>
-                                                               <string key="NSReuseIdentifierKey">_NS:9</string>
-                                                               <bool key="NSEnabled">YES</bool>
-                                                               <object class="NSButtonCell" key="NSCell" id="422366518">
-                                                                       <int key="NSCellFlags">67108864</int>
-                                                                       <int key="NSCellFlags2">134217728</int>
-                                                                       <string key="NSContents"/>
-                                                                       <object class="NSFont" key="NSSupport" id="45863614">
-                                                                               <string key="NSName">LucidaGrande</string>
-                                                                               <double key="NSSize">13</double>
-                                                                               <int key="NSfFlags">1044</int>
-                                                                       </object>
-                                                                       <string key="NSCellIdentifier">_NS:9</string>
-                                                                       <reference key="NSControlView" ref="385218002"/>
-                                                                       <int key="NSButtonFlags">-1228128256</int>
-                                                                       <int key="NSButtonFlags2">163</int>
-                                                                       <object class="NSCustomResource" key="NSNormalImage" id="80448349">
-                                                                               <string key="NSClassName">NSImage</string>
-                                                                               <string key="NSResourceName">NSRightFacingTriangleTemplate</string>
-                                                                       </object>
-                                                                       <string key="NSAlternateContents"/>
-                                                                       <string key="NSKeyEquivalent"/>
-                                                                       <int key="NSPeriodicDelay">200</int>
-                                                                       <int key="NSPeriodicInterval">25</int>
-                                                               </object>
-                                                               <bool key="NSAllowsLogicalLayoutDirection">NO</bool>
-                                                       </object>
-                                                       <reference key="NSToolbarItemImage" ref="80448349"/>
-                                                       <nil key="NSToolbarItemTarget"/>
-                                                       <nil key="NSToolbarItemAction"/>
-                                                       <string key="NSToolbarItemMinSize">{36, 25}</string>
-                                                       <string key="NSToolbarItemMaxSize">{36, 25}</string>
-                                                       <bool key="NSToolbarItemEnabled">YES</bool>
-                                                       <bool key="NSToolbarItemAutovalidates">YES</bool>
-                                                       <int key="NSToolbarItemTag">0</int>
-                                                       <bool key="NSToolbarIsUserRemovable">YES</bool>
-                                                       <int key="NSToolbarItemVisibilityPriority">0</int>
-                                               </object>
-                                               <object class="NSToolbarItem" key="4AC66688-76E8-47ED-AC0A-7462220A4019" id="496378711">
-                                                       <object class="NSMutableString" key="NSToolbarItemIdentifier">
-                                                               <characters key="NS.bytes">4AC66688-76E8-47ED-AC0A-7462220A4019</characters>
-                                                       </object>
-                                                       <string key="NSToolbarItemLabel">Mapping Selector</string>
-                                                       <string key="NSToolbarItemPaletteLabel">Mapping Selector</string>
-                                                       <nil key="NSToolbarItemToolTip"/>
-                                                       <object class="NSButton" key="NSToolbarItemView" id="227597319">
-                                                               <nil key="NSNextResponder"/>
-                                                               <int key="NSvFlags">268</int>
-                                                               <string key="NSFrame">{{0, 14}, {140, 25}}</string>
-                                                               <string key="NSReuseIdentifierKey">_NS:9</string>
-                                                               <bool key="NSEnabled">YES</bool>
-                                                               <object class="NSButtonCell" key="NSCell" id="850080795">
-                                                                       <int key="NSCellFlags">67108864</int>
-                                                                       <int key="NSCellFlags2">134217728</int>
-                                                                       <string key="NSContents">(default)</string>
-                                                                       <reference key="NSSupport" ref="45863614"/>
-                                                                       <string key="NSCellIdentifier">_NS:9</string>
-                                                                       <reference key="NSControlView" ref="227597319"/>
-                                                                       <int key="NSButtonFlags">918306816</int>
-                                                                       <int key="NSButtonFlags2">163</int>
-                                                                       <object class="NSCustomResource" key="NSNormalImage" id="13197350">
-                                                                               <string key="NSClassName">NSImage</string>
-                                                                               <string key="NSResourceName">NSListViewTemplate</string>
-                                                                       </object>
-                                                                       <string key="NSAlternateContents"/>
-                                                                       <string key="NSKeyEquivalent"/>
-                                                                       <int key="NSPeriodicDelay">400</int>
-                                                                       <int key="NSPeriodicInterval">75</int>
-                                                               </object>
-                                                               <bool key="NSAllowsLogicalLayoutDirection">NO</bool>
-                                                       </object>
-                                                       <reference key="NSToolbarItemImage" ref="13197350"/>
-                                                       <nil key="NSToolbarItemTarget"/>
-                                                       <nil key="NSToolbarItemAction"/>
-                                                       <string key="NSToolbarItemMinSize">{13, 25}</string>
-                                                       <string key="NSToolbarItemMaxSize">{141, 25}</string>
-                                                       <bool key="NSToolbarItemEnabled">YES</bool>
-                                                       <bool key="NSToolbarItemAutovalidates">NO</bool>
-                                                       <int key="NSToolbarItemTag">0</int>
-                                                       <bool key="NSToolbarIsUserRemovable">YES</bool>
-                                                       <int key="NSToolbarItemVisibilityPriority">0</int>
-                                               </object>
-                                               <object class="NSToolbarFlexibleSpaceItem" key="NSToolbarFlexibleSpaceItem" id="658903347">
-                                                       <string key="NSToolbarItemIdentifier">NSToolbarFlexibleSpaceItem</string>
-                                                       <string key="NSToolbarItemLabel"/>
-                                                       <string key="NSToolbarItemPaletteLabel">Flexible Space</string>
-                                                       <nil key="NSToolbarItemToolTip"/>
-                                                       <nil key="NSToolbarItemView"/>
-                                                       <nil key="NSToolbarItemImage"/>
-                                                       <nil key="NSToolbarItemTarget"/>
-                                                       <nil key="NSToolbarItemAction"/>
-                                                       <string key="NSToolbarItemMinSize">{1, 5}</string>
-                                                       <string key="NSToolbarItemMaxSize">{20000, 32}</string>
-                                                       <bool key="NSToolbarItemEnabled">YES</bool>
-                                                       <bool key="NSToolbarItemAutovalidates">YES</bool>
-                                                       <int key="NSToolbarItemTag">-1</int>
-                                                       <bool key="NSToolbarIsUserRemovable">YES</bool>
-                                                       <int key="NSToolbarItemVisibilityPriority">0</int>
-                                                       <object class="NSMenuItem" key="NSToolbarItemMenuFormRepresentation">
-                                                               <bool key="NSIsDisabled">YES</bool>
-                                                               <bool key="NSIsSeparator">YES</bool>
-                                                               <string key="NSTitle"/>
-                                                               <string key="NSKeyEquiv"/>
-                                                               <int key="NSKeyEquivModMask">1048576</int>
-                                                               <int key="NSMnemonicLoc">2147483647</int>
-                                                               <reference key="NSOnImage" ref="35465992"/>
-                                                               <reference key="NSMixedImage" ref="502551668"/>
-                                                       </object>
-                                               </object>
-                                       </dictionary>
-                                       <array key="NSToolbarIBAllowedItems">
-                                               <reference ref="496378711"/>
-                                               <reference ref="658903347"/>
-                                               <reference ref="985167622"/>
-                                       </array>
-                                       <array key="NSToolbarIBDefaultItems">
-                                               <reference ref="496378711"/>
-                                               <reference ref="658903347"/>
-                                               <reference ref="985167622"/>
-                                       </array>
-                                       <array key="NSToolbarIBSelectableItems" id="0"/>
-                               </object>
-                               <nil key="NSUserInterfaceItemIdentifier"/>
-                               <string key="NSWindowContentMinSize">{640, 320}</string>
-                               <object class="NSView" key="NSWindowView" id="177223957">
-                                       <reference key="NSNextResponder"/>
-                                       <int key="NSvFlags">256</int>
-                                       <array class="NSMutableArray" key="NSSubviews">
-                                               <object class="NSSplitView" id="206489479">
-                                                       <reference key="NSNextResponder" ref="177223957"/>
-                                                       <int key="NSvFlags">274</int>
-                                                       <array class="NSMutableArray" key="NSSubviews">
-                                                               <object class="NSCustomView" id="977242492">
-                                                                       <reference key="NSNextResponder" ref="206489479"/>
-                                                                       <int key="NSvFlags">256</int>
-                                                                       <array class="NSMutableArray" key="NSSubviews">
-                                                                               <object class="NSScrollView" id="364857164">
-                                                                                       <reference key="NSNextResponder" ref="977242492"/>
-                                                                                       <int key="NSvFlags">274</int>
-                                                                                       <array class="NSMutableArray" key="NSSubviews">
-                                                                                               <object class="NSClipView" id="698362889">
-                                                                                                       <reference key="NSNextResponder" ref="364857164"/>
-                                                                                                       <int key="NSvFlags">2304</int>
-                                                                                                       <array class="NSMutableArray" key="NSSubviews">
-                                                                                                               <object class="NSOutlineView" id="365506042">
-                                                                                                                       <reference key="NSNextResponder" ref="698362889"/>
-                                                                                                                       <int key="NSvFlags">256</int>
-                                                                                                                       <string key="NSFrameSize">{200, 318}</string>
-                                                                                                                       <reference key="NSSuperview" ref="698362889"/>
-                                                                                                                       <reference key="NSWindow"/>
-                                                                                                                       <reference key="NSNextKeyView" ref="1036252745"/>
-                                                                                                                       <bool key="NSEnabled">YES</bool>
-                                                                                                                       <bool key="NSAllowsLogicalLayoutDirection">NO</bool>
-                                                                                                                       <bool key="NSControlAllowsExpansionToolTips">YES</bool>
-                                                                                                                       <object class="_NSCornerView" key="NSCornerView">
-                                                                                                                               <nil key="NSNextResponder"/>
-                                                                                                                               <int key="NSvFlags">256</int>
-                                                                                                                               <string key="NSFrame">{{474, 0}, {16, 17}}</string>
-                                                                                                                       </object>
-                                                                                                                       <array class="NSMutableArray" key="NSTableColumns">
-                                                                                                                               <object class="NSTableColumn" id="290995057">
-                                                                                                                                       <double key="NSWidth">197</double>
-                                                                                                                                       <double key="NSMinWidth">16</double>
-                                                                                                                                       <double key="NSMaxWidth">1000</double>
-                                                                                                                                       <object class="NSTableHeaderCell" key="NSHeaderCell">
-                                                                                                                                               <int key="NSCellFlags">75497536</int>
-                                                                                                                                               <int key="NSCellFlags2">2048</int>
-                                                                                                                                               <string key="NSContents"/>
-                                                                                                                                               <object class="NSFont" key="NSSupport" id="26">
-                                                                                                                                                       <string key="NSName">LucidaGrande</string>
-                                                                                                                                                       <double key="NSSize">11</double>
-                                                                                                                                                       <int key="NSfFlags">3100</int>
-                                                                                                                                               </object>
-                                                                                                                                               <object class="NSColor" key="NSBackgroundColor">
-                                                                                                                                                       <int key="NSColorSpace">3</int>
-                                                                                                                                                       <bytes key="NSWhite">MC4zMzMzMzI5OQA</bytes>
-                                                                                                                                               </object>
-                                                                                                                                               <object class="NSColor" key="NSTextColor" id="809574366">
-                                                                                                                                                       <int key="NSColorSpace">6</int>
-                                                                                                                                                       <string key="NSCatalogName">System</string>
-                                                                                                                                                       <string key="NSColorName">headerTextColor</string>
-                                                                                                                                                       <object class="NSColor" key="NSColor" id="838935852">
-                                                                                                                                                               <int key="NSColorSpace">3</int>
-                                                                                                                                                               <bytes key="NSWhite">MAA</bytes>
-                                                                                                                                                       </object>
-                                                                                                                                               </object>
-                                                                                                                                       </object>
-                                                                                                                                       <object class="NSTextFieldCell" key="NSDataCell" id="158646067">
-                                                                                                                                               <int key="NSCellFlags">67108928</int>
-                                                                                                                                               <int key="NSCellFlags2">2624</int>
-                                                                                                                                               <string key="NSContents">Text Cell</string>
-                                                                                                                                               <reference key="NSSupport" ref="45863614"/>
-                                                                                                                                               <reference key="NSControlView" ref="365506042"/>
-                                                                                                                                               <object class="NSColor" key="NSBackgroundColor" id="834857663">
-                                                                                                                                                       <int key="NSColorSpace">6</int>
-                                                                                                                                                       <string key="NSCatalogName">System</string>
-                                                                                                                                                       <string key="NSColorName">controlBackgroundColor</string>
-                                                                                                                                                       <object class="NSColor" key="NSColor" id="783809746">
-                                                                                                                                                               <int key="NSColorSpace">3</int>
-                                                                                                                                                               <bytes key="NSWhite">MC42NjY2NjY2NjY3AA</bytes>
-                                                                                                                                                       </object>
-                                                                                                                                               </object>
-                                                                                                                                               <object class="NSColor" key="NSTextColor" id="813255721">
-                                                                                                                                                       <int key="NSColorSpace">6</int>
-                                                                                                                                                       <string key="NSCatalogName">System</string>
-                                                                                                                                                       <string key="NSColorName">controlTextColor</string>
-                                                                                                                                                       <reference key="NSColor" ref="838935852"/>
-                                                                                                                                               </object>
-                                                                                                                                       </object>
-                                                                                                                                       <int key="NSResizingMask">1</int>
-                                                                                                                                       <bool key="NSIsResizeable">YES</bool>
-                                                                                                                                       <reference key="NSTableView" ref="365506042"/>
-                                                                                                                               </object>
-                                                                                                                       </array>
-                                                                                                                       <double key="NSIntercellSpacingWidth">3</double>
-                                                                                                                       <double key="NSIntercellSpacingHeight">2</double>
-                                                                                                                       <object class="NSColor" key="NSBackgroundColor" id="214000480">
-                                                                                                                               <int key="NSColorSpace">3</int>
-                                                                                                                               <bytes key="NSWhite">MQA</bytes>
-                                                                                                                       </object>
-                                                                                                                       <object class="NSColor" key="NSGridColor" id="133906332">
-                                                                                                                               <int key="NSColorSpace">6</int>
-                                                                                                                               <string key="NSCatalogName">System</string>
-                                                                                                                               <string key="NSColorName">gridColor</string>
-                                                                                                                               <object class="NSColor" key="NSColor">
-                                                                                                                                       <int key="NSColorSpace">3</int>
-                                                                                                                                       <bytes key="NSWhite">MC41AA</bytes>
-                                                                                                                               </object>
-                                                                                                                       </object>
-                                                                                                                       <double key="NSRowHeight">20</double>
-                                                                                                                       <int key="NSTvFlags">306184192</int>
-                                                                                                                       <reference key="NSDelegate"/>
-                                                                                                                       <reference key="NSDataSource"/>
-                                                                                                                       <int key="NSColumnAutoresizingStyle">4</int>
-                                                                                                                       <int key="NSDraggingSourceMaskForLocal">15</int>
-                                                                                                                       <int key="NSDraggingSourceMaskForNonLocal">0</int>
-                                                                                                                       <bool key="NSAllowsTypeSelect">YES</bool>
-                                                                                                                       <int key="NSTableViewDraggingDestinationStyle">0</int>
-                                                                                                                       <int key="NSTableViewGroupRowStyle">1</int>
-                                                                                                                       <int key="NSTableViewRowSizeStyle">-1</int>
-                                                                                                                       <bool key="NSOutlineViewAutoresizesOutlineColumnKey">NO</bool>
-                                                                                                               </object>
-                                                                                                       </array>
-                                                                                                       <string key="NSFrame">{{1, 1}, {200, 318}}</string>
-                                                                                                       <reference key="NSSuperview" ref="364857164"/>
-                                                                                                       <reference key="NSWindow"/>
-                                                                                                       <reference key="NSNextKeyView" ref="365506042"/>
-                                                                                                       <reference key="NSDocView" ref="365506042"/>
-                                                                                                       <reference key="NSBGColor" ref="834857663"/>
-                                                                                                       <int key="NScvFlags">4</int>
-                                                                                               </object>
-                                                                                               <object class="NSScroller" id="1036252745">
-                                                                                                       <reference key="NSNextResponder" ref="364857164"/>
-                                                                                                       <int key="NSvFlags">-2147483392</int>
-                                                                                                       <string key="NSFrame">{{1, 1}, {8, 298}}</string>
-                                                                                                       <reference key="NSSuperview" ref="364857164"/>
-                                                                                                       <reference key="NSWindow"/>
-                                                                                                       <reference key="NSNextKeyView" ref="606740242"/>
-                                                                                                       <bool key="NSAllowsLogicalLayoutDirection">NO</bool>
-                                                                                                       <reference key="NSTarget" ref="364857164"/>
-                                                                                                       <string key="NSAction">_doScroller:</string>
-                                                                                                       <double key="NSPercent">0.4210526</double>
-                                                                                               </object>
-                                                                                               <object class="NSScroller" id="892486973">
-                                                                                                       <reference key="NSNextResponder" ref="364857164"/>
-                                                                                                       <int key="NSvFlags">-2147483392</int>
-                                                                                                       <string key="NSFrame">{{-100, -100}, {473, 15}}</string>
-                                                                                                       <reference key="NSSuperview" ref="364857164"/>
-                                                                                                       <reference key="NSWindow"/>
-                                                                                                       <reference key="NSNextKeyView" ref="698362889"/>
-                                                                                                       <bool key="NSAllowsLogicalLayoutDirection">NO</bool>
-                                                                                                       <int key="NSsFlags">1</int>
-                                                                                                       <reference key="NSTarget" ref="364857164"/>
-                                                                                                       <string key="NSAction">_doScroller:</string>
-                                                                                                       <double key="NSPercent">0.99789030000000001</double>
-                                                                                               </object>
-                                                                                       </array>
-                                                                                       <string key="NSFrameSize">{202, 320}</string>
-                                                                                       <reference key="NSSuperview" ref="977242492"/>
-                                                                                       <reference key="NSWindow"/>
-                                                                                       <reference key="NSNextKeyView" ref="892486973"/>
-                                                                                       <int key="NSsFlags">150034</int>
-                                                                                       <reference key="NSVScroller" ref="1036252745"/>
-                                                                                       <reference key="NSHScroller" ref="892486973"/>
-                                                                                       <reference key="NSContentView" ref="698362889"/>
-                                                                                       <bytes key="NSScrollAmts">QSAAAEEgAABBsAAAQbAAAA</bytes>
-                                                                                       <double key="NSMinMagnification">0.25</double>
-                                                                                       <double key="NSMaxMagnification">4</double>
-                                                                                       <double key="NSMagnification">1</double>
-                                                                               </object>
-                                                                       </array>
-                                                                       <string key="NSFrameSize">{202, 320}</string>
-                                                                       <reference key="NSSuperview" ref="206489479"/>
-                                                                       <reference key="NSWindow"/>
-                                                                       <reference key="NSNextKeyView" ref="364857164"/>
-                                                                       <string key="NSClassName">NSView</string>
-                                                               </object>
-                                                               <object class="NSCustomView" id="606740242">
-                                                                       <reference key="NSNextResponder" ref="206489479"/>
-                                                                       <int key="NSvFlags">256</int>
-                                                                       <array class="NSMutableArray" key="NSSubviews">
-                                                                               <object class="NSSlider" id="792189805">
-                                                                                       <reference key="NSNextResponder" ref="606740242"/>
-                                                                                       <int key="NSvFlags">265</int>
-                                                                                       <string key="NSFrame">{{228, 21}, {130, 12}}</string>
-                                                                                       <reference key="NSSuperview" ref="606740242"/>
-                                                                                       <reference key="NSWindow"/>
-                                                                                       <reference key="NSNextKeyView"/>
-                                                                                       <string key="NSReuseIdentifierKey">_NS:9</string>
-                                                                                       <bool key="NSEnabled">YES</bool>
-                                                                                       <object class="NSSliderCell" key="NSCell" id="423057230">
-                                                                                               <int key="NSCellFlags">-2080374784</int>
-                                                                                               <int key="NSCellFlags2">262144</int>
-                                                                                               <string key="NSContents"/>
-                                                                                               <string key="NSCellIdentifier">_NS:9</string>
-                                                                                               <reference key="NSControlView" ref="792189805"/>
-                                                                                               <double key="NSMaxValue">30</double>
-                                                                                               <double key="NSMinValue">0.0</double>
-                                                                                               <double key="NSValue">15</double>
-                                                                                               <double key="NSAltIncValue">0.0</double>
-                                                                                               <int key="NSNumberOfTickMarks">0</int>
-                                                                                               <int key="NSTickMarkPosition">1</int>
-                                                                                               <bool key="NSAllowsTickMarkValuesOnly">NO</bool>
-                                                                                               <bool key="NSVertical">NO</bool>
-                                                                                       </object>
-                                                                                       <bool key="NSAllowsLogicalLayoutDirection">NO</bool>
-                                                                               </object>
-                                                                               <object class="NSSlider" id="385416822">
-                                                                                       <reference key="NSNextResponder" ref="606740242"/>
-                                                                                       <int key="NSvFlags">265</int>
-                                                                                       <string key="NSFrame">{{228, 107}, {176, 12}}</string>
-                                                                                       <reference key="NSSuperview" ref="606740242"/>
-                                                                                       <reference key="NSWindow"/>
-                                                                                       <reference key="NSNextKeyView" ref="125828224"/>
-                                                                                       <string key="NSReuseIdentifierKey">_NS:9</string>
-                                                                                       <bool key="NSEnabled">YES</bool>
-                                                                                       <object class="NSSliderCell" key="NSCell" id="5417367">
-                                                                                               <int key="NSCellFlags">-2080374784</int>
-                                                                                               <int key="NSCellFlags2">262144</int>
-                                                                                               <string key="NSContents"/>
-                                                                                               <string key="NSCellIdentifier">_NS:9</string>
-                                                                                               <reference key="NSControlView" ref="385416822"/>
-                                                                                               <double key="NSMaxValue">20</double>
-                                                                                               <double key="NSMinValue">0.0</double>
-                                                                                               <double key="NSValue">4</double>
-                                                                                               <double key="NSAltIncValue">0.0</double>
-                                                                                               <int key="NSNumberOfTickMarks">0</int>
-                                                                                               <int key="NSTickMarkPosition">1</int>
-                                                                                               <bool key="NSAllowsTickMarkValuesOnly">NO</bool>
-                                                                                               <bool key="NSVertical">NO</bool>
-                                                                                       </object>
-                                                                                       <bool key="NSAllowsLogicalLayoutDirection">NO</bool>
-                                                                               </object>
-                                                                               <object class="NSSegmentedControl" id="875916470">
-                                                                                       <reference key="NSNextResponder" ref="606740242"/>
-                                                                                       <int key="NSvFlags">265</int>
-                                                                                       <string key="NSFrame">{{226, 117}, {180, 20}}</string>
-                                                                                       <reference key="NSSuperview" ref="606740242"/>
-                                                                                       <reference key="NSWindow"/>
-                                                                                       <reference key="NSNextKeyView" ref="385416822"/>
-                                                                                       <string key="NSReuseIdentifierKey">_NS:9</string>
-                                                                                       <bool key="NSEnabled">YES</bool>
-                                                                                       <object class="NSSegmentedCell" key="NSCell" id="241270212">
-                                                                                               <int key="NSCellFlags">67108864</int>
-                                                                                               <int key="NSCellFlags2">131072</int>
-                                                                                               <reference key="NSSupport" ref="26"/>
-                                                                                               <string key="NSCellIdentifier">_NS:9</string>
-                                                                                               <reference key="NSControlView" ref="875916470"/>
-                                                                                               <array class="NSMutableArray" key="NSSegmentImages">
-                                                                                                       <object class="NSSegmentItem">
-                                                                                                               <double key="NSSegmentItemWidth">44</double>
-                                                                                                               <string key="NSSegmentItemLabel">←</string>
-                                                                                                               <bool key="NSSegmentItemSelected">YES</bool>
-                                                                                                               <int key="NSSegmentItemImageScaling">0</int>
-                                                                                                       </object>
-                                                                                                       <object class="NSSegmentItem">
-                                                                                                               <double key="NSSegmentItemWidth">44</double>
-                                                                                                               <string key="NSSegmentItemLabel">→</string>
-                                                                                                               <int key="NSSegmentItemTag">1</int>
-                                                                                                               <int key="NSSegmentItemImageScaling">0</int>
-                                                                                                       </object>
-                                                                                                       <object class="NSSegmentItem">
-                                                                                                               <double key="NSSegmentItemWidth">42</double>
-                                                                                                               <string key="NSSegmentItemLabel">↑</string>
-                                                                                                               <int key="NSSegmentItemImageScaling">0</int>
-                                                                                                       </object>
-                                                                                                       <object class="NSSegmentItem">
-                                                                                                               <double key="NSSegmentItemWidth">41</double>
-                                                                                                               <string key="NSSegmentItemLabel">↓</string>
-                                                                                                               <int key="NSSegmentItemImageScaling">0</int>
-                                                                                                       </object>
-                                                                                               </array>
-                                                                                               <int key="NSSegmentStyle">1</int>
-                                                                                       </object>
-                                                                                       <bool key="NSAllowsLogicalLayoutDirection">NO</bool>
-                                                                               </object>
-                                                                               <object class="NSSegmentedControl" id="921829691">
-                                                                                       <reference key="NSNextResponder" ref="606740242"/>
-                                                                                       <int key="NSvFlags">265</int>
-                                                                                       <string key="NSFrame">{{226, 31}, {180, 20}}</string>
-                                                                                       <reference key="NSSuperview" ref="606740242"/>
-                                                                                       <reference key="NSWindow"/>
-                                                                                       <reference key="NSNextKeyView" ref="792189805"/>
-                                                                                       <string key="NSReuseIdentifierKey">_NS:9</string>
-                                                                                       <bool key="NSEnabled">YES</bool>
-                                                                                       <object class="NSSegmentedCell" key="NSCell" id="301345285">
-                                                                                               <int key="NSCellFlags">67108864</int>
-                                                                                               <int key="NSCellFlags2">131072</int>
-                                                                                               <reference key="NSSupport" ref="26"/>
-                                                                                               <string key="NSCellIdentifier">_NS:9</string>
-                                                                                               <reference key="NSControlView" ref="921829691"/>
-                                                                                               <array class="NSMutableArray" key="NSSegmentImages">
-                                                                                                       <object class="NSSegmentItem">
-                                                                                                               <double key="NSSegmentItemWidth">64</double>
-                                                                                                               <string key="NSSegmentItemLabel">↑</string>
-                                                                                                               <string key="NSSegmentItemTooltip">Scroll up continuously</string>
-                                                                                                               <bool key="NSSegmentItemSelected">YES</bool>
-                                                                                                               <int key="NSSegmentItemImageScaling">0</int>
-                                                                                                       </object>
-                                                                                                       <object class="NSSegmentItem">
-                                                                                                               <double key="NSSegmentItemWidth">63</double>
-                                                                                                               <string key="NSSegmentItemLabel">↓</string>
-                                                                                                               <string key="NSSegmentItemTooltip">Scroll down continuously</string>
-                                                                                                               <int key="NSSegmentItemTag">1</int>
-                                                                                                               <int key="NSSegmentItemImageScaling">0</int>
-                                                                                                       </object>
-                                                                                                       <object class="NSSegmentItem">
-                                                                                                               <string key="NSSegmentItemLabel">⤒</string>
-                                                                                                               <string key="NSSegmentItemTooltip">Scroll up one step</string>
-                                                                                                               <int key="NSSegmentItemImageScaling">0</int>
-                                                                                                       </object>
-                                                                                                       <object class="NSSegmentItem">
-                                                                                                               <string key="NSSegmentItemLabel">⤓</string>
-                                                                                                               <string key="NSSegmentItemTooltip">Scroll down one step</string>
-                                                                                                               <int key="NSSegmentItemImageScaling">0</int>
-                                                                                                       </object>
-                                                                                               </array>
-                                                                                               <int key="NSSegmentStyle">1</int>
-                                                                                       </object>
-                                                                                       <bool key="NSAllowsLogicalLayoutDirection">NO</bool>
-                                                                               </object>
-                                                                               <object class="NSSegmentedControl" id="125828224">
-                                                                                       <reference key="NSNextResponder" ref="606740242"/>
-                                                                                       <int key="NSvFlags">265</int>
-                                                                                       <string key="NSFrame">{{226, 67}, {180, 24}}</string>
-                                                                                       <reference key="NSSuperview" ref="606740242"/>
-                                                                                       <reference key="NSWindow"/>
-                                                                                       <reference key="NSNextKeyView" ref="921829691"/>
-                                                                                       <string key="NSReuseIdentifierKey">_NS:9</string>
-                                                                                       <bool key="NSEnabled">YES</bool>
-                                                                                       <object class="NSSegmentedCell" key="NSCell" id="514491330">
-                                                                                               <int key="NSCellFlags">67108864</int>
-                                                                                               <int key="NSCellFlags2">0</int>
-                                                                                               <object class="NSFont" key="NSSupport">
-                                                                                                       <string key="NSName">LucidaGrande</string>
-                                                                                                       <double key="NSSize">13</double>
-                                                                                                       <int key="NSfFlags">16</int>
-                                                                                               </object>
-                                                                                               <string key="NSCellIdentifier">_NS:9</string>
-                                                                                               <reference key="NSControlView" ref="125828224"/>
-                                                                                               <array class="NSMutableArray" key="NSSegmentImages">
-                                                                                                       <object class="NSSegmentItem">
-                                                                                                               <double key="NSSegmentItemWidth">87</double>
-                                                                                                               <string key="NSSegmentItemLabel">Left</string>
-                                                                                                               <bool key="NSSegmentItemSelected">YES</bool>
-                                                                                                               <int key="NSSegmentItemImageScaling">0</int>
-                                                                                                       </object>
-                                                                                                       <object class="NSSegmentItem">
-                                                                                                               <double key="NSSegmentItemWidth">86</double>
-                                                                                                               <string key="NSSegmentItemLabel">Right</string>
-                                                                                                               <int key="NSSegmentItemTag">1</int>
-                                                                                                               <int key="NSSegmentItemImageScaling">0</int>
-                                                                                                       </object>
-                                                                                               </array>
-                                                                                               <int key="NSSegmentStyle">1</int>
-                                                                                       </object>
-                                                                                       <bool key="NSAllowsLogicalLayoutDirection">NO</bool>
-                                                                               </object>
-                                                                               <object class="NSCustomView" id="57697638">
-                                                                                       <reference key="NSNextResponder" ref="606740242"/>
-                                                                                       <int key="NSvFlags">265</int>
-                                                                                       <string key="NSFrame">{{228, 197}, {176, 24}}</string>
-                                                                                       <reference key="NSSuperview" ref="606740242"/>
-                                                                                       <reference key="NSWindow"/>
-                                                                                       <reference key="NSNextKeyView" ref="194275224"/>
-                                                                                       <string key="NSReuseIdentifierKey">_NS:9</string>
-                                                                                       <string key="NSClassName">NJKeyInputField</string>
-                                                                               </object>
-                                                                               <object class="NSPopUpButton" id="194275224">
-                                                                                       <reference key="NSNextResponder" ref="606740242"/>
-                                                                                       <int key="NSvFlags">265</int>
-                                                                                       <string key="NSFrame">{{225, 152}, {182, 26}}</string>
-                                                                                       <reference key="NSSuperview" ref="606740242"/>
-                                                                                       <reference key="NSWindow"/>
-                                                                                       <reference key="NSNextKeyView" ref="875916470"/>
-                                                                                       <bool key="NSEnabled">YES</bool>
-                                                                                       <object class="NSPopUpButtonCell" key="NSCell" id="74311158">
-                                                                                               <int key="NSCellFlags">-1539309504</int>
-                                                                                               <int key="NSCellFlags2">2048</int>
-                                                                                               <reference key="NSSupport" ref="45863614"/>
-                                                                                               <reference key="NSControlView" ref="194275224"/>
-                                                                                               <int key="NSButtonFlags">109199360</int>
-                                                                                               <int key="NSButtonFlags2">129</int>
-                                                                                               <string key="NSAlternateContents"/>
-                                                                                               <string key="NSKeyEquivalent"/>
-                                                                                               <int key="NSPeriodicDelay">400</int>
-                                                                                               <int key="NSPeriodicInterval">75</int>
-                                                                                               <nil key="NSMenuItem"/>
-                                                                                               <bool key="NSMenuItemRespectAlignment">YES</bool>
-                                                                                               <object class="NSMenu" key="NSMenu" id="19633006">
-                                                                                                       <string key="NSTitle">OtherViews</string>
-                                                                                                       <array class="NSMutableArray" key="NSMenuItems"/>
-                                                                                               </object>
-                                                                                               <int key="NSSelectedIndex">-1</int>
-                                                                                               <int key="NSPreferredEdge">1</int>
-                                                                                               <bool key="NSUsesItemFromMenu">YES</bool>
-                                                                                               <bool key="NSAltersState">YES</bool>
-                                                                                               <int key="NSArrowPosition">2</int>
-                                                                                       </object>
-                                                                                       <bool key="NSAllowsLogicalLayoutDirection">NO</bool>
-                                                                               </object>
-                                                                               <object class="NSMatrix" id="120408205">
-                                                                                       <reference key="NSNextResponder" ref="606740242"/>
-                                                                                       <int key="NSvFlags">268</int>
-                                                                                       <string key="NSFrame">{{20, 16}, {200, 256}}</string>
-                                                                                       <reference key="NSSuperview" ref="606740242"/>
-                                                                                       <reference key="NSWindow"/>
-                                                                                       <reference key="NSNextKeyView" ref="57697638"/>
-                                                                                       <bool key="NSAllowsLogicalLayoutDirection">NO</bool>
-                                                                                       <int key="NSNumRows">6</int>
-                                                                                       <int key="NSNumCols">1</int>
-                                                                                       <array class="NSMutableArray" key="NSCells">
-                                                                                               <object class="NSButtonCell" id="177186415">
-                                                                                                       <int key="NSCellFlags">603979776</int>
-                                                                                                       <int key="NSCellFlags2">0</int>
-                                                                                                       <string key="NSContents">Do nothing</string>
-                                                                                                       <reference key="NSSupport" ref="45863614"/>
-                                                                                                       <reference key="NSControlView" ref="120408205"/>
-                                                                                                       <int key="NSTag">1</int>
-                                                                                                       <int key="NSButtonFlags">1211912448</int>
-                                                                                                       <int key="NSButtonFlags2">0</int>
-                                                                                                       <object class="NSCustomResource" key="NSNormalImage" id="421587711">
-                                                                                                               <string key="NSClassName">NSImage</string>
-                                                                                                               <string key="NSResourceName">NSRadioButton</string>
-                                                                                                       </object>
-                                                                                                       <object class="NSButtonImageSource" key="NSAlternateImage" id="68833793">
-                                                                                                               <string key="NSImageName">NSRadioButton</string>
-                                                                                                       </object>
-                                                                                                       <string key="NSAlternateContents"/>
-                                                                                                       <string key="NSKeyEquivalent"/>
-                                                                                                       <int key="NSPeriodicDelay">200</int>
-                                                                                                       <int key="NSPeriodicInterval">25</int>
-                                                                                               </object>
-                                                                                               <object class="NSButtonCell" id="387494389">
-                                                                                                       <int key="NSCellFlags">603979776</int>
-                                                                                                       <int key="NSCellFlags2">0</int>
-                                                                                                       <string key="NSContents">Press a key</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>
-                                                                                               <object class="NSButtonCell" id="339215895">
-                                                                                                       <int key="NSCellFlags">603979776</int>
-                                                                                                       <int key="NSCellFlags2">0</int>
-                                                                                                       <string key="NSContents">Switch to mapping</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>
-                                                                                               <object class="NSButtonCell" id="820968178">
-                                                                                                       <int key="NSCellFlags">603979776</int>
-                                                                                                       <int key="NSCellFlags2">0</int>
-                                                                                                       <string key="NSContents">Move the mouse</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>
-                                                                                               <object class="NSButtonCell" id="275466816">
-                                                                                                       <int key="NSCellFlags">603979776</int>
-                                                                                                       <int key="NSCellFlags2">0</int>
-                                                                                                       <string key="NSContents">Press a mouse button</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>
-                                                                                               <object class="NSButtonCell" id="134694197">
-                                                                                                       <int key="NSCellFlags">603979776</int>
-                                                                                                       <int key="NSCellFlags2">0</int>
-                                                                                                       <string key="NSContents">Scroll the mouse</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, 41}</string>
-                                                                                       <string key="NSIntercellSpacing">{4, 2}</string>
-                                                                                       <int key="NSMatrixFlags">1353195520</int>
-                                                                                       <string key="NSCellClass">NSActionCell</string>
-                                                                                       <object class="NSButtonCell" key="NSProtoCell" id="632642090">
-                                                                                               <int key="NSCellFlags">603979776</int>
-                                                                                               <int key="NSCellFlags2">0</int>
-                                                                                               <string key="NSContents">Radio</string>
-                                                                                               <reference key="NSSupport" ref="45863614"/>
-                                                                                               <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>
-                                                                                       <int key="NSSelectedRow">-1</int>
-                                                                                       <int key="NSSelectedCol">-1</int>
-                                                                                       <object class="NSColor" key="NSBackgroundColor" id="473846075">
-                                                                                               <int key="NSColorSpace">6</int>
-                                                                                               <string key="NSCatalogName">System</string>
-                                                                                               <string key="NSColorName">controlColor</string>
-                                                                                               <reference key="NSColor" ref="783809746"/>
-                                                                                       </object>
-                                                                                       <reference key="NSCellBackgroundColor" ref="214000480"/>
-                                                                                       <reference key="NSFont" ref="45863614"/>
-                                                                               </object>
-                                                                               <object class="NSTextField" id="1016088174">
-                                                                                       <reference key="NSNextResponder" ref="606740242"/>
-                                                                                       <int key="NSvFlags">266</int>
-                                                                                       <string key="NSFrame">{{0, 289}, {429, 17}}</string>
-                                                                                       <reference key="NSSuperview" ref="606740242"/>
-                                                                                       <reference key="NSWindow"/>
-                                                                                       <reference key="NSNextKeyView" ref="497528019"/>
-                                                                                       <bool key="NSEnabled">YES</bool>
-                                                                                       <object class="NSTextFieldCell" key="NSCell" id="853503577">
-                                                                                               <int key="NSCellFlags">67108928</int>
-                                                                                               <int key="NSCellFlags2">138414656</int>
-                                                                                               <string key="NSContents"/>
-                                                                                               <object class="NSFont" key="NSSupport">
-                                                                                                       <string key="NSName">LucidaGrande-Bold</string>
-                                                                                                       <double key="NSSize">13</double>
-                                                                                                       <int key="NSfFlags">16</int>
-                                                                                               </object>
-                                                                                               <string key="NSPlaceholderString">No input selected</string>
-                                                                                               <reference key="NSControlView" ref="1016088174"/>
-                                                                                               <reference key="NSBackgroundColor" ref="473846075"/>
-                                                                                               <reference key="NSTextColor" ref="813255721"/>
-                                                                                       </object>
-                                                                                       <bool key="NSAllowsLogicalLayoutDirection">NO</bool>
-                                                                               </object>
-                                                                               <object class="NSBox" id="497528019">
-                                                                                       <reference key="NSNextResponder" ref="606740242"/>
-                                                                                       <int key="NSvFlags">10</int>
-                                                                                       <string key="NSFrame">{{12, 278}, {405, 5}}</string>
-                                                                                       <reference key="NSSuperview" ref="606740242"/>
-                                                                                       <reference key="NSWindow"/>
-                                                                                       <reference key="NSNextKeyView" ref="120408205"/>
-                                                                                       <string key="NSOffsets">{0, 0}</string>
-                                                                                       <object class="NSTextFieldCell" key="NSTitleCell">
-                                                                                               <int key="NSCellFlags">67108864</int>
-                                                                                               <int key="NSCellFlags2">0</int>
-                                                                                               <string key="NSContents">Box</string>
-                                                                                               <reference key="NSSupport" ref="45863614"/>
-                                                                                               <object class="NSColor" key="NSBackgroundColor">
-                                                                                                       <int key="NSColorSpace">6</int>
-                                                                                                       <string key="NSCatalogName">System</string>
-                                                                                                       <string key="NSColorName">textBackgroundColor</string>
-                                                                                                       <reference key="NSColor" ref="214000480"/>
-                                                                                               </object>
-                                                                                               <object class="NSColor" key="NSTextColor">
-                                                                                                       <int key="NSColorSpace">3</int>
-                                                                                                       <bytes key="NSWhite">MCAwLjgwMDAwMDAxAA</bytes>
-                                                                                               </object>
-                                                                                       </object>
-                                                                                       <int key="NSBorderType">3</int>
-                                                                                       <int key="NSBoxType">2</int>
-                                                                                       <int key="NSTitlePosition">0</int>
-                                                                                       <bool key="NSTransparent">NO</bool>
-                                                                               </object>
-                                                                       </array>
-                                                                       <string key="NSFrame">{{211, 0}, {429, 320}}</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, 320}</string>
-                                                       <reference key="NSSuperview" ref="177223957"/>
-                                                       <reference key="NSWindow"/>
-                                                       <reference key="NSNextKeyView" ref="977242492"/>
-                                                       <bool key="NSIsVertical">YES</bool>
-                                                       <string key="NSAutosaveName">Main Split</string>
-                                                       <object class="NSMutableDictionary" key="NSHoldingPriorities">
-                                                               <bool key="EncodedWithXMLCoder">YES</bool>
-                                                               <array key="dict.sortedKeys">
-                                                                       <integer value="0"/>
-                                                                       <integer value="1"/>
-                                                               </array>
-                                                               <array key="dict.values">
-                                                                       <real value="250"/>
-                                                                       <real value="250"/>
-                                                               </array>
-                                                       </object>
-                                               </object>
-                                       </array>
-                                       <string key="NSFrameSize">{640, 320}</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, 375}</string>
-                               <string key="NSMaxSize">{10000000000000, 10000000000000}</string>
-                               <string key="NSFrameAutosaveName">Enjoyable</string>
-                               <bool key="NSWindowIsRestorable">YES</bool>
-                       </object>
-                       <object class="NSCustomView" id="671181514">
-                               <reference key="NSNextResponder"/>
-                               <int key="NSvFlags">256</int>
-                               <array class="NSMutableArray" key="NSSubviews">
-                                       <object class="NSScrollView" id="443618264">
-                                               <reference key="NSNextResponder" ref="671181514"/>
-                                               <int key="NSvFlags">274</int>
-                                               <array class="NSMutableArray" key="NSSubviews">
-                                                       <object class="NSClipView" id="947403733">
-                                                               <reference key="NSNextResponder" ref="443618264"/>
-                                                               <int key="NSvFlags">2304</int>
-                                                               <array class="NSMutableArray" key="NSSubviews">
-                                                                       <object class="NSTableView" id="762432499">
-                                                                               <reference key="NSNextResponder" ref="947403733"/>
-                                                                               <int key="NSvFlags">256</int>
-                                                                               <string key="NSFrameSize">{198, 198}</string>
-                                                                               <reference key="NSSuperview" ref="947403733"/>
-                                                                               <reference key="NSWindow"/>
-                                                                               <reference key="NSNextKeyView" ref="968378655"/>
-                                                                               <bool key="NSEnabled">YES</bool>
-                                                                               <bool key="NSAllowsLogicalLayoutDirection">NO</bool>
-                                                                               <bool key="NSControlAllowsExpansionToolTips">YES</bool>
-                                                                               <object class="_NSCornerView" key="NSCornerView">
-                                                                                       <nil key="NSNextResponder"/>
-                                                                                       <int key="NSvFlags">256</int>
-                                                                                       <string key="NSFrame">{{306, 0}, {16, 17}}</string>
-                                                                               </object>
-                                                                               <array class="NSMutableArray" key="NSTableColumns">
-                                                                                       <object class="NSTableColumn" id="827961598">
-                                                                                               <double key="NSWidth">190</double>
-                                                                                               <double key="NSMinWidth">190</double>
-                                                                                               <double key="NSMaxWidth">190</double>
-                                                                                               <object class="NSTableHeaderCell" key="NSHeaderCell">
-                                                                                                       <int key="NSCellFlags">75497536</int>
-                                                                                                       <int key="NSCellFlags2">2048</int>
-                                                                                                       <string key="NSContents"/>
-                                                                                                       <reference key="NSSupport" ref="26"/>
-                                                                                                       <object class="NSColor" key="NSBackgroundColor">
-                                                                                                               <int key="NSColorSpace">3</int>
-                                                                                                               <bytes key="NSWhite">MC4zMzMzMzI5OQA</bytes>
-                                                                                                       </object>
-                                                                                                       <reference key="NSTextColor" ref="809574366"/>
-                                                                                               </object>
-                                                                                               <object class="NSTextFieldCell" key="NSDataCell" id="638155037">
-                                                                                                       <int key="NSCellFlags">337641536</int>
-                                                                                                       <int key="NSCellFlags2">2048</int>
-                                                                                                       <string key="NSContents">Text Cell</string>
-                                                                                                       <reference key="NSSupport" ref="45863614"/>
-                                                                                                       <reference key="NSControlView" ref="762432499"/>
-                                                                                                       <reference key="NSBackgroundColor" ref="834857663"/>
-                                                                                                       <reference key="NSTextColor" ref="813255721"/>
-                                                                                               </object>
-                                                                                               <bool key="NSIsEditable">YES</bool>
-                                                                                               <reference key="NSTableView" ref="762432499"/>
-                                                                                       </object>
-                                                                               </array>
-                                                                               <double key="NSIntercellSpacingWidth">3</double>
-                                                                               <double key="NSIntercellSpacingHeight">2</double>
-                                                                               <reference key="NSBackgroundColor" ref="834857663"/>
-                                                                               <reference key="NSGridColor" ref="133906332"/>
-                                                                               <double key="NSRowHeight">20</double>
-                                                                               <int key="NSTvFlags">44072960</int>
-                                                                               <reference key="NSDelegate"/>
-                                                                               <reference key="NSDataSource"/>
-                                                                               <int key="NSColumnAutoresizingStyle">1</int>
-                                                                               <int key="NSDraggingSourceMaskForLocal">15</int>
-                                                                               <int key="NSDraggingSourceMaskForNonLocal">0</int>
-                                                                               <bool key="NSAllowsTypeSelect">NO</bool>
-                                                                               <int key="NSTableViewDraggingDestinationStyle">0</int>
-                                                                               <int key="NSTableViewGroupRowStyle">1</int>
-                                                                               <int key="NSTableViewRowSizeStyle">-1</int>
-                                                                       </object>
-                                                               </array>
-                                                               <string key="NSFrame">{{1, 1}, {198, 198}}</string>
-                                                               <reference key="NSSuperview" ref="443618264"/>
-                                                               <reference key="NSWindow"/>
-                                                               <reference key="NSNextKeyView" ref="762432499"/>
-                                                               <reference key="NSDocView" ref="762432499"/>
-                                                               <reference key="NSBGColor" ref="834857663"/>
-                                                               <int key="NScvFlags">4</int>
-                                                       </object>
-                                                       <object class="NSScroller" id="968378655">
-                                                               <reference key="NSNextResponder" ref="443618264"/>
-                                                               <int key="NSvFlags">-2147483392</int>
-                                                               <string key="NSFrame">{{306, 1}, {15, 403}}</string>
-                                                               <reference key="NSSuperview" ref="443618264"/>
-                                                               <reference key="NSWindow"/>
-                                                               <reference key="NSNextKeyView" ref="861276216"/>
-                                                               <bool key="NSAllowsLogicalLayoutDirection">NO</bool>
-                                                               <reference key="NSTarget" ref="443618264"/>
-                                                               <string key="NSAction">_doScroller:</string>
-                                                               <double key="NSPercent">0.99766359999999998</double>
-                                                       </object>
-                                                       <object class="NSScroller" id="553414014">
-                                                               <reference key="NSNextResponder" ref="443618264"/>
-                                                               <int key="NSvFlags">-2147483392</int>
-                                                               <string key="NSFrame">{{-100, -100}, {366, 16}}</string>
-                                                               <reference key="NSSuperview" ref="443618264"/>
-                                                               <reference key="NSWindow"/>
-                                                               <reference key="NSNextKeyView" ref="947403733"/>
-                                                               <bool key="NSAllowsLogicalLayoutDirection">NO</bool>
-                                                               <int key="NSsFlags">1</int>
-                                                               <reference key="NSTarget" ref="443618264"/>
-                                                               <string key="NSAction">_doScroller:</string>
-                                                               <double key="NSPercent">0.98123324396782841</double>
-                                                       </object>
-                                               </array>
-                                               <string key="NSFrame">{{0, 20}, {200, 200}}</string>
-                                               <reference key="NSSuperview" ref="671181514"/>
-                                               <reference key="NSWindow"/>
-                                               <reference key="NSNextKeyView" ref="553414014"/>
-                                               <int key="NSsFlags">150034</int>
-                                               <reference key="NSVScroller" ref="968378655"/>
-                                               <reference key="NSHScroller" ref="553414014"/>
-                                               <reference key="NSContentView" ref="947403733"/>
-                                               <bytes key="NSScrollAmts">QSAAAEEgAABBsAAAQbAAAA</bytes>
-                                               <double key="NSMinMagnification">0.25</double>
-                                               <double key="NSMaxMagnification">4</double>
-                                               <double key="NSMagnification">1</double>
-                                       </object>
-                                       <object class="NSButton" id="149148392">
-                                               <reference key="NSNextResponder" ref="671181514"/>
-                                               <int key="NSvFlags">268</int>
-                                               <string key="NSFrame">{{66, -1}, {68, 23}}</string>
-                                               <reference key="NSSuperview" ref="671181514"/>
-                                               <reference key="NSWindow"/>
-                                               <reference key="NSNextKeyView" ref="1023366520"/>
-                                               <string key="NSReuseIdentifierKey">_NS:22</string>
-                                               <bool key="NSEnabled">YES</bool>
-                                               <object class="NSButtonCell" key="NSCell" id="517346822">
-                                                       <int key="NSCellFlags">-2080374784</int>
-                                                       <int key="NSCellFlags2">168034304</int>
-                                                       <string key="NSContents"/>
-                                                       <object class="NSFont" key="NSSupport" id="22">
-                                                               <string key="NSName">LucidaGrande</string>
-                                                               <double key="NSSize">9</double>
-                                                               <int key="NSfFlags">3614</int>
-                                                       </object>
-                                                       <string key="NSCellIdentifier">_NS:22</string>
-                                                       <reference key="NSControlView" ref="149148392"/>
-                                                       <int key="NSButtonFlags">1221349376</int>
-                                                       <int key="NSButtonFlags2">162</int>
-                                                       <string key="NSAlternateContents"/>
-                                                       <string key="NSKeyEquivalent"/>
-                                                       <int key="NSPeriodicDelay">400</int>
-                                                       <int key="NSPeriodicInterval">75</int>
-                                               </object>
-                                               <bool key="NSAllowsLogicalLayoutDirection">NO</bool>
-                                       </object>
-                                       <object class="NSButton" id="861276216">
-                                               <reference key="NSNextResponder" ref="671181514"/>
-                                               <int key="NSvFlags">292</int>
-                                               <string key="NSFrame">{{0, -1}, {34, 23}}</string>
-                                               <reference key="NSSuperview" ref="671181514"/>
-                                               <reference key="NSWindow"/>
-                                               <reference key="NSNextKeyView" ref="456935010"/>
-                                               <bool key="NSEnabled">YES</bool>
-                                               <object class="NSButtonCell" key="NSCell" id="867532725">
-                                                       <int key="NSCellFlags">67108864</int>
-                                                       <int key="NSCellFlags2">134479872</int>
-                                                       <string key="NSContents"/>
-                                                       <reference key="NSSupport" ref="22"/>
-                                                       <reference key="NSControlView" ref="861276216"/>
-                                                       <int key="NSButtonFlags">-2033958912</int>
-                                                       <int key="NSButtonFlags2">268435618</int>
-                                                       <object class="NSCustomResource" key="NSNormalImage">
-                                                               <string key="NSClassName">NSImage</string>
-                                                               <string key="NSResourceName">NSAddTemplate</string>
-                                                       </object>
-                                                       <string key="NSAlternateContents"/>
-                                                       <string key="NSKeyEquivalent">n</string>
-                                                       <int key="NSPeriodicDelay">400</int>
-                                                       <int key="NSPeriodicInterval">75</int>
-                                               </object>
-                                               <bool key="NSAllowsLogicalLayoutDirection">NO</bool>
-                                       </object>
-                                       <object class="NSButton" id="1043784903">
-                                               <reference key="NSNextResponder" ref="671181514"/>
-                                               <int key="NSvFlags">292</int>
-                                               <string key="NSFrame">{{166, -1}, {34, 23}}</string>
-                                               <reference key="NSSuperview" ref="671181514"/>
-                                               <reference key="NSWindow"/>
-                                               <reference key="NSNextKeyView"/>
-                                               <bool key="NSEnabled">YES</bool>
-                                               <object class="NSButtonCell" key="NSCell" id="828611353">
-                                                       <int key="NSCellFlags">67108864</int>
-                                                       <int key="NSCellFlags2">134479872</int>
-                                                       <string key="NSContents">⬇</string>
-                                                       <reference key="NSSupport" ref="22"/>
-                                                       <reference key="NSControlView" ref="1043784903"/>
-                                                       <int key="NSButtonFlags">-2033434624</int>
-                                                       <int key="NSButtonFlags2">268435618</int>
-                                                       <string key="NSAlternateContents"/>
-                                                       <string key="NSKeyEquivalent"></string>
-                                                       <int key="NSPeriodicDelay">400</int>
-                                                       <int key="NSPeriodicInterval">75</int>
-                                               </object>
-                                               <bool key="NSAllowsLogicalLayoutDirection">NO</bool>
-                                       </object>
-                                       <object class="NSButton" id="1023366520">
-                                               <reference key="NSNextResponder" ref="671181514"/>
-                                               <int key="NSvFlags">292</int>
-                                               <string key="NSFrame">{{133, -1}, {34, 23}}</string>
-                                               <reference key="NSSuperview" ref="671181514"/>
-                                               <reference key="NSWindow"/>
-                                               <reference key="NSNextKeyView" ref="1043784903"/>
-                                               <bool key="NSEnabled">YES</bool>
-                                               <object class="NSButtonCell" key="NSCell" id="57592747">
-                                                       <int key="NSCellFlags">67108864</int>
-                                                       <int key="NSCellFlags2">134479872</int>
-                                                       <string key="NSContents">⬆</string>
-                                                       <reference key="NSSupport" ref="22"/>
-                                                       <reference key="NSControlView" ref="1023366520"/>
-                                                       <int key="NSButtonFlags">-2033434624</int>
-                                                       <int key="NSButtonFlags2">268435618</int>
-                                                       <string key="NSAlternateContents"/>
-                                                       <string key="NSKeyEquivalent"></string>
-                                                       <int key="NSPeriodicDelay">400</int>
-                                                       <int key="NSPeriodicInterval">75</int>
-                                               </object>
-                                               <bool key="NSAllowsLogicalLayoutDirection">NO</bool>
-                                       </object>
-                                       <object class="NSButton" id="456935010">
-                                               <reference key="NSNextResponder" ref="671181514"/>
-                                               <int key="NSvFlags">292</int>
-                                               <string key="NSFrame">{{33, -1}, {34, 23}}</string>
-                                               <reference key="NSSuperview" ref="671181514"/>
-                                               <reference key="NSWindow"/>
-                                               <reference key="NSNextKeyView" ref="149148392"/>
-                                               <bool key="NSEnabled">YES</bool>
-                                               <object class="NSButtonCell" key="NSCell" id="1008023024">
-                                                       <int key="NSCellFlags">67108864</int>
-                                                       <int key="NSCellFlags2">134479872</int>
-                                                       <string key="NSContents"/>
-                                                       <reference key="NSSupport" ref="22"/>
-                                                       <reference key="NSControlView" ref="456935010"/>
-                                                       <int key="NSButtonFlags">-2033958912</int>
-                                                       <int key="NSButtonFlags2">268435618</int>
-                                                       <object class="NSCustomResource" key="NSNormalImage">
-                                                               <string key="NSClassName">NSImage</string>
-                                                               <string key="NSResourceName">NSRemoveTemplate</string>
-                                                       </object>
-                                                       <string key="NSAlternateContents"/>
-                                                       <string type="base64-UTF8" key="NSKeyEquivalent">CA</string>
-                                                       <int key="NSPeriodicDelay">400</int>
-                                                       <int key="NSPeriodicInterval">75</int>
-                                               </object>
-                                               <bool key="NSAllowsLogicalLayoutDirection">NO</bool>
-                                       </object>
-                               </array>
-                               <string key="NSFrameSize">{200, 220}</string>
-                               <reference key="NSSuperview"/>
-                               <reference key="NSWindow"/>
-                               <reference key="NSNextKeyView" ref="443618264"/>
-                               <string key="NSClassName">NSView</string>
-                       </object>
-                       <object class="NSCustomObject" id="207406104">
-                               <string key="NSClassName">EnjoyableApplicationDelegate</string>
-                       </object>
-                       <object class="NSCustomObject" id="468285243">
-                               <string key="NSClassName">NJMappingsController</string>
-                       </object>
-                       <object class="NSCustomObject" id="1007832501">
-                               <string key="NSClassName">NJDeviceController</string>
-                       </object>
-                       <object class="NSCustomObject" id="801536542">
-                               <string key="NSClassName">NJOutputController</string>
-                       </object>
-                       <object class="NSViewController" id="328152383"/>
-                       <object class="NSPopover" id="586993839">
-                               <nil key="NSNextResponder"/>
-                               <int key="NSAppearance">0</int>
-                               <int key="NSBehavior">1</int>
-                               <double key="NSContentWidth">0.0</double>
-                               <double key="NSContentHeight">0.0</double>
-                               <bool key="NSAnimates">YES</bool>
-                       </object>
-               </array>
-               <object class="IBObjectContainer" key="IBDocument.Objects">
-                       <array class="NSMutableArray" key="connectionRecords">
-                               <object class="IBConnectionRecord">
-                                       <object class="IBActionConnection" key="connection">
-                                               <string key="label">terminate:</string>
-                                               <reference key="source" ref="1050"/>
-                                               <reference key="destination" ref="632727374"/>
-                                       </object>
-                                       <int key="connectionID">449</int>
-                               </object>
-                               <object class="IBConnectionRecord">
-                                       <object class="IBOutletConnection" key="connection">
-                                               <string key="label">delegate</string>
-                                               <reference key="source" ref="1050"/>
-                                               <reference key="destination" ref="207406104"/>
-                                       </object>
-                                       <int key="connectionID">483</int>
-                               </object>
-                               <object class="IBConnectionRecord">
-                                       <object class="IBOutletConnection" key="connection">
-                                               <string key="label">dockMenu</string>
-                                               <reference key="source" ref="1050"/>
-                                               <reference key="destination" ref="720053764"/>
-                                       </object>
-                                       <int key="connectionID">732</int>
-                               </object>
-                               <object class="IBConnectionRecord">
-                                       <object class="IBActionConnection" key="connection">
-                                               <string key="label">showHelp:</string>
-                                               <reference key="source" ref="1050"/>
-                                               <reference key="destination" ref="842970531"/>
-                                       </object>
-                                       <int key="connectionID">870</int>
-                               </object>
-                               <object class="IBConnectionRecord">
-                                       <object class="IBActionConnection" key="connection">
-                                               <string key="label">orderFrontStandardAboutPanel:</string>
-                                               <reference key="source" ref="1021"/>
-                                               <reference key="destination" ref="238522557"/>
-                                       </object>
-                                       <int key="connectionID">142</int>
-                               </object>
-                               <object class="IBConnectionRecord">
-                                       <object class="IBActionConnection" key="connection">
-                                               <string key="label">performMiniaturize:</string>
-                                               <reference key="source" ref="1014"/>
-                                               <reference key="destination" ref="1011231497"/>
-                                       </object>
-                                       <int key="connectionID">37</int>
-                               </object>
-                               <object class="IBConnectionRecord">
-                                       <object class="IBActionConnection" key="connection">
-                                               <string key="label">arrangeInFront:</string>
-                                               <reference key="source" ref="1014"/>
-                                               <reference key="destination" ref="625202149"/>
-                                       </object>
-                                       <int key="connectionID">39</int>
-                               </object>
-                               <object class="IBConnectionRecord">
-                                       <object class="IBActionConnection" key="connection">
-                                               <string key="label">performZoom:</string>
-                                               <reference key="source" ref="1014"/>
-                                               <reference key="destination" ref="575023229"/>
-                                       </object>
-                                       <int key="connectionID">240</int>
-                               </object>
-                               <object class="IBConnectionRecord">
-                                       <object class="IBActionConnection" key="connection">
-                                               <string key="label">hide:</string>
-                                               <reference key="source" ref="1014"/>
-                                               <reference key="destination" ref="755159360"/>
-                                       </object>
-                                       <int key="connectionID">367</int>
-                               </object>
-                               <object class="IBConnectionRecord">
-                                       <object class="IBActionConnection" key="connection">
-                                               <string key="label">hideOtherApplications:</string>
-                                               <reference key="source" ref="1014"/>
-                                               <reference key="destination" ref="342932134"/>
-                                       </object>
-                                       <int key="connectionID">368</int>
-                               </object>
-                               <object class="IBConnectionRecord">
-                                       <object class="IBActionConnection" key="connection">
-                                               <string key="label">unhideAllApplications:</string>
-                                               <reference key="source" ref="1014"/>
-                                               <reference key="destination" ref="908899353"/>
-                                       </object>
-                                       <int key="connectionID">370</int>
-                               </object>
-                               <object class="IBConnectionRecord">
-                                       <object class="IBOutletConnection" key="connection">
-                                               <string key="label">delegate</string>
-                                               <reference key="source" ref="762432499"/>
-                                               <reference key="destination" ref="468285243"/>
-                                       </object>
-                                       <int key="connectionID">517</int>
-                               </object>
-                               <object class="IBConnectionRecord">
-                                       <object class="IBOutletConnection" key="connection">
-                                               <string key="label">dataSource</string>
-                                               <reference key="source" ref="762432499"/>
-                                               <reference key="destination" ref="468285243"/>
-                                       </object>
-                                       <int key="connectionID">518</int>
-                               </object>
-                               <object class="IBConnectionRecord">
-                                       <object class="IBOutletConnection" key="connection">
-                                               <string key="label">outlineView</string>
-                                               <reference key="source" ref="1007832501"/>
-                                               <reference key="destination" ref="365506042"/>
-                                       </object>
-                                       <int key="connectionID">648</int>
-                               </object>
-                               <object class="IBConnectionRecord">
-                                       <object class="IBOutletConnection" key="connection">
-                                               <string key="label">mappingsController</string>
-                                               <reference key="source" ref="1007832501"/>
-                                               <reference key="destination" ref="468285243"/>
-                                       </object>
-                                       <int key="connectionID">822</int>
-                               </object>
-                               <object class="IBConnectionRecord">
-                                       <object class="IBOutletConnection" key="connection">
-                                               <string key="label">outputController</string>
-                                               <reference key="source" ref="1007832501"/>
-                                               <reference key="destination" ref="801536542"/>
-                                       </object>
-                                       <int key="connectionID">826</int>
-                               </object>
-                               <object class="IBConnectionRecord">
-                                       <object class="IBOutletConnection" key="connection">
-                                               <string key="label">translatingEventsMenu</string>
-                                               <reference key="source" ref="1007832501"/>
-                                               <reference key="destination" ref="632598200"/>
-                                       </object>
-                                       <int key="connectionID">877</int>
-                               </object>
-                               <object class="IBConnectionRecord">
-                                       <object class="IBActionConnection" key="connection">
-                                               <string key="label">translatingEventsChanged:</string>
-                                               <reference key="source" ref="1007832501"/>
-                                               <reference key="destination" ref="385218002"/>
-                                       </object>
-                                       <int key="connectionID">878</int>
-                               </object>
-                               <object class="IBConnectionRecord">
-                                       <object class="IBOutletConnection" key="connection">
-                                               <string key="label">translatingEventsButton</string>
-                                               <reference key="source" ref="1007832501"/>
-                                               <reference key="destination" ref="385218002"/>
-                                       </object>
-                                       <int key="connectionID">879</int>
-                               </object>
-                               <object class="IBConnectionRecord">
-                                       <object class="IBOutletConnection" key="connection">
-                                               <string key="label">dockMenuBase</string>
-                                               <reference key="source" ref="207406104"/>
-                                               <reference key="destination" ref="720053764"/>
-                                       </object>
-                                       <int key="connectionID">726</int>
-                               </object>
-                               <object class="IBConnectionRecord">
-                                       <object class="IBOutletConnection" key="connection">
-                                               <string key="label">inputController</string>
-                                               <reference key="source" ref="207406104"/>
-                                               <reference key="destination" ref="1007832501"/>
-                                       </object>
-                                       <int key="connectionID">819</int>
-                               </object>
-                               <object class="IBConnectionRecord">
-                                       <object class="IBOutletConnection" key="connection">
-                                               <string key="label">mappingsController</string>
-                                               <reference key="source" ref="207406104"/>
-                                               <reference key="destination" ref="468285243"/>
-                                       </object>
-                                       <int key="connectionID">820</int>
-                               </object>
-                               <object class="IBConnectionRecord">
-                                       <object class="IBOutletConnection" key="connection">
-                                               <string key="label">window</string>
-                                               <reference key="source" ref="207406104"/>
-                                               <reference key="destination" ref="808667431"/>
-                                       </object>
-                                       <int key="connectionID">865</int>
-                               </object>
-                               <object class="IBConnectionRecord">
-                                       <object class="IBActionConnection" key="connection">
-                                               <string key="label">removePressed:</string>
-                                               <reference key="source" ref="468285243"/>
-                                               <reference key="destination" ref="456935010"/>
-                                       </object>
-                                       <int key="connectionID">516</int>
-                               </object>
-                               <object class="IBConnectionRecord">
-                                       <object class="IBOutletConnection" key="connection">
-                                               <string key="label">removeButton</string>
-                                               <reference key="source" ref="468285243"/>
-                                               <reference key="destination" ref="456935010"/>
-                                       </object>
-                                       <int key="connectionID">519</int>
-                               </object>
-                               <object class="IBConnectionRecord">
-                                       <object class="IBOutletConnection" key="connection">
-                                               <string key="label">tableView</string>
-                                               <reference key="source" ref="468285243"/>
-                                               <reference key="destination" ref="762432499"/>
-                                       </object>
-                                       <int key="connectionID">520</int>
-                               </object>
-                               <object class="IBConnectionRecord">
-                                       <object class="IBActionConnection" key="connection">
-                                               <string key="label">exportPressed:</string>
-                                               <reference key="source" ref="468285243"/>
-                                               <reference key="destination" ref="888617891"/>
-                                       </object>
-                                       <int key="connectionID">815</int>
-                               </object>
-                               <object class="IBConnectionRecord">
-                                       <object class="IBActionConnection" key="connection">
-                                               <string key="label">importPressed:</string>
-                                               <reference key="source" ref="468285243"/>
-                                               <reference key="destination" ref="187155117"/>
-                                       </object>
-                                       <int key="connectionID">816</int>
-                               </object>
-                               <object class="IBConnectionRecord">
-                                       <object class="IBOutletConnection" key="connection">
-                                               <string key="label">outputController</string>
-                                               <reference key="source" ref="468285243"/>
-                                               <reference key="destination" ref="801536542"/>
-                                       </object>
-                                       <int key="connectionID">827</int>
-                               </object>
-                               <object class="IBConnectionRecord">
-                                       <object class="IBActionConnection" key="connection">
-                                               <string key="label">mappingPressed:</string>
-                                               <reference key="source" ref="468285243"/>
-                                               <reference key="destination" ref="227597319"/>
-                                       </object>
-                                       <int key="connectionID">855</int>
-                               </object>
-                               <object class="IBConnectionRecord">
-                                       <object class="IBOutletConnection" key="connection">
-                                               <string key="label">popover</string>
-                                               <reference key="source" ref="468285243"/>
-                                               <reference key="destination" ref="586993839"/>
-                                       </object>
-                                       <int key="connectionID">856</int>
-                               </object>
-                               <object class="IBConnectionRecord">
-                                       <object class="IBOutletConnection" key="connection">
-                                               <string key="label">popoverActivate</string>
-                                               <reference key="source" ref="468285243"/>
-                                               <reference key="destination" ref="227597319"/>
-                                       </object>
-                                       <int key="connectionID">857</int>
-                               </object>
-                               <object class="IBConnectionRecord">
-                                       <object class="IBActionConnection" key="connection">
-                                               <string key="label">addPressed:</string>
-                                               <reference key="source" ref="468285243"/>
-                                               <reference key="destination" ref="861276216"/>
-                                       </object>
-                                       <int key="connectionID">515</int>
-                               </object>
-                               <object class="IBConnectionRecord">
-                                       <object class="IBActionConnection" key="connection">
-                                               <string key="label">moveUpPressed:</string>
-                                               <reference key="source" ref="468285243"/>
-                                               <reference key="destination" ref="1023366520"/>
-                                       </object>
-                                       <int key="connectionID">899</int>
-                               </object>
-                               <object class="IBConnectionRecord">
-                                       <object class="IBActionConnection" key="connection">
-                                               <string key="label">moveDownPressed:</string>
-                                               <reference key="source" ref="468285243"/>
-                                               <reference key="destination" ref="1043784903"/>
-                                       </object>
-                                       <int key="connectionID">900</int>
-                               </object>
-                               <object class="IBConnectionRecord">
-                                       <object class="IBOutletConnection" key="connection">
-                                               <string key="label">moveUp</string>
-                                               <reference key="source" ref="468285243"/>
-                                               <reference key="destination" ref="1023366520"/>
-                                       </object>
-                                       <int key="connectionID">901</int>
-                               </object>
-                               <object class="IBConnectionRecord">
-                                       <object class="IBOutletConnection" key="connection">
-                                               <string key="label">moveDown</string>
-                                               <reference key="source" ref="468285243"/>
-                                               <reference key="destination" ref="1043784903"/>
-                                       </object>
-                                       <int key="connectionID">902</int>
-                               </object>
-                               <object class="IBConnectionRecord">
-                                       <object class="IBOutletConnection" key="connection">
-                                               <string key="label">dataSource</string>
-                                               <reference key="source" ref="365506042"/>
-                                               <reference key="destination" ref="1007832501"/>
-                                       </object>
-                                       <int key="connectionID">647</int>
-                               </object>
-                               <object class="IBConnectionRecord">
-                                       <object class="IBOutletConnection" key="connection">
-                                               <string key="label">delegate</string>
-                                               <reference key="source" ref="365506042"/>
-                                               <reference key="destination" ref="1007832501"/>
-                                       </object>
-                                       <int key="connectionID">696</int>
-                               </object>
-                               <object class="IBConnectionRecord">
-                                       <object class="IBOutletConnection" key="connection">
-                                               <string key="label">delegate</string>
-                                               <reference key="source" ref="206489479"/>
-                                               <reference key="destination" ref="207406104"/>
-                                       </object>
-                                       <int key="connectionID">892</int>
-                               </object>
-                               <object class="IBConnectionRecord">
-                                       <object class="IBOutletConnection" key="connection">
-                                               <string key="label">radioButtons</string>
-                                               <reference key="source" ref="801536542"/>
-                                               <reference key="destination" ref="120408205"/>
-                                       </object>
-                                       <int key="connectionID">692</int>
-                               </object>
-                               <object class="IBConnectionRecord">
-                                       <object class="IBOutletConnection" key="connection">
-                                               <string key="label">title</string>
-                                               <reference key="source" ref="801536542"/>
-                                               <reference key="destination" ref="1016088174"/>
-                                       </object>
-                                       <int key="connectionID">709</int>
-                               </object>
-                               <object class="IBConnectionRecord">
-                                       <object class="IBActionConnection" key="connection">
-                                               <string key="label">radioChanged:</string>
-                                               <reference key="source" ref="801536542"/>
-                                               <reference key="destination" ref="120408205"/>
-                                       </object>
-                                       <int key="connectionID">731</int>
-                               </object>
-                               <object class="IBConnectionRecord">
-                                       <object class="IBOutletConnection" key="connection">
-                                               <string key="label">mouseBtnSelect</string>
-                                               <reference key="source" ref="801536542"/>
-                                               <reference key="destination" ref="125828224"/>
-                                       </object>
-                                       <int key="connectionID">746</int>
-                               </object>
-                               <object class="IBConnectionRecord">
-                                       <object class="IBActionConnection" key="connection">
-                                               <string key="label">mbtnChanged:</string>
-                                               <reference key="source" ref="801536542"/>
-                                               <reference key="destination" ref="125828224"/>
-                                       </object>
-                                       <int key="connectionID">747</int>
-                               </object>
-                               <object class="IBConnectionRecord">
-                                       <object class="IBOutletConnection" key="connection">
-                                               <string key="label">scrollDirSelect</string>
-                                               <reference key="source" ref="801536542"/>
-                                               <reference key="destination" ref="921829691"/>
-                                       </object>
-                                       <int key="connectionID">751</int>
-                               </object>
-                               <object class="IBConnectionRecord">
-                                       <object class="IBActionConnection" key="connection">
-                                               <string key="label">sdirChanged:</string>
-                                               <reference key="source" ref="801536542"/>
-                                               <reference key="destination" ref="921829691"/>
-                                       </object>
-                                       <int key="connectionID">752</int>
-                               </object>
-                               <object class="IBConnectionRecord">
-                                       <object class="IBOutletConnection" key="connection">
-                                               <string key="label">mouseDirSelect</string>
-                                               <reference key="source" ref="801536542"/>
-                                               <reference key="destination" ref="875916470"/>
-                                       </object>
-                                       <int key="connectionID">756</int>
-                               </object>
-                               <object class="IBConnectionRecord">
-                                       <object class="IBActionConnection" key="connection">
-                                               <string key="label">mdirChanged:</string>
-                                               <reference key="source" ref="801536542"/>
-                                               <reference key="destination" ref="875916470"/>
-                                       </object>
-                                       <int key="connectionID">757</int>
-                               </object>
-                               <object class="IBConnectionRecord">
-                                       <object class="IBOutletConnection" key="connection">
-                                               <string key="label">keyInput</string>
-                                               <reference key="source" ref="801536542"/>
-                                               <reference key="destination" ref="57697638"/>
-                                       </object>
-                                       <int key="connectionID">781</int>
-                               </object>
-                               <object class="IBConnectionRecord">
-                                       <object class="IBOutletConnection" key="connection">
-                                               <string key="label">mappingsController</string>
-                                               <reference key="source" ref="801536542"/>
-                                               <reference key="destination" ref="468285243"/>
-                                       </object>
-                                       <int key="connectionID">821</int>
-                               </object>
-                               <object class="IBConnectionRecord">
-                                       <object class="IBOutletConnection" key="connection">
-                                               <string key="label">mappingPopup</string>
-                                               <reference key="source" ref="801536542"/>
-                                               <reference key="destination" ref="194275224"/>
-                                       </object>
-                                       <int key="connectionID">823</int>
-                               </object>
-                               <object class="IBConnectionRecord">
-                                       <object class="IBOutletConnection" key="connection">
-                                               <string key="label">inputController</string>
-                                               <reference key="source" ref="801536542"/>
-                                               <reference key="destination" ref="1007832501"/>
-                                       </object>
-                                       <int key="connectionID">828</int>
-                               </object>
-                               <object class="IBConnectionRecord">
-                                       <object class="IBActionConnection" key="connection">
-                                               <string key="label">mouseSpeedChanged:</string>
-                                               <reference key="source" ref="801536542"/>
-                                               <reference key="destination" ref="385416822"/>
-                                       </object>
-                                       <int key="connectionID">885</int>
-                               </object>
-                               <object class="IBConnectionRecord">
-                                       <object class="IBOutletConnection" key="connection">
-                                               <string key="label">mouseSpeedSlider</string>
-                                               <reference key="source" ref="801536542"/>
-                                               <reference key="destination" ref="385416822"/>
-                                       </object>
-                                       <int key="connectionID">886</int>
-                               </object>
-                               <object class="IBConnectionRecord">
-                                       <object class="IBActionConnection" key="connection">
-                                               <string key="label">scrollSpeedChanged:</string>
-                                               <reference key="source" ref="801536542"/>
-                                               <reference key="destination" ref="792189805"/>
-                                       </object>
-                                       <int key="connectionID">890</int>
-                               </object>
-                               <object class="IBConnectionRecord">
-                                       <object class="IBOutletConnection" key="connection">
-                                               <string key="label">scrollSpeedSlider</string>
-                                               <reference key="source" ref="801536542"/>
-                                               <reference key="destination" ref="792189805"/>
-                                       </object>
-                                       <int key="connectionID">891</int>
-                               </object>
-                               <object class="IBConnectionRecord">
-                                       <object class="IBOutletConnection" key="connection">
-                                               <string key="label">keyDelegate</string>
-                                               <reference key="source" ref="57697638"/>
-                                               <reference key="destination" ref="801536542"/>
-                                       </object>
-                                       <int key="connectionID">818</int>
-                               </object>
-                               <object class="IBConnectionRecord">
-                                       <object class="IBActionConnection" key="connection">
-                                               <string key="label">performClick:</string>
-                                               <reference key="source" ref="227597319"/>
-                                               <reference key="destination" ref="914355947"/>
-                                       </object>
-                                       <int key="connectionID">871</int>
-                               </object>
-                               <object class="IBConnectionRecord">
-                                       <object class="IBOutletConnection" key="connection">
-                                               <string key="label">view</string>
-                                               <reference key="source" ref="328152383"/>
-                                               <reference key="destination" ref="671181514"/>
-                                       </object>
-                                       <int key="connectionID">854</int>
-                               </object>
-                               <object class="IBConnectionRecord">
-                                       <object class="IBOutletConnection" key="connection">
-                                               <string key="label">contentViewController</string>
-                                               <reference key="source" ref="586993839"/>
-                                               <reference key="destination" ref="328152383"/>
-                                       </object>
-                                       <int key="connectionID">852</int>
-                               </object>
-                               <object class="IBConnectionRecord">
-                                       <object class="IBOutletConnection" key="connection">
-                                               <string key="label">delegate</string>
-                                               <reference key="source" ref="586993839"/>
-                                               <reference key="destination" ref="468285243"/>
-                                       </object>
-                                       <int key="connectionID">853</int>
-                               </object>
-                               <object class="IBConnectionRecord">
-                                       <object class="IBActionConnection" key="connection">
-                                               <string key="label">performClick:</string>
-                                               <reference key="source" ref="385218002"/>
-                                               <reference key="destination" ref="632598200"/>
-                                       </object>
-                                       <int key="connectionID">880</int>
-                               </object>
-                       </array>
-                       <object class="IBMutableOrderedSet" key="objectRecords">
-                               <array key="orderedObjects">
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">0</int>
-                                               <reference key="object" ref="0"/>
-                                               <reference key="children" ref="1048"/>
-                                               <nil key="parent"/>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">-2</int>
-                                               <reference key="object" ref="1021"/>
-                                               <reference key="parent" ref="0"/>
-                                               <string key="objectName">File's Owner</string>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">-1</int>
-                                               <reference key="object" ref="1014"/>
-                                               <reference key="parent" ref="0"/>
-                                               <string key="objectName">First Responder</string>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">-3</int>
-                                               <reference key="object" ref="1050"/>
-                                               <reference key="parent" ref="0"/>
-                                               <string key="objectName">Application</string>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">29</int>
-                                               <reference key="object" ref="649796088"/>
-                                               <array class="NSMutableArray" key="children">
-                                                       <reference ref="713487014"/>
-                                                       <reference ref="694149608"/>
-                                                       <reference ref="379814623"/>
-                                                       <reference ref="693056251"/>
-                                               </array>
-                                               <reference key="parent" ref="0"/>
-                                               <string key="objectName">Main Menu</string>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">19</int>
-                                               <reference key="object" ref="713487014"/>
-                                               <array class="NSMutableArray" key="children">
-                                                       <reference ref="835318025"/>
-                                               </array>
-                                               <reference key="parent" ref="649796088"/>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">56</int>
-                                               <reference key="object" ref="694149608"/>
-                                               <array class="NSMutableArray" key="children">
-                                                       <reference ref="110575045"/>
-                                               </array>
-                                               <reference key="parent" ref="649796088"/>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">83</int>
-                                               <reference key="object" ref="379814623"/>
-                                               <array class="NSMutableArray" key="children">
-                                                       <reference ref="720053764"/>
-                                               </array>
-                                               <reference key="parent" ref="649796088"/>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">81</int>
-                                               <reference key="object" ref="720053764"/>
-                                               <array class="NSMutableArray" key="children">
-                                                       <reference ref="632598200"/>
-                                                       <reference ref="773548144"/>
-                                                       <reference ref="914355947"/>
-                                                       <reference ref="580069611"/>
-                                                       <reference ref="888617891"/>
-                                                       <reference ref="187155117"/>
-                                               </array>
-                                               <reference key="parent" ref="379814623"/>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">57</int>
-                                               <reference key="object" ref="110575045"/>
-                                               <array class="NSMutableArray" key="children">
-                                                       <reference ref="238522557"/>
-                                                       <reference ref="755159360"/>
-                                                       <reference ref="908899353"/>
-                                                       <reference ref="632727374"/>
-                                                       <reference ref="646227648"/>
-                                                       <reference ref="304266470"/>
-                                                       <reference ref="1046388886"/>
-                                                       <reference ref="1056857174"/>
-                                                       <reference ref="342932134"/>
-                                               </array>
-                                               <reference key="parent" ref="694149608"/>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">58</int>
-                                               <reference key="object" ref="238522557"/>
-                                               <reference key="parent" ref="110575045"/>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">134</int>
-                                               <reference key="object" ref="755159360"/>
-                                               <reference key="parent" ref="110575045"/>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">150</int>
-                                               <reference key="object" ref="908899353"/>
-                                               <reference key="parent" ref="110575045"/>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">136</int>
-                                               <reference key="object" ref="632727374"/>
-                                               <reference key="parent" ref="110575045"/>
-                                               <string key="objectName">Quit Enjoy</string>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">144</int>
-                                               <reference key="object" ref="646227648"/>
-                                               <reference key="parent" ref="110575045"/>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">236</int>
-                                               <reference key="object" ref="304266470"/>
-                                               <reference key="parent" ref="110575045"/>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">131</int>
-                                               <reference key="object" ref="1046388886"/>
-                                               <array class="NSMutableArray" key="children">
-                                                       <reference ref="752062318"/>
-                                               </array>
-                                               <reference key="parent" ref="110575045"/>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">149</int>
-                                               <reference key="object" ref="1056857174"/>
-                                               <reference key="parent" ref="110575045"/>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">145</int>
-                                               <reference key="object" ref="342932134"/>
-                                               <reference key="parent" ref="110575045"/>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">130</int>
-                                               <reference key="object" ref="752062318"/>
-                                               <reference key="parent" ref="1046388886"/>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">24</int>
-                                               <reference key="object" ref="835318025"/>
-                                               <array class="NSMutableArray" key="children">
-                                                       <reference ref="299356726"/>
-                                                       <reference ref="625202149"/>
-                                                       <reference ref="575023229"/>
-                                                       <reference ref="1011231497"/>
-                                               </array>
-                                               <reference key="parent" ref="713487014"/>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">92</int>
-                                               <reference key="object" ref="299356726"/>
-                                               <reference key="parent" ref="835318025"/>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">5</int>
-                                               <reference key="object" ref="625202149"/>
-                                               <reference key="parent" ref="835318025"/>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">239</int>
-                                               <reference key="object" ref="575023229"/>
-                                               <reference key="parent" ref="835318025"/>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">23</int>
-                                               <reference key="object" ref="1011231497"/>
-                                               <reference key="parent" ref="835318025"/>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">450</int>
-                                               <reference key="object" ref="808667431"/>
-                                               <array class="NSMutableArray" key="children">
-                                                       <reference ref="177223957"/>
-                                                       <reference ref="1043384830"/>
-                                               </array>
-                                               <reference key="parent" ref="0"/>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">451</int>
-                                               <reference key="object" ref="671181514"/>
-                                               <array class="NSMutableArray" key="children">
-                                                       <reference ref="443618264"/>
-                                                       <reference ref="456935010"/>
-                                                       <reference ref="149148392"/>
-                                                       <reference ref="861276216"/>
-                                                       <reference ref="1023366520"/>
-                                                       <reference ref="1043784903"/>
-                                               </array>
-                                               <reference key="parent" ref="0"/>
-                                               <string key="objectName">Mapping List Popover Content</string>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">453</int>
-                                               <reference key="object" ref="177223957"/>
-                                               <array class="NSMutableArray" key="children">
-                                                       <reference ref="206489479"/>
-                                               </array>
-                                               <reference key="parent" ref="808667431"/>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">456</int>
-                                               <reference key="object" ref="443618264"/>
-                                               <array class="NSMutableArray" key="children">
-                                                       <reference ref="968378655"/>
-                                                       <reference ref="553414014"/>
-                                                       <reference ref="762432499"/>
-                                               </array>
-                                               <reference key="parent" ref="671181514"/>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">457</int>
-                                               <reference key="object" ref="968378655"/>
-                                               <reference key="parent" ref="443618264"/>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">458</int>
-                                               <reference key="object" ref="553414014"/>
-                                               <reference key="parent" ref="443618264"/>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">459</int>
-                                               <reference key="object" ref="762432499"/>
-                                               <array class="NSMutableArray" key="children">
-                                                       <reference ref="827961598"/>
-                                               </array>
-                                               <reference key="parent" ref="443618264"/>
-                                               <string key="objectName">Mapping List</string>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">461</int>
-                                               <reference key="object" ref="827961598"/>
-                                               <array class="NSMutableArray" key="children">
-                                                       <reference ref="638155037"/>
-                                               </array>
-                                               <reference key="parent" ref="762432499"/>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">464</int>
-                                               <reference key="object" ref="638155037"/>
-                                               <reference key="parent" ref="827961598"/>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">482</int>
-                                               <reference key="object" ref="207406104"/>
-                                               <reference key="parent" ref="0"/>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">487</int>
-                                               <reference key="object" ref="1043384830"/>
-                                               <array class="NSMutableArray" key="children">
-                                                       <reference ref="496378711"/>
-                                                       <reference ref="658903347"/>
-                                                       <reference ref="985167622"/>
-                                               </array>
-                                               <reference key="parent" ref="808667431"/>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">511</int>
-                                               <reference key="object" ref="456935010"/>
-                                               <array class="NSMutableArray" key="children">
-                                                       <reference ref="1008023024"/>
-                                               </array>
-                                               <reference key="parent" ref="671181514"/>
-                                               <string key="objectName">Remove Mapping</string>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">512</int>
-                                               <reference key="object" ref="1008023024"/>
-                                               <reference key="parent" ref="456935010"/>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">514</int>
-                                               <reference key="object" ref="468285243"/>
-                                               <reference key="parent" ref="0"/>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">479</int>
-                                               <reference key="object" ref="1007832501"/>
-                                               <reference key="parent" ref="0"/>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">606</int>
-                                               <reference key="object" ref="632598200"/>
-                                               <reference key="parent" ref="720053764"/>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">652</int>
-                                               <reference key="object" ref="206489479"/>
-                                               <array class="NSMutableArray" key="children">
-                                                       <reference ref="977242492"/>
-                                                       <reference ref="606740242"/>
-                                               </array>
-                                               <reference key="parent" ref="177223957"/>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">653</int>
-                                               <reference key="object" ref="977242492"/>
-                                               <array class="NSMutableArray" key="children">
-                                                       <reference ref="364857164"/>
-                                               </array>
-                                               <reference key="parent" ref="206489479"/>
-                                               <string key="objectName">Input Devices Pane</string>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">634</int>
-                                               <reference key="object" ref="364857164"/>
-                                               <array class="NSMutableArray" key="children">
-                                                       <reference ref="365506042"/>
-                                                       <reference ref="892486973"/>
-                                                       <reference ref="1036252745"/>
-                                               </array>
-                                               <reference key="parent" ref="977242492"/>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">637</int>
-                                               <reference key="object" ref="365506042"/>
-                                               <array class="NSMutableArray" key="children">
-                                                       <reference ref="290995057"/>
-                                               </array>
-                                               <reference key="parent" ref="364857164"/>
-                                               <string key="objectName">Input Device List</string>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">636</int>
-                                               <reference key="object" ref="892486973"/>
-                                               <reference key="parent" ref="364857164"/>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">635</int>
-                                               <reference key="object" ref="1036252745"/>
-                                               <reference key="parent" ref="364857164"/>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">639</int>
-                                               <reference key="object" ref="290995057"/>
-                                               <array class="NSMutableArray" key="children">
-                                                       <reference ref="158646067"/>
-                                               </array>
-                                               <reference key="parent" ref="365506042"/>
-                                               <string key="objectName">Device/Input Name</string>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">642</int>
-                                               <reference key="object" ref="158646067"/>
-                                               <reference key="parent" ref="290995057"/>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">654</int>
-                                               <reference key="object" ref="606740242"/>
-                                               <array class="NSMutableArray" key="children">
-                                                       <reference ref="497528019"/>
-                                                       <reference ref="921829691"/>
-                                                       <reference ref="125828224"/>
-                                                       <reference ref="875916470"/>
-                                                       <reference ref="1016088174"/>
-                                                       <reference ref="194275224"/>
-                                                       <reference ref="57697638"/>
-                                                       <reference ref="792189805"/>
-                                                       <reference ref="385416822"/>
-                                                       <reference ref="120408205"/>
-                                               </array>
-                                               <reference key="parent" ref="206489479"/>
-                                               <string key="objectName">Output Editor Pane</string>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">686</int>
-                                               <reference key="object" ref="801536542"/>
-                                               <reference key="parent" ref="0"/>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">656</int>
-                                               <reference key="object" ref="120408205"/>
-                                               <array class="NSMutableArray" key="children">
-                                                       <reference ref="177186415"/>
-                                                       <reference ref="632642090"/>
-                                                       <reference ref="387494389"/>
-                                                       <reference ref="339215895"/>
-                                                       <reference ref="820968178"/>
-                                                       <reference ref="275466816"/>
-                                                       <reference ref="134694197"/>
-                                               </array>
-                                               <reference key="parent" ref="606740242"/>
-                                               <string key="objectName">Output Types</string>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">657</int>
-                                               <reference key="object" ref="177186415"/>
-                                               <reference key="parent" ref="120408205"/>
-                                               <string key="objectName">Disabled</string>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">658</int>
-                                               <reference key="object" ref="387494389"/>
-                                               <reference key="parent" ref="120408205"/>
-                                               <string key="objectName">Key Press</string>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">699</int>
-                                               <reference key="object" ref="339215895"/>
-                                               <reference key="parent" ref="120408205"/>
-                                               <string key="objectName">Switch Mapping</string>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">700</int>
-                                               <reference key="object" ref="194275224"/>
-                                               <array class="NSMutableArray" key="children">
-                                                       <reference ref="74311158"/>
-                                               </array>
-                                               <reference key="parent" ref="606740242"/>
-                                               <string key="objectName">Mapping Choice List</string>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">701</int>
-                                               <reference key="object" ref="74311158"/>
-                                               <array class="NSMutableArray" key="children">
-                                                       <reference ref="19633006"/>
-                                               </array>
-                                               <reference key="parent" ref="194275224"/>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">702</int>
-                                               <reference key="object" ref="19633006"/>
-                                               <array class="NSMutableArray" key="children"/>
-                                               <reference key="parent" ref="74311158"/>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">706</int>
-                                               <reference key="object" ref="1016088174"/>
-                                               <array class="NSMutableArray" key="children">
-                                                       <reference ref="853503577"/>
-                                               </array>
-                                               <reference key="parent" ref="606740242"/>
-                                               <string key="objectName">Input Name</string>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">707</int>
-                                               <reference key="object" ref="853503577"/>
-                                               <reference key="parent" ref="1016088174"/>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">708</int>
-                                               <reference key="object" ref="497528019"/>
-                                               <reference key="parent" ref="606740242"/>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">723</int>
-                                               <reference key="object" ref="773548144"/>
-                                               <reference key="parent" ref="720053764"/>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">733</int>
-                                               <reference key="object" ref="820968178"/>
-                                               <reference key="parent" ref="120408205"/>
-                                               <string key="objectName">Mouse Movement</string>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">734</int>
-                                               <reference key="object" ref="275466816"/>
-                                               <reference key="parent" ref="120408205"/>
-                                               <string key="objectName">Mouse Button</string>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">735</int>
-                                               <reference key="object" ref="134694197"/>
-                                               <reference key="parent" ref="120408205"/>
-                                               <string key="objectName">Mouse Scroll</string>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">659</int>
-                                               <reference key="object" ref="632642090"/>
-                                               <reference key="parent" ref="120408205"/>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">744</int>
-                                               <reference key="object" ref="125828224"/>
-                                               <array class="NSMutableArray" key="children">
-                                                       <reference ref="514491330"/>
-                                               </array>
-                                               <reference key="parent" ref="606740242"/>
-                                               <string key="objectName">Mouse Button Selector</string>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">745</int>
-                                               <reference key="object" ref="514491330"/>
-                                               <reference key="parent" ref="125828224"/>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">749</int>
-                                               <reference key="object" ref="921829691"/>
-                                               <array class="NSMutableArray" key="children">
-                                                       <reference ref="301345285"/>
-                                               </array>
-                                               <reference key="parent" ref="606740242"/>
-                                               <string key="objectName">Mouse Scroll Selector</string>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">750</int>
-                                               <reference key="object" ref="301345285"/>
-                                               <reference key="parent" ref="921829691"/>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">754</int>
-                                               <reference key="object" ref="875916470"/>
-                                               <array class="NSMutableArray" key="children">
-                                                       <reference ref="241270212"/>
-                                               </array>
-                                               <reference key="parent" ref="606740242"/>
-                                               <string key="objectName">Mouse Motion Selector</string>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">755</int>
-                                               <reference key="object" ref="241270212"/>
-                                               <reference key="parent" ref="875916470"/>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">778</int>
-                                               <reference key="object" ref="57697638"/>
-                                               <reference key="parent" ref="606740242"/>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">812</int>
-                                               <reference key="object" ref="580069611"/>
-                                               <reference key="parent" ref="720053764"/>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">813</int>
-                                               <reference key="object" ref="888617891"/>
-                                               <reference key="parent" ref="720053764"/>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">814</int>
-                                               <reference key="object" ref="187155117"/>
-                                               <reference key="parent" ref="720053764"/>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">837</int>
-                                               <reference key="object" ref="496378711"/>
-                                               <array class="NSMutableArray" key="children">
-                                                       <reference ref="227597319"/>
-                                               </array>
-                                               <reference key="parent" ref="1043384830"/>
-                                               <string key="objectName">Mapping Selector</string>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">835</int>
-                                               <reference key="object" ref="227597319"/>
-                                               <array class="NSMutableArray" key="children">
-                                                       <reference ref="850080795"/>
-                                               </array>
-                                               <reference key="parent" ref="496378711"/>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">836</int>
-                                               <reference key="object" ref="850080795"/>
-                                               <reference key="parent" ref="227597319"/>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">849</int>
-                                               <reference key="object" ref="658903347"/>
-                                               <reference key="parent" ref="1043384830"/>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">850</int>
-                                               <reference key="object" ref="328152383"/>
-                                               <reference key="parent" ref="0"/>
-                                               <string key="objectName">Popover View Controller</string>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">851</int>
-                                               <reference key="object" ref="586993839"/>
-                                               <reference key="parent" ref="0"/>
-                                               <string key="objectName">Mapping List Popover</string>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">507</int>
-                                               <reference key="object" ref="861276216"/>
-                                               <array class="NSMutableArray" key="children">
-                                                       <reference ref="867532725"/>
-                                               </array>
-                                               <reference key="parent" ref="671181514"/>
-                                               <string key="objectName">Add Mapping</string>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">508</int>
-                                               <reference key="object" ref="867532725"/>
-                                               <reference key="parent" ref="861276216"/>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">862</int>
-                                               <reference key="object" ref="149148392"/>
-                                               <array class="NSMutableArray" key="children">
-                                                       <reference ref="517346822"/>
-                                               </array>
-                                               <reference key="parent" ref="671181514"/>
-                                               <string key="objectName">Gradient Space</string>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">863</int>
-                                               <reference key="object" ref="517346822"/>
-                                               <reference key="parent" ref="149148392"/>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">810</int>
-                                               <reference key="object" ref="914355947"/>
-                                               <reference key="parent" ref="720053764"/>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">866</int>
-                                               <reference key="object" ref="693056251"/>
-                                               <array class="NSMutableArray" key="children">
-                                                       <reference ref="997802319"/>
-                                               </array>
-                                               <reference key="parent" ref="649796088"/>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">867</int>
-                                               <reference key="object" ref="997802319"/>
-                                               <array class="NSMutableArray" key="children">
-                                                       <reference ref="842970531"/>
-                                               </array>
-                                               <reference key="parent" ref="693056251"/>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">868</int>
-                                               <reference key="object" ref="842970531"/>
-                                               <reference key="parent" ref="997802319"/>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">874</int>
-                                               <reference key="object" ref="985167622"/>
-                                               <array class="NSMutableArray" key="children">
-                                                       <reference ref="385218002"/>
-                                               </array>
-                                               <reference key="parent" ref="1043384830"/>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">872</int>
-                                               <reference key="object" ref="385218002"/>
-                                               <array class="NSMutableArray" key="children">
-                                                       <reference ref="422366518"/>
-                                               </array>
-                                               <reference key="parent" ref="985167622"/>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">873</int>
-                                               <reference key="object" ref="422366518"/>
-                                               <reference key="parent" ref="385218002"/>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">883</int>
-                                               <reference key="object" ref="385416822"/>
-                                               <array class="NSMutableArray" key="children">
-                                                       <reference ref="5417367"/>
-                                               </array>
-                                               <reference key="parent" ref="606740242"/>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">884</int>
-                                               <reference key="object" ref="5417367"/>
-                                               <reference key="parent" ref="385416822"/>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">887</int>
-                                               <reference key="object" ref="792189805"/>
-                                               <array class="NSMutableArray" key="children">
-                                                       <reference ref="423057230"/>
-                                               </array>
-                                               <reference key="parent" ref="606740242"/>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">888</int>
-                                               <reference key="object" ref="423057230"/>
-                                               <reference key="parent" ref="792189805"/>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">893</int>
-                                               <reference key="object" ref="1023366520"/>
-                                               <array class="NSMutableArray" key="children">
-                                                       <reference ref="57592747"/>
-                                               </array>
-                                               <reference key="parent" ref="671181514"/>
-                                               <string key="objectName">Move Mapping Up</string>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">894</int>
-                                               <reference key="object" ref="57592747"/>
-                                               <reference key="parent" ref="1023366520"/>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">896</int>
-                                               <reference key="object" ref="1043784903"/>
-                                               <array class="NSMutableArray" key="children">
-                                                       <reference ref="828611353"/>
-                                               </array>
-                                               <reference key="parent" ref="671181514"/>
-                                               <string key="objectName">Move Mapping Down</string>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">897</int>
-                                               <reference key="object" ref="828611353"/>
-                                               <reference key="parent" ref="1043784903"/>
-                                       </object>
-                               </array>
-                       </object>
-                       <dictionary class="NSMutableDictionary" key="flattenedProperties">
-                               <string key="-1.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <string key="-2.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <string key="-3.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <string key="130.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <string key="131.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <string key="134.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <string key="136.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <string key="144.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <string key="145.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <string key="149.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <string key="150.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <string key="19.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <string key="23.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <string key="236.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <string key="239.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <string key="24.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <string key="29.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <boolean value="YES" key="450.IBNSWindowAutoPositionCentersHorizontal"/>
-                               <boolean value="YES" key="450.IBNSWindowAutoPositionCentersVertical"/>
-                               <string key="450.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <string key="450.IBWindowTemplateEditedContentRect">{{114, 276}, {770, 487}}</string>
-                               <boolean value="YES" key="450.NSWindowTemplate.visibleAtLaunch"/>
-                               <string key="451.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <string key="453.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <string key="456.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <string key="457.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <string key="458.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <string key="459.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <string key="461.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <string key="464.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <string key="479.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <string key="482.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <string key="487.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <string key="5.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <object class="NSMutableDictionary" key="507.IBAttributePlaceholdersKey">
-                                       <string key="NS.key.0">ToolTip</string>
-                                       <object class="IBToolTipAttribute" key="NS.object.0">
-                                               <string key="name">ToolTip</string>
-                                               <reference key="object" ref="861276216"/>
-                                               <string key="toolTip">Create a new mapping</string>
-                                       </object>
-                               </object>
-                               <string key="507.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <string key="508.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <object class="NSMutableDictionary" key="511.IBAttributePlaceholdersKey">
-                                       <string key="NS.key.0">ToolTip</string>
-                                       <object class="IBToolTipAttribute" key="NS.object.0">
-                                               <string key="name">ToolTip</string>
-                                               <reference key="object" ref="456935010"/>
-                                               <string key="toolTip">Remove the selected mapping</string>
-                                       </object>
-                               </object>
-                               <string key="511.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <string key="512.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <string key="514.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <string key="56.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <string key="57.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <string key="58.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <string key="606.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <string key="634.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <string key="635.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <string key="636.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <string key="637.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <string key="639.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <string key="642.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <string key="652.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <string key="653.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <string key="654.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <string key="656.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <string key="657.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <string key="658.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <string key="659.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <string key="686.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <string key="699.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <string key="700.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <string key="701.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <string key="702.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <string key="706.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <string key="707.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <string key="708.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <string key="723.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <string key="733.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <string key="734.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <string key="735.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <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="749.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <integer value="1" key="750.IBNSSegmentedControlInspectorSelectedSegmentMetadataKey"/>
-                               <string key="750.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <string key="754.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <integer value="1" key="755.IBNSSegmentedControlInspectorSelectedSegmentMetadataKey"/>
-                               <string key="755.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <string key="778.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <string key="81.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <string key="810.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <string key="812.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <string key="813.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <string key="814.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <string key="83.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <object class="NSMutableDictionary" key="835.IBAttributePlaceholdersKey">
-                                       <string key="NS.key.0">ToolTip</string>
-                                       <object class="IBToolTipAttribute" key="NS.object.0">
-                                               <string key="name">ToolTip</string>
-                                               <reference key="object" ref="227597319"/>
-                                               <string key="toolTip">Change the active mapping</string>
-                                       </object>
-                               </object>
-                               <string key="835.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <string key="836.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <string key="837.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <boolean value="NO" key="837.toolbarItem.selectable"/>
-                               <string key="849.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <string key="850.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <string key="851.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <string key="862.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <string key="863.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <string key="866.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <string key="867.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <string key="868.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <object class="NSMutableDictionary" key="872.IBAttributePlaceholdersKey">
-                                       <string key="NS.key.0">ToolTip</string>
-                                       <object class="IBToolTipAttribute" key="NS.object.0">
-                                               <string key="name">ToolTip</string>
-                                               <reference key="object" ref="385218002"/>
-                                               <string key="toolTip">Enable mapped actions</string>
-                                       </object>
-                               </object>
-                               <string key="872.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <string key="873.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <string key="874.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <object class="NSMutableDictionary" key="883.IBAttributePlaceholdersKey">
-                                       <string key="NS.key.0">ToolTip</string>
-                                       <object class="IBToolTipAttribute" key="NS.object.0">
-                                               <string key="name">ToolTip</string>
-                                               <reference key="object" ref="385416822"/>
-                                               <string key="toolTip">Maximum mouse speed</string>
-                                       </object>
-                               </object>
-                               <string key="883.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <string key="884.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <object class="NSMutableDictionary" key="887.IBAttributePlaceholdersKey">
-                                       <string key="NS.key.0">ToolTip</string>
-                                       <object class="IBToolTipAttribute" key="NS.object.0">
-                                               <string key="name">ToolTip</string>
-                                               <reference key="object" ref="792189805"/>
-                                               <string key="toolTip">Mouse scroll speed</string>
-                                       </object>
-                               </object>
-                               <string key="887.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <string key="888.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <object class="NSMutableDictionary" key="893.IBAttributePlaceholdersKey">
-                                       <string key="NS.key.0">ToolTip</string>
-                                       <object class="IBToolTipAttribute" key="NS.object.0">
-                                               <string key="name">ToolTip</string>
-                                               <reference key="object" ref="1023366520"/>
-                                               <string key="toolTip">Move the selected mapping up the list</string>
-                                       </object>
-                               </object>
-                               <string key="893.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <string key="894.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <object class="NSMutableDictionary" key="896.IBAttributePlaceholdersKey">
-                                       <string key="NS.key.0">ToolTip</string>
-                                       <object class="IBToolTipAttribute" key="NS.object.0">
-                                               <string key="name">ToolTip</string>
-                                               <reference key="object" ref="1043784903"/>
-                                               <string key="toolTip">Move the selected mapping down the list</string>
-                                       </object>
-                               </object>
-                               <string key="896.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <string key="897.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <string key="92.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                       </dictionary>
-                       <dictionary class="NSMutableDictionary" key="unlocalizedProperties"/>
-                       <nil key="activeLocalization"/>
-                       <dictionary class="NSMutableDictionary" key="localizations"/>
-                       <nil key="sourceID"/>
-                       <int key="maxID">902</int>
-               </object>
-               <object class="IBClassDescriber" key="IBDocument.Classes">
-                       <array class="NSMutableArray" key="referencedPartialClassDescriptions">
-                               <object class="IBPartialClassDescription">
-                                       <string key="className">EnjoyableApplicationDelegate</string>
-                                       <string key="superclassName">NSObject</string>
-                                       <dictionary class="NSMutableDictionary" key="outlets">
-                                               <string key="dockMenuBase">NSMenu</string>
-                                               <string key="inputController">NJDeviceController</string>
-                                               <string key="mappingsController">NJMappingsController</string>
-                                               <string key="window">NSWindow</string>
-                                       </dictionary>
-                                       <dictionary class="NSMutableDictionary" key="toOneOutletInfosByName">
-                                               <object class="IBToOneOutletInfo" key="dockMenuBase">
-                                                       <string key="name">dockMenuBase</string>
-                                                       <string key="candidateClassName">NSMenu</string>
-                                               </object>
-                                               <object class="IBToOneOutletInfo" key="inputController">
-                                                       <string key="name">inputController</string>
-                                                       <string key="candidateClassName">NJDeviceController</string>
-                                               </object>
-                                               <object class="IBToOneOutletInfo" key="mappingsController">
-                                                       <string key="name">mappingsController</string>
-                                                       <string key="candidateClassName">NJMappingsController</string>
-                                               </object>
-                                               <object class="IBToOneOutletInfo" key="window">
-                                                       <string key="name">window</string>
-                                                       <string key="candidateClassName">NSWindow</string>
-                                               </object>
-                                       </dictionary>
-                                       <object class="IBClassDescriptionSource" key="sourceIdentifier">
-                                               <string key="majorKey">IBProjectSource</string>
-                                               <string key="minorKey">./Classes/EnjoyableApplicationDelegate.h</string>
-                                       </object>
-                               </object>
-                               <object class="IBPartialClassDescription">
-                                       <string key="className">NJDeviceController</string>
-                                       <string key="superclassName">NSObject</string>
-                                       <object class="NSMutableDictionary" key="actions">
-                                               <string key="NS.key.0">translatingEventsChanged:</string>
-                                               <string key="NS.object.0">id</string>
-                                       </object>
-                                       <object class="NSMutableDictionary" key="actionInfosByName">
-                                               <string key="NS.key.0">translatingEventsChanged:</string>
-                                               <object class="IBActionInfo" key="NS.object.0">
-                                                       <string key="name">translatingEventsChanged:</string>
-                                                       <string key="candidateClassName">id</string>
-                                               </object>
-                                       </object>
-                                       <dictionary class="NSMutableDictionary" key="outlets">
-                                               <string key="mappingsController">NJMappingsController</string>
-                                               <string key="outlineView">NSOutlineView</string>
-                                               <string key="outputController">NJOutputController</string>
-                                               <string key="translatingEventsButton">NSButton</string>
-                                               <string key="translatingEventsMenu">NSMenuItem</string>
-                                       </dictionary>
-                                       <dictionary class="NSMutableDictionary" key="toOneOutletInfosByName">
-                                               <object class="IBToOneOutletInfo" key="mappingsController">
-                                                       <string key="name">mappingsController</string>
-                                                       <string key="candidateClassName">NJMappingsController</string>
-                                               </object>
-                                               <object class="IBToOneOutletInfo" key="outlineView">
-                                                       <string key="name">outlineView</string>
-                                                       <string key="candidateClassName">NSOutlineView</string>
-                                               </object>
-                                               <object class="IBToOneOutletInfo" key="outputController">
-                                                       <string key="name">outputController</string>
-                                                       <string key="candidateClassName">NJOutputController</string>
-                                               </object>
-                                               <object class="IBToOneOutletInfo" key="translatingEventsButton">
-                                                       <string key="name">translatingEventsButton</string>
-                                                       <string key="candidateClassName">NSButton</string>
-                                               </object>
-                                               <object class="IBToOneOutletInfo" key="translatingEventsMenu">
-                                                       <string key="name">translatingEventsMenu</string>
-                                                       <string key="candidateClassName">NSMenuItem</string>
-                                               </object>
-                                       </dictionary>
-                                       <object class="IBClassDescriptionSource" key="sourceIdentifier">
-                                               <string key="majorKey">IBProjectSource</string>
-                                               <string key="minorKey">./Classes/NJDeviceController.h</string>
-                                       </object>
-                               </object>
-                               <object class="IBPartialClassDescription">
-                                       <string key="className">NJKeyInputField</string>
-                                       <string key="superclassName">NSTextField</string>
-                                       <object class="NSMutableDictionary" key="outlets">
-                                               <string key="NS.key.0">keyDelegate</string>
-                                               <string key="NS.object.0">id</string>
-                                       </object>
-                                       <object class="NSMutableDictionary" key="toOneOutletInfosByName">
-                                               <string key="NS.key.0">keyDelegate</string>
-                                               <object class="IBToOneOutletInfo" key="NS.object.0">
-                                                       <string key="name">keyDelegate</string>
-                                                       <string key="candidateClassName">id</string>
-                                               </object>
-                                       </object>
-                                       <object class="IBClassDescriptionSource" key="sourceIdentifier">
-                                               <string key="majorKey">IBProjectSource</string>
-                                               <string key="minorKey">./Classes/NJKeyInputField.h</string>
-                                       </object>
-                               </object>
-                               <object class="IBPartialClassDescription">
-                                       <string key="className">NJMappingsController</string>
-                                       <string key="superclassName">NSObject</string>
-                                       <dictionary class="NSMutableDictionary" key="actions">
-                                               <string key="addPressed:">id</string>
-                                               <string key="exportPressed:">id</string>
-                                               <string key="importPressed:">id</string>
-                                               <string key="mappingPressed:">id</string>
-                                               <string key="moveDownPressed:">id</string>
-                                               <string key="moveUpPressed:">id</string>
-                                               <string key="removePressed:">id</string>
-                                       </dictionary>
-                                       <dictionary class="NSMutableDictionary" key="actionInfosByName">
-                                               <object class="IBActionInfo" key="addPressed:">
-                                                       <string key="name">addPressed:</string>
-                                                       <string key="candidateClassName">id</string>
-                                               </object>
-                                               <object class="IBActionInfo" key="exportPressed:">
-                                                       <string key="name">exportPressed:</string>
-                                                       <string key="candidateClassName">id</string>
-                                               </object>
-                                               <object class="IBActionInfo" key="importPressed:">
-                                                       <string key="name">importPressed:</string>
-                                                       <string key="candidateClassName">id</string>
-                                               </object>
-                                               <object class="IBActionInfo" key="mappingPressed:">
-                                                       <string key="name">mappingPressed:</string>
-                                                       <string key="candidateClassName">id</string>
-                                               </object>
-                                               <object class="IBActionInfo" key="moveDownPressed:">
-                                                       <string key="name">moveDownPressed:</string>
-                                                       <string key="candidateClassName">id</string>
-                                               </object>
-                                               <object class="IBActionInfo" key="moveUpPressed:">
-                                                       <string key="name">moveUpPressed:</string>
-                                                       <string key="candidateClassName">id</string>
-                                               </object>
-                                               <object class="IBActionInfo" key="removePressed:">
-                                                       <string key="name">removePressed:</string>
-                                                       <string key="candidateClassName">id</string>
-                                               </object>
-                                       </dictionary>
-                                       <dictionary class="NSMutableDictionary" key="outlets">
-                                               <string key="moveDown">NSButton</string>
-                                               <string key="moveUp">NSButton</string>
-                                               <string key="outputController">NJOutputController</string>
-                                               <string key="popover">NSPopover</string>
-                                               <string key="popoverActivate">NSButton</string>
-                                               <string key="removeButton">NSButton</string>
-                                               <string key="tableView">NSTableView</string>
-                                       </dictionary>
-                                       <dictionary class="NSMutableDictionary" key="toOneOutletInfosByName">
-                                               <object class="IBToOneOutletInfo" key="moveDown">
-                                                       <string key="name">moveDown</string>
-                                                       <string key="candidateClassName">NSButton</string>
-                                               </object>
-                                               <object class="IBToOneOutletInfo" key="moveUp">
-                                                       <string key="name">moveUp</string>
-                                                       <string key="candidateClassName">NSButton</string>
-                                               </object>
-                                               <object class="IBToOneOutletInfo" key="outputController">
-                                                       <string key="name">outputController</string>
-                                                       <string key="candidateClassName">NJOutputController</string>
-                                               </object>
-                                               <object class="IBToOneOutletInfo" key="popover">
-                                                       <string key="name">popover</string>
-                                                       <string key="candidateClassName">NSPopover</string>
-                                               </object>
-                                               <object class="IBToOneOutletInfo" key="popoverActivate">
-                                                       <string key="name">popoverActivate</string>
-                                                       <string key="candidateClassName">NSButton</string>
-                                               </object>
-                                               <object class="IBToOneOutletInfo" key="removeButton">
-                                                       <string key="name">removeButton</string>
-                                                       <string key="candidateClassName">NSButton</string>
-                                               </object>
-                                               <object class="IBToOneOutletInfo" key="tableView">
-                                                       <string key="name">tableView</string>
-                                                       <string key="candidateClassName">NSTableView</string>
-                                               </object>
-                                       </dictionary>
-                                       <object class="IBClassDescriptionSource" key="sourceIdentifier">
-                                               <string key="majorKey">IBProjectSource</string>
-                                               <string key="minorKey">./Classes/NJMappingsController.h</string>
-                                       </object>
-                               </object>
-                               <object class="IBPartialClassDescription">
-                                       <string key="className">NJOutputController</string>
-                                       <string key="superclassName">NSObject</string>
-                                       <dictionary class="NSMutableDictionary" key="actions">
-                                               <string key="mbtnChanged:">id</string>
-                                               <string key="mdirChanged:">id</string>
-                                               <string key="mouseSpeedChanged:">id</string>
-                                               <string key="radioChanged:">id</string>
-                                               <string key="scrollSpeedChanged:">id</string>
-                                               <string key="sdirChanged:">id</string>
-                                       </dictionary>
-                                       <dictionary class="NSMutableDictionary" key="actionInfosByName">
-                                               <object class="IBActionInfo" key="mbtnChanged:">
-                                                       <string key="name">mbtnChanged:</string>
-                                                       <string key="candidateClassName">id</string>
-                                               </object>
-                                               <object class="IBActionInfo" key="mdirChanged:">
-                                                       <string key="name">mdirChanged:</string>
-                                                       <string key="candidateClassName">id</string>
-                                               </object>
-                                               <object class="IBActionInfo" key="mouseSpeedChanged:">
-                                                       <string key="name">mouseSpeedChanged:</string>
-                                                       <string key="candidateClassName">id</string>
-                                               </object>
-                                               <object class="IBActionInfo" key="radioChanged:">
-                                                       <string key="name">radioChanged:</string>
-                                                       <string key="candidateClassName">id</string>
-                                               </object>
-                                               <object class="IBActionInfo" key="scrollSpeedChanged:">
-                                                       <string key="name">scrollSpeedChanged:</string>
-                                                       <string key="candidateClassName">id</string>
-                                               </object>
-                                               <object class="IBActionInfo" key="sdirChanged:">
-                                                       <string key="name">sdirChanged:</string>
-                                                       <string key="candidateClassName">id</string>
-                                               </object>
-                                       </dictionary>
-                                       <dictionary class="NSMutableDictionary" key="outlets">
-                                               <string key="inputController">NJDeviceController</string>
-                                               <string key="keyInput">NJKeyInputField</string>
-                                               <string key="mappingPopup">NSPopUpButton</string>
-                                               <string key="mappingsController">NJMappingsController</string>
-                                               <string key="mouseBtnSelect">NSSegmentedControl</string>
-                                               <string key="mouseDirSelect">NSSegmentedControl</string>
-                                               <string key="mouseSpeedSlider">NSSlider</string>
-                                               <string key="radioButtons">NSMatrix</string>
-                                               <string key="scrollDirSelect">NSSegmentedControl</string>
-                                               <string key="scrollSpeedSlider">NSSlider</string>
-                                               <string key="title">NSTextField</string>
-                                       </dictionary>
-                                       <dictionary class="NSMutableDictionary" key="toOneOutletInfosByName">
-                                               <object class="IBToOneOutletInfo" key="inputController">
-                                                       <string key="name">inputController</string>
-                                                       <string key="candidateClassName">NJDeviceController</string>
-                                               </object>
-                                               <object class="IBToOneOutletInfo" key="keyInput">
-                                                       <string key="name">keyInput</string>
-                                                       <string key="candidateClassName">NJKeyInputField</string>
-                                               </object>
-                                               <object class="IBToOneOutletInfo" key="mappingPopup">
-                                                       <string key="name">mappingPopup</string>
-                                                       <string key="candidateClassName">NSPopUpButton</string>
-                                               </object>
-                                               <object class="IBToOneOutletInfo" key="mappingsController">
-                                                       <string key="name">mappingsController</string>
-                                                       <string key="candidateClassName">NJMappingsController</string>
-                                               </object>
-                                               <object class="IBToOneOutletInfo" key="mouseBtnSelect">
-                                                       <string key="name">mouseBtnSelect</string>
-                                                       <string key="candidateClassName">NSSegmentedControl</string>
-                                               </object>
-                                               <object class="IBToOneOutletInfo" key="mouseDirSelect">
-                                                       <string key="name">mouseDirSelect</string>
-                                                       <string key="candidateClassName">NSSegmentedControl</string>
-                                               </object>
-                                               <object class="IBToOneOutletInfo" key="mouseSpeedSlider">
-                                                       <string key="name">mouseSpeedSlider</string>
-                                                       <string key="candidateClassName">NSSlider</string>
-                                               </object>
-                                               <object class="IBToOneOutletInfo" key="radioButtons">
-                                                       <string key="name">radioButtons</string>
-                                                       <string key="candidateClassName">NSMatrix</string>
-                                               </object>
-                                               <object class="IBToOneOutletInfo" key="scrollDirSelect">
-                                                       <string key="name">scrollDirSelect</string>
-                                                       <string key="candidateClassName">NSSegmentedControl</string>
-                                               </object>
-                                               <object class="IBToOneOutletInfo" key="scrollSpeedSlider">
-                                                       <string key="name">scrollSpeedSlider</string>
-                                                       <string key="candidateClassName">NSSlider</string>
-                                               </object>
-                                               <object class="IBToOneOutletInfo" key="title">
-                                                       <string key="name">title</string>
-                                                       <string key="candidateClassName">NSTextField</string>
-                                               </object>
-                                       </dictionary>
-                                       <object class="IBClassDescriptionSource" key="sourceIdentifier">
-                                               <string key="majorKey">IBProjectSource</string>
-                                               <string key="minorKey">./Classes/NJOutputController.h</string>
-                                       </object>
-                               </object>
-                       </array>
-               </object>
-               <int key="IBDocument.localizationMode">0</int>
-               <string key="IBDocument.TargetRuntimeIdentifier">IBCocoaFramework</string>
-               <bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
-               <int key="IBDocument.defaultPropertyAccessControl">3</int>
-               <dictionary class="NSMutableDictionary" key="IBDocument.LastKnownImageSizes">
-                       <string key="NSAddTemplate">{8, 8}</string>
-                       <string key="NSListViewTemplate">{11, 10}</string>
-                       <string key="NSMenuCheckmark">{11, 11}</string>
-                       <string key="NSMenuMixedState">{10, 3}</string>
-                       <string key="NSRadioButton">{16, 15}</string>
-                       <string key="NSRemoveTemplate">{8, 8}</string>
-                       <string key="NSRightFacingTriangleTemplate">{9, 9}</string>
-               </dictionary>
-       </data>
-</archive>
diff --git a/EnjoyableApplicationDelegate.h b/EnjoyableApplicationDelegate.h
deleted file mode 100644 (file)
index b795a92..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-//
-//  EnjoyableApplicationDelegate.h
-//  Enjoy
-//
-//  Created by Sam McCall on 4/05/09.
-//  Copyright 2009 University of Otago. All rights reserved.
-//
-
-@class NJDeviceController;
-@class NJOutputController;
-@class NJMappingsController;
-
-@interface EnjoyableApplicationDelegate : NSObject <NSApplicationDelegate,
-                                                    NSSplitViewDelegate>
-{
-    IBOutlet NSMenu *dockMenuBase;
-    IBOutlet NSWindow *window;
-}
-
-@property (nonatomic, strong) IBOutlet NJDeviceController *inputController;
-@property (nonatomic, strong) IBOutlet NJMappingsController *mappingsController;
-
-@end
diff --git a/EnjoyableApplicationDelegate.m b/EnjoyableApplicationDelegate.m
deleted file mode 100644 (file)
index c477511..0000000
+++ /dev/null
@@ -1,155 +0,0 @@
-//
-//  EnjoyableApplicationDelegate.m
-//  Enjoy
-//
-//  Created by Sam McCall on 4/05/09.
-//
-
-#import "EnjoyableApplicationDelegate.h"
-
-#import "NJMapping.h"
-#import "NJMappingsController.h"
-#import "NJDeviceController.h"
-#import "NJOutputController.h"
-#import "NJEvents.h"
-
-@implementation EnjoyableApplicationDelegate
-
-- (void)didSwitchApplication:(NSNotification *)note {
-    NSRunningApplication *activeApp = note.userInfo[NSWorkspaceApplicationKey];
-    NSString *name = activeApp.localizedName;
-    if (!name)
-        name = activeApp.bundleIdentifier;
-    if (name && ![name isEqualToString:NSRunningApplication.currentApplication.localizedName])
-        [self.mappingsController activateMappingForProcess:name];
-}
-
-- (void)applicationDidFinishLaunching:(NSNotification *)notification {
-    [NSNotificationCenter.defaultCenter
-        addObserver:self
-        selector:@selector(mappingDidChange:)
-        name:NJEventMappingChanged
-        object:nil];
-    [NSNotificationCenter.defaultCenter
-        addObserver:self
-        selector:@selector(mappingListDidChange:)
-        name:NJEventMappingListChanged
-        object:nil];
-    [NSNotificationCenter.defaultCenter
-        addObserver:self
-        selector:@selector(eventTranslationActivated:)
-        name:NJEventTranslationActivated
-        object:nil];
-    [NSNotificationCenter.defaultCenter
-        addObserver:self
-        selector:@selector(eventTranslationDeactivated:)
-        name:NJEventTranslationDeactivated
-        object:nil];
-
-    [self.inputController setup];
-    [self.mappingsController load];
-}
-
-- (void)applicationDidBecomeActive:(NSNotification *)notification {
-    [window makeKeyAndOrderFront:nil];
-}
-
-- (BOOL)applicationShouldHandleReopen:(NSApplication *)theApplication
-                    hasVisibleWindows:(BOOL)flag {
-    [window makeKeyAndOrderFront:nil];
-    return NO;
-}
-
-- (void)eventTranslationActivated:(NSNotification *)note {
-    [NSProcessInfo.processInfo disableAutomaticTermination:@"Input translation is active."];
-    [NSWorkspace.sharedWorkspace.notificationCenter
-        addObserver:self
-        selector:@selector(didSwitchApplication:)
-        name:NSWorkspaceDidActivateApplicationNotification
-        object:nil];
-    NSLog(@"Listening for application changes.");
-}
-
-- (void)eventTranslationDeactivated:(NSNotification *)note {
-    [NSProcessInfo.processInfo enableAutomaticTermination:@"Input translation is active."];
-    [NSWorkspace.sharedWorkspace.notificationCenter
-        removeObserver:self
-        name:NSWorkspaceDidActivateApplicationNotification
-        object:nil];
-    NSLog(@"Ignoring application changes.");
-}
-
-- (void)mappingListDidChange:(NSNotification *)note {
-    NSArray *mappings = note.object;
-    while (dockMenuBase.lastItem.representedObject)
-        [dockMenuBase removeLastItem];
-    int added = 0;
-    for (NJMapping *mapping in mappings) {
-        NSString *keyEquiv = ++added < 10 ? @(added).stringValue : @"";
-        NSMenuItem *item = [[NSMenuItem alloc] initWithTitle:mapping.name
-                                                      action:@selector(chooseMapping:)
-                                               keyEquivalent:keyEquiv];
-        item.representedObject = mapping;
-        item.state = mapping == self.mappingsController.currentMapping;
-        [dockMenuBase addItem:item];
-    }
-}
-
-- (void)mappingDidChange:(NSNotification *)note {
-    NJMapping *current = note.object;
-    for (NSMenuItem *item in dockMenuBase.itemArray)
-        if (item.representedObject)
-            item.state = item.representedObject == current;
-}
-
-- (void)chooseMapping:(NSMenuItem *)sender {
-    NJMapping *chosen = sender.representedObject;
-    [self.mappingsController activateMapping:chosen];
-}
-
-#define OUTPUT_PANE_MIN_WIDTH 390
-
-- (CGFloat)splitView:(NSSplitView *)sender constrainMaxCoordinate:(CGFloat)proposedMax ofSubviewAt:(NSInteger)offset {
-    return proposedMax - OUTPUT_PANE_MIN_WIDTH;
-}
-
-- (void)splitView:(NSSplitView *)splitView resizeSubviewsWithOldSize:(NSSize)oldSize {
-    NSView *inputView = splitView.subviews[0];
-    NSView *outputView = splitView.subviews[1];
-    if (outputView.frame.size.width < OUTPUT_PANE_MIN_WIDTH) {
-        NSSize frameSize = splitView.frame.size;
-        CGFloat inputWidth = frameSize.width - OUTPUT_PANE_MIN_WIDTH - splitView.dividerThickness;
-        inputView.frame = NSMakeRect(inputWidth, frameSize.height,
-                                    inputView.frame.size.width,
-                                    inputView.frame.size.height);
-        outputView.frame = NSMakeRect(inputWidth + splitView.dividerThickness,
-                                     0,
-                                     OUTPUT_PANE_MIN_WIDTH,
-                                     frameSize.height);
-    } else
-        [splitView adjustSubviews];
-}
-
-- (NSMenu *)applicationDockMenu:(NSApplication *)sender {
-    NSMenu *menu = [[NSMenu alloc] init];
-    int added = 0;
-    for (NJMapping *mapping in self.mappingsController) {
-        NSString *keyEquiv = ++added < 10 ? @(added).stringValue : @"";
-        NSMenuItem *item = [[NSMenuItem alloc] initWithTitle:mapping.name
-                                                      action:@selector(chooseMapping:)
-                                               keyEquivalent:keyEquiv];
-        item.representedObject = mapping;
-        item.state = mapping == self.mappingsController.currentMapping;
-        [menu addItem:item];
-    }
-    return menu;
-}
-
-- (BOOL)application:(NSApplication *)sender openFile:(NSString *)filename {
-    NSURL *url = [NSURL fileURLWithPath:filename];
-    [self.mappingsController addMappingWithContentsOfURL:url];
-    return YES;
-}
-
-
-@end
diff --git a/Enjoyable_Prefix.pch b/Enjoyable_Prefix.pch
deleted file mode 100644 (file)
index 4845e9d..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-//
-// Prefix header for all source files of the 'Enjoy' target in the 'Enjoy' project
-//
-
-#ifdef __OBJC__
-    #import <Cocoa/Cocoa.h>
-#endif
-
-#import <IOKit/hid/IOHIDLib.h>
-
-#import "NSError+Description.h"
-#import "NSMenu+RepresentedObjectAccessors.h"
-#import "NSView+FirstResponder.h"
-#import "NSMutableArray+MoveObject.h"
-#import "NSFileManager+UniqueNames.h"
-#import "NSString+FixFilename.h"
diff --git a/Help/Contents/Info.plist b/Help/Contents/Info.plist
deleted file mode 100644 (file)
index e62b80f..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
-       <key>CFBundleIdentifier</key>
-       <string>com.yukkurigames.Enjoyable.help</string>
-       <key>CFBundleDevelopmentRegion</key>
-       <string>en_US</string>
-       <key>CFBundleInfoDictionaryVersion</key>
-       <string>6.0</string>
-       <key>CFBundleName</key>
-       <string>Enjoyable</string>
-       <key>CFBundlePackageType</key>
-       <string>BNDL</string>
-       <key>CFBundleShortVersionString</key>
-       <string>1</string>
-       <key>CFBundleSignature</key>
-       <string>hbwr</string>
-       <key>CFBundleVersion</key>
-       <string>1</string>
-       <key>HPDBookAccessPath</key>
-       <string>index.html</string>
-       <key>HPDBookIconPath</key>
-       <string>gfx/Icon.png</string>
-       <key>HPDBookIndexPath</key>
-       <string>Enjoyable.helpindex</string>
-       <key>HPDBookKBProduct</key>
-       <string>enjoyable1</string>
-       <key>HPDBookTitle</key>
-       <string>Enjoyable Help</string>
-       <key>HPDBookType</key>
-       <string>3</string>
-</dict>
-</plist>
diff --git a/Help/Contents/Resources/English.lproj/Makefile b/Help/Contents/Resources/English.lproj/Makefile
deleted file mode 100644 (file)
index 51a8466..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/usr/bin/make -f
-
-HTML := *.html pgs/*.html
-
-all: Enjoyable.helpindex
-
-Enjoyable.helpindex: $(HTML)
-       hiutil -C -f $@ -g -a -s en .
diff --git a/Help/Contents/Resources/English.lproj/gfx/Icon.png b/Help/Contents/Resources/English.lproj/gfx/Icon.png
deleted file mode 100644 (file)
index 36c4254..0000000
Binary files a/Help/Contents/Resources/English.lproj/gfx/Icon.png and /dev/null differ
diff --git a/Help/Contents/Resources/English.lproj/index.html b/Help/Contents/Resources/English.lproj/index.html
deleted file mode 100644 (file)
index 1a52296..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-  <head>
-    <title>Enjoyable Help</title>
-    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
-    <meta name="AppleTitle" content="com.yukkurigames.Enjoyable.help" />
-    <meta name="AppleIcon" content="gfx/Icon.png" />
-    <meta name="robots" content="anchors" />
-    <link href="sty/default.css" rel="stylesheet" type="text/css" media="all"/>
-  </head>
-  
-  <body>
-    <a name="home"></a>
-    
-    <div id="navbox">
-      <div id="navrightbox">
-      </div>
-    </div>
-    
-    <div id="headerbox">
-      <div id="iconbox">
-        <img id="iconimg" src="gfx/Icon.png" alt="Enjoyable Icon" height="32" width="32"/>
-      </div>
-      <div id="pagetitlebox">
-        <h1>Enjoyable Help</h1>
-      </div>
-    </div>
-    
-    <p style="margin-bottom: 2em">
-      Enjoyable helps you use a joystick or gamepad to control
-      applications which normally require a keyboard and mouse.
-    </p>
-
-    <div style="display: table-cell; width: 40%; padding-right: 1em">
-      <h3>Quick Start</h3>
-      <ul>
-        <li>Connect a joystick or gamepad.</li>
-        <li>Press a button on it, then the keyboard key you want to use.</li>
-        <li>Press the ▶ button in the upper-right.</li>
-        <li>Start up your game and use your gamepad!</li>
-      </ol>
-    </div>
-
-    <div style="display: table-cell; width: 60%; border-left: solid #666 1px; padding-left: 1em; margin-top: 1em">
-      <p>
-        <a href="help:anchor='keyboard' bookID='com.yukkurigames.Enjoyable.help'">
-          Keyboard Events
-        </a><br />
-        Map buttons to keys on a keyboard.
-      </p>
-      <p>
-        <a href="help:anchor='mouse' bookID='com.yukkurigames.Enjoyable.help'">
-          Mouse Events
-        </a><br />
-        Use axes and buttons to simulate a mouse.
-      </p>
-      <p>
-        <a href="help:anchor='mappings' bookID='com.yukkurigames.Enjoyable.help'">
-          Application Mappings
-        </a><br />
-        Create and share mappings for different applications.
-      </p>
-      <p>
-        <a href="help:anchor='problems' bookID='com.yukkurigames.Enjoyable.help'">
-          Troubleshooting
-        </a><br />
-        Assistance for common problems.
-      </p>
-    </div>
-
-    <p style="border-top: #777 solid 1px; text-align: center; margin-top: 2em">
-      <a class="weblink" href="help:anchor='boring' bookID='com.yukkurigames.Enjoyable.help'">
-        license</a>
-      -
-      <a class="weblink" href="http://yukkurigames.com/enjoyable">
-        website</a>
-    </p>
-
-  </body>
-</html>
diff --git a/Help/Contents/Resources/English.lproj/pgs/boring.html b/Help/Contents/Resources/English.lproj/pgs/boring.html
deleted file mode 100644 (file)
index 45c6719..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
-          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-  <head>
-    <title>License &amp; Copyright</title>
-    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
-    <link href="../sty/default.css"
-          rel="stylesheet"
-          type="text/css"
-          media="all"/>
-  </head>
-  
-  <body>
-    <a name="boring"></a>
-    
-    <div id="navbox">
-      <div id="navleftbox">
-        <a class="navlink_left"
-           href="help:anchor='home' bookID='com.yukkurigames.Enjoyable.help'">
-          Home
-        </a>
-      </div>
-    </div>
-    
-    <div id="headerbox">
-      <div id="iconbox">
-        <img id="iconimg"
-             src="../gfx/Icon.png"
-             alt="Icon"
-             height="32" width="32"/>
-      </div>
-      <h1>License &amp; Copyright</h1>
-    </div>
-
-    <h3><a name="copyright"></a>Copyright</h3>
-    <p>
-      2013 Joe Wreschnig<br />
-      2012 Yifeng Huang<br />
-      2009 Sam McCall &amp; the University of Otago
-    </p>
-
-    <h3><a name="license"></a>License</h3>
-    <p>
-      Permission is hereby granted, free of charge, to any person
-      obtaining a copy of this software and associated documentation
-      files (the "Software"), to deal in the Software without
-      restriction, including without limitation the rights to use,
-      copy, modify, merge, publish, distribute, sublicense, and/or
-      sell copies of the Software, and to permit persons to whom the
-      Software is furnished to do so, subject to the following
-      conditions:
-    </p>
-    <p>
-      The above copyright notice and this permission notice shall be
-      included in all copies or substantial portions of the Software.
-    </p>
-    <p>
-      THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-      EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
-      OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-      NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-      HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-      WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-      FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-      OTHER DEALINGS IN THE SOFTWARE.
-    </p>
-    <p>
-      The joystick icon is from the Tango icon set and is public
-      domain.
-    </p>
-  </body>
-</html>
diff --git a/Help/Contents/Resources/English.lproj/pgs/keyboard.html b/Help/Contents/Resources/English.lproj/pgs/keyboard.html
deleted file mode 100644 (file)
index dca6136..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
-          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-  <head>
-    <title>Keyboard Events</title>
-    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
-    <link href="../sty/default.css"
-          rel="stylesheet"
-          type="text/css"
-          media="all"/>
-  </head>
-  
-  <body>
-    <a name="keyboard"></a>
-    
-    <div id="navbox">
-      <div id="navleftbox">
-        <a class="navlink_left"
-           href="help:anchor='home' bookID='com.yukkurigames.Enjoyable.help'">
-          Home
-        </a>
-      </div>
-    </div>
-    
-    <div id="headerbox">
-      <div id="iconbox">
-        <img id="iconimg"
-             src="../gfx/Icon.png"
-             alt="Enjoyable Icon"
-             height="32" width="32"/>
-      </div>
-      <h1>Keyboard Events</h1>
-    </div>
-
-    <p>
-      Enjoyable supports mapping joystick buttons, hat switches, and
-      axis thresholds to simulate keyboard keys. First disable
-      mapping by deactivating the ▶ button in the top left. Then press
-      the button on the joystick you want to map. This will select it
-      on the left-hand side of the screen.
-    </p>
-
-    <p>
-      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 <b>Press a
-      key</b> label or input field, then press the key.
-    </p>
-
-    <p>
-      To change a key without disabling mapping you can choose the
-      input's entry in the sidebar directly.
-    </p>
-
-    <h3><a name="clear_key"></a>Clearing the Selection</h3>
-    <p>
-      To clear a mapped key either select the <b>Do nothing</b>
-      option or press ⌥⌫ when the key input field is selected.
-    </p>
-
-    <h3><a name="cancel_key"></a>Cancelling the Selection</h3>
-    <p>
-      If you select the key input field by mistake you can press ⌥⎋
-      to cancel the selection without changing the current setting.
-    </p>
-  </body>
-</html>
diff --git a/Help/Contents/Resources/English.lproj/pgs/mappings.html b/Help/Contents/Resources/English.lproj/pgs/mappings.html
deleted file mode 100644 (file)
index 3b181ff..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
-          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-  <head>
-    <title>Application Mappings</title>
-    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
-    <link href="../sty/default.css"
-          rel="stylesheet"
-          type="text/css"
-          media="all"/>
-  </head>
-  
-  <body>
-    <a name="mappings"></a>
-    
-    <div id="navbox">
-      <div id="navleftbox">
-        <a class="navlink_left"
-           href="help:anchor='home' bookID='com.yukkurigames.Enjoyable.help'">
-          Home
-        </a>
-      </div>
-    </div>
-    
-    <div id="headerbox">
-      <div id="iconbox">
-        <img id="iconimg"
-             src="../gfx/Icon.png"
-             alt="Icon"
-             height="32" width="32"/>
-      </div>
-      <h1>Application Mappings</h1>
-    </div>
-
-    <p>
-      You can make many different mappings and switch between them
-      easily.  To open the list of mappings click the button at the
-      top-left or press ⌘L.
-    </p>
-
-    <p>
-      Click on a mapping to switch to it. Create a new mapping with
-      the + button or pressing ⌘N. Delete the current mapping with
-      the - button or ⌘⌫. Rename a mapping by double-clicking on it or
-      pressing Return while it's selected.
-    </p>
-
-    <p>
-      You can also switch mappings with the <b>Mappings</b> menu, with
-      Enjoyable's dock menu, or by pressing ⌘1 through ⌘9.
-    </p>
-
-    <p>
-      Switching mappings can also be mapped to an input. Select the
-      input you wish to use and then choose a mapping from
-      the <b>Switch to mapping</b> option. For example, you could have
-      one mapping for a game's menu and another for its main screen
-      and switch between them in-game without returning to Enjoyable.
-    </p>
-
-    <h3><a name="automatic"></a>Automatic Switching</h3>
-    <p>
-      If you name a mapping after an application it will be
-      automatically chosen when you switch to that application. The
-      name of an application is usually shown on the dock when you
-      hover your mouse over it. If you don't know the name of the
-      application you want to create a mapping for, create a mapping
-      with the name <kbd>@Application</kbd> (note the <kbd>@</kbd> at
-      the start). The mapping will automatically be renamed for the
-      next application you switch to while it's enabled.
-    </p>
-
-    <h3><a name="sharing"></a>Import and Export</h3>
-    <p>
-      Mappings can be exported and shared with other people. To export
-      your current mapping choose <b>Mappings > Export…</b> and pick a
-      location to save the file. This file can be shared with anyone;
-      it doesn't contain any personal information other than the
-      product IDs of the input devices you used and what you mapped
-      them to.
-    </p>
-    <p>
-      To import a mapping choose <b>Mappings > Import…</b> and select
-      the file you want to import. Mapping files end
-      with <kbd>.enjoyable</kbd> (the default), <kbd>.json</kbd>,
-      or <kbd>.txt</kbd>. If the imported mapping conflicts with one
-      you already made, you can choose to merge the two mappings or
-      create a new one with the same name.
-    </p>
-    <p>
-      You can also import mappings by opening them in Finder or
-      dragging the files onto the mapping list. Similarly, you can
-      export mappings by dragging them from the mapping list to
-      Finder.
-    </p>
-    </body>
-</html>
diff --git a/Help/Contents/Resources/English.lproj/pgs/mouse.html b/Help/Contents/Resources/English.lproj/pgs/mouse.html
deleted file mode 100644 (file)
index 0293fd0..0000000
+++ /dev/null
@@ -1,102 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
-          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-  <head>
-    <title>Mouse Events</title>
-    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
-    <link href="../sty/default.css"
-          rel="stylesheet"
-          type="text/css"
-          media="all"/>
-  </head>
-  
-  <body>
-    <a name="mouse"></a>
-    
-    <div id="navbox">
-      <div id="navleftbox">
-        <a class="navlink_left"
-           href="help:anchor='home' bookID='com.yukkurigames.Enjoyable.help'">
-          Home
-        </a>
-      </div>
-    </div>
-    
-    <div id="headerbox">
-      <div id="iconbox">
-        <img id="iconimg"
-             src="../gfx/Icon.png"
-             alt="Icon"
-             height="32" width="32"/>
-      </div>
-      <h1>Mouse Events</h1>
-    </div>
-
-    <p>
-      You can use Enjoyable to map input to mouse buttons, moving, and
-      scrolling.
-    </p>
-
-    <h3>Movement</h3>
-    <p>
-      Select the direction you'd like the input to move the
-      mouse. Adjust the movement speed using the slider underneath.  If
-      you are mapping an analog input then this is the maximum speed;
-      for a button it's a constant speed.
-    </p>
-    <p>
-      The speed is set independently for each input. You can have
-      faster horizontal movement than vertical movement, or map one
-      set of inputs to a fast speed and another set to a slow
-      speed.
-    </p>
-
-    <h3>Buttons</h3>
-    <p>
-      Select the mouse button you'd like the input to simulate.
-    </p>
-
-    <h3><a name="scrolling"></a>Scrolling</h3>
-    <p>
-      Simulated scrolling can be continuous like the scrolling
-      gestures on a trackpad, or discrete like a mouse wheel that
-      clicks as you spin it.
-    </p>
-    <p>
-      To use <em>continuous scrolling</em> choose ↑ or ↓. Use the
-      slider underneath them to adjust the scrolling speed. If you are
-      mapping an analog input then this is the maximum speed; for a
-      button it's a constant speed.
-    <p>
-      To use <em>discrete scrolling</em> choose ⤒ or ⤓. The input
-      will trigger scrolling up or down by exactly one line and stop,
-      regardless of how long you hold the button down or how far
-      you move an analog input.
-    </p>
-    <p>
-      The arrows indicate the direction you would spin a mouse wheel
-      or move your fingers. Depending on settings this may mean you
-      need to choose a down arrow to scroll up and vice versa. You can
-      also change this globally in <b> > System Preferences… >
-      Mouse</b> and <b> > System Preferences… > Trackpad</b>.
-    </p>
-    
-    <h3><a name="mouseissues"></a>Known Issues</h3>
-    <p>
-      Mouse events are more fragile than keyboard ones. While Enjoyble
-      will work fine for most games, regular OS X (Cocoa) applications
-      require specially formatted mouse events. Features such as
-      click-and-drag or double-clicking will not work correctly, so
-      many applications will behave incorrectly if driven by an
-      Enjoyable simulated mouse.
-    </p>
-    <p>
-      If you find a non-Cocoa application that has problems with
-      Enjoyable's mouse
-      support <a href="https://github.com/joewreschnig/enjoyable/issues">please
-      file a ticket in the issue tracker</a>.
-    </p>
-    
-  </body>
-</html>
diff --git a/Help/Contents/Resources/English.lproj/pgs/problems.html b/Help/Contents/Resources/English.lproj/pgs/problems.html
deleted file mode 100644 (file)
index 8f3aa68..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
-          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-  <head>
-    <title>Troubleshooting</title>
-    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
-    <link href="../sty/default.css"
-          rel="stylesheet"
-          type="text/css"
-          media="all"/>
-  </head>
-  
-  <body>
-    <a name="problems"></a>
-    
-    <div id="navbox">
-      <div id="navleftbox">
-        <a class="navlink_left"
-           href="help:anchor='home' bookID='com.yukkurigames.Enjoyable.help'">
-          Home
-        </a>
-      </div>
-    </div>
-    
-    <div id="headerbox">
-      <div id="iconbox">
-        <img id="iconimg"
-             src="../gfx/Icon.png"
-             alt="Icon"
-             height="32" width="32"/>
-      </div>
-      <h1>Troubleshooting</h1>
-    </div>
-
-    <h3>
-      <a name="unavailable"></a>
-      When I start Enjoyable, it says "Input devices are unavailable"
-    </h3>
-    <p>
-      This happens if Enjoyable is refused access to your input
-      devices by Mac OS X. This usually happens if another application
-      has requested exclusive access to them. Try quitting any other
-      applications using your input devices. If that doesn't work, try
-      disconnecting and reconnecting the device, then restarting
-      Enjoyable. If it still doesn't work you may need to reboot.
-    </p>
-
-    <h3>
-      <a name="noswitch"></a>
-      Enjoyable never switches to my application mapping
-    </h3>
-    <p>
-      Make sure it matches the name of the application exactly. If you
-      still have trouble, name the mapping <kbd>@Application</kbd> and
-      switch back to have Enjoyable try to deduce the correct name
-      automatically.
-    </p>
-
-    <h3>
-      Mouse clicks and drags don't work
-      <a name="brokenmouse"></a>
-    </h3>
-    <p>
-      This is a known issue with Cocoa applications, as they require
-      more specially-crafted mouse events. We hope to fix it in a
-      future version.
-    </p>
-  </body>
-</html>
diff --git a/Help/Contents/Resources/English.lproj/sty/default.css b/Help/Contents/Resources/English.lproj/sty/default.css
deleted file mode 100644 (file)
index 58b7747..0000000
+++ /dev/null
@@ -1 +0,0 @@
-body {\r    font-size: 8pt;\r    font-family: "Lucida Grande", Arial, sans-serif;\r    line-height: 12pt;\r    text-decoration: none;\r    margin-right: 1em;\r    margin-left: 1em;\r}\r\r#navbox { \r    background-color: #f2f2f2; \r    position: fixed;\r    top: 0; \r    left: 0; \r    width: 100%; \r    height: 1.5em; \r    float: left; \r    border-bottom: 1px solid #bfbfbf\r}\r\r#navleftbox { \r    position: absolute; \r    top: 1px; \r    left: 15px \r}\r\r#navrightbox { \r    background-color: #f2f2f2; \r    padding-right: 25px; \r    float: right; \r    padding-bottom: 1px; \r    border-left: 1px solid #bfbfbf\r}\r\r#navbox a {\r    font-size: 8pt;\r    color: #666;\r    font-weight: normal;\r    margin: -9px 0 -6px;\r}\r\r#headerbox {\r    margin-top: 36px;\r    padding-right: 6px;\r    margin-bottom: 2em;\r}\r\r#iconbox {\r    float: left;\r}\r\rh1 {\r    margin-left: 40px;\r    width: 88%;\r    font-size: 15pt;\r    line-height: 15pt;\r    font-weight: bold;\r    padding-top: 6px;\r    margin-bottom: 0;\r}\r\rh2 {\r    font-size: 11pt;\r    line-height: 12pt;\r    font-weight: bold;\r    color: black;\r    margin-top: 0;\r    margin-bottom: 11px;\r}\r\rh3 {\r    font-size: 8pt;\r    font-weight: bold;\r    letter-spacing: 0.1em;\r    line-height: 8pt;\r    color: #666;\r    margin-top: 1em;\r    margin-bottom: 0px;\r    padding-bottom: 0.5em;\r}\r\rp {\r    margin-left: 0px;\r    margin-top: 0px;\r    margin-bottom: 0.5em;\r}\r\rul {\r    margin-left: 2em;\r    margin-top: 6px;\r    margin-bottom: 0px;\r    padding-left: 0px;\r}\r\rli {\r    margin-left: 0px;\r}\r\ra {\r    color: #778fbd;\r    font-size: 9pt;\r    font-weight: bold;\r    text-decoration: none;\r}\r\ra:hover {\r    text-decoration: underline;\r}\r\r.weblink {\r    color: #666;\r    font-weight: normal;\r}\r
\ No newline at end of file
diff --git a/NJDevice.h b/NJDevice.h
deleted file mode 100644 (file)
index ec607ac..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-//
-//  NJDevice.h
-//  Enjoy
-//
-//  Created by Sam McCall on 4/05/09.
-//  Copyright 2009 University of Otago. All rights reserved.
-//
-
-#import "NJInputPathElement.h"
-
-@class NJInput;
-
-@interface NJDevice : NSObject <NJInputPathElement>
-
-@property (nonatomic, assign) int index;
-@property (nonatomic, copy) NSString *productName;
-@property (nonatomic, assign) IOHIDDeviceRef device;
-@property (nonatomic, copy) NSArray *children;
-@property (nonatomic, readonly) NSString *name;
-@property (readonly) NSString *uid;
-
-- (id)initWithDevice:(IOHIDDeviceRef)device;
-- (NJInput *)handlerForEvent:(IOHIDValueRef)value;
-- (NJInput *)inputForEvent:(IOHIDValueRef)value;
-
-@end
diff --git a/NJDevice.m b/NJDevice.m
deleted file mode 100644 (file)
index 69775d8..0000000
+++ /dev/null
@@ -1,109 +0,0 @@
-//
-//  NJDevice.m
-//  Enjoy
-//
-//  Created by Sam McCall on 4/05/09.
-//
-
-#import "NJDevice.h"
-
-#import "NJInput.h"
-#import "NJInputAnalog.h"
-#import "NJInputHat.h"
-#import "NJInputButton.h"
-
-static NSArray *InputsForElement(IOHIDDeviceRef device, id base) {
-    CFArrayRef elements = IOHIDDeviceCopyMatchingElements(device, NULL, kIOHIDOptionsTypeNone);
-    NSMutableArray *children = [NSMutableArray arrayWithCapacity:CFArrayGetCount(elements)];
-    
-    int buttons = 0;
-    int axes = 0;
-    int hats = 0;
-    
-    for (int i = 0; i < CFArrayGetCount(elements); i++) {
-        IOHIDElementRef element = (IOHIDElementRef)CFArrayGetValueAtIndex(elements, i);
-        int type = IOHIDElementGetType(element);
-        unsigned usage = IOHIDElementGetUsage(element);
-        unsigned usagePage = IOHIDElementGetUsagePage(element);
-        long max = IOHIDElementGetPhysicalMax(element);
-        long min = IOHIDElementGetPhysicalMin(element);
-        CFStringRef elName = IOHIDElementGetName(element);
-        
-        NJInput *input = nil;
-        
-        if (!(type == kIOHIDElementTypeInput_Misc
-              || type == kIOHIDElementTypeInput_Axis
-              || type == kIOHIDElementTypeInput_Button))
-             continue;
-        
-        if (max - min == 1 || usagePage == kHIDPage_Button || type == kIOHIDElementTypeInput_Button) {
-            input = [[NJInputButton alloc] initWithName:(__bridge NSString *)elName
-                                                    idx:++buttons
-                                                    max:max];
-        } else if (usage == kHIDUsage_GD_Hatswitch) {
-            input = [[NJInputHat alloc] initWithIndex:++hats];
-        } else if (usage >= kHIDUsage_GD_X && usage <= kHIDUsage_GD_Rz) {
-            input = [[NJInputAnalog alloc] initWithIndex:++axes
-                                                  rawMin:min
-                                                  rawMax:max];
-        } else {
-            continue;
-        }
-        
-        // TODO(jfw): Should be moved into better constructors.
-        input.base = base;
-        input.cookie = IOHIDElementGetCookie(element);
-        [children addObject:input];
-    }
-
-    CFRelease(elements);
-    return children;
-}
-
-@implementation NJDevice {
-    int vendorId;
-    int productId;
-}
-
-- (id)initWithDevice:(IOHIDDeviceRef)dev {
-    if ((self = [super init])) {
-        self.device = dev;
-        self.productName = (__bridge NSString *)IOHIDDeviceGetProperty(dev, CFSTR(kIOHIDProductKey));
-        vendorId = [(__bridge NSNumber *)IOHIDDeviceGetProperty(dev, CFSTR(kIOHIDVendorIDKey)) intValue];
-        productId = [(__bridge NSNumber *)IOHIDDeviceGetProperty(dev, CFSTR(kIOHIDProductIDKey)) intValue];
-        self.children = InputsForElement(dev, self);
-    }
-    return self;
-}
-
-- (NSString *)name {
-    return [NSString stringWithFormat:@"%@ #%d", _productName, _index];
-}
-
-- (id)base {
-    return nil;
-}
-
-- (NSString *)uid {
-    return [NSString stringWithFormat: @"%d:%d:%d", vendorId, productId, _index];
-}
-
-- (NJInput *)findInputByCookie:(IOHIDElementCookie)cookie {
-    for (NJInput *child in _children)
-        if (child.cookie == cookie)
-            return child;
-    return nil;
-}
-
-- (NJInput *)handlerForEvent:(IOHIDValueRef)value {
-    NJInput *mainInput = [self inputForEvent:value];
-    return [mainInput findSubInputForValue:value];
-}
-
-- (NJInput *)inputForEvent:(IOHIDValueRef)value {
-    IOHIDElementRef elt = IOHIDValueGetElement(value);
-    IOHIDElementCookie cookie = IOHIDElementGetCookie(elt);
-    return [self findInputByCookie:cookie];
-}
-
-@end
diff --git a/NJDeviceController.h b/NJDeviceController.h
deleted file mode 100644 (file)
index 7658c64..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-//
-//  NJDeviceController.h
-//  Enjoy
-//
-//  Created by Sam McCall on 4/05/09.
-//  Copyright 2009 University of Otago. All rights reserved.
-//
-
-@class NJDevice;
-@class NJInput;
-@class NJMappingsController;
-@class NJOutputController;
-
-@interface NJDeviceController : NSObject <NSOutlineViewDataSource, NSOutlineViewDelegate> {
-    IBOutlet NSOutlineView *outlineView;
-    IBOutlet NJOutputController *outputController;
-    IBOutlet NJMappingsController *mappingsController;
-    IBOutlet NSButton *translatingEventsButton;
-    IBOutlet NSMenuItem *translatingEventsMenu;
-}
-
-@property (nonatomic, readonly) NJInput *selectedInput;
-@property (nonatomic, assign) NSPoint mouseLoc;
-@property (nonatomic, assign) BOOL translatingEvents;
-
-- (void)setup;
-- (NJDevice *)findDeviceByRef:(IOHIDDeviceRef)device;
-
-- (IBAction)translatingEventsChanged:(id)sender;
-
-@end
diff --git a/NJDeviceController.m b/NJDeviceController.m
deleted file mode 100644 (file)
index d553d7d..0000000
+++ /dev/null
@@ -1,243 +0,0 @@
-//
-//  NJDeviceController.m
-//  Enjoy
-//
-//  Created by Sam McCall on 4/05/09.
-//
-
-#import "NJDeviceController.h"
-
-#import "NJMapping.h"
-#import "NJMappingsController.h"
-#import "NJDevice.h"
-#import "NJInput.h"
-#import "NJOutput.h"
-#import "NJOutputController.h"
-#import "NJEvents.h"
-
-@implementation NJDeviceController {
-    IOHIDManagerRef hidManager;
-    NSTimer *continuousTimer;
-    NSMutableArray *runningOutputs;
-    NSMutableArray *_devices;
-}
-
-- (id)init {
-    if ((self = [super init])) {
-        _devices = [[NSMutableArray alloc] initWithCapacity:16];
-        runningOutputs = [[NSMutableArray alloc] initWithCapacity:32];
-    }
-    return self;
-}
-
-- (void)dealloc {
-    [continuousTimer invalidate];
-    IOHIDManagerClose(hidManager, kIOHIDOptionsTypeNone);
-    CFRelease(hidManager);
-}
-
-- (void)expandRecursive:(id <NJInputPathElement>)pathElement {
-    if (pathElement) {
-        [self expandRecursive:pathElement.base];
-        [outlineView expandItem:pathElement];
-    }
-}
-
-- (void)addRunningOutput:(NJOutput *)output {
-    if (![runningOutputs containsObject:output]) {
-        [runningOutputs addObject:output];
-    }
-    if (!continuousTimer) {
-        continuousTimer = [NSTimer scheduledTimerWithTimeInterval:1.f/60.f
-                                                           target:self
-                                                         selector:@selector(updateContinuousInputs:)
-                                                         userInfo:nil
-                                                          repeats:YES];
-        NSLog(@"Scheduled continuous output timer.");
-    }
-}
-
-- (void)runOutputForDevice:(IOHIDDeviceRef)device value:(IOHIDValueRef)value {
-    NJDevice *dev = [self findDeviceByRef:device];
-    NJInput *mainInput = [dev inputForEvent:value];
-    [mainInput notifyEvent:value];
-    NSArray *children = mainInput.children ? mainInput.children : mainInput ? @[mainInput] : @[];
-    for (NJInput *subInput in children) {
-        NJOutput *output = mappingsController.currentMapping[subInput];
-        output.magnitude = subInput.magnitude;
-        output.running = subInput.active;
-        if ((output.running || output.magnitude) && output.isContinuous)
-            [self addRunningOutput:output];
-    }
-}
-
-- (void)showOutputForDevice:(IOHIDDeviceRef)device value:(IOHIDValueRef)value {
-    NJDevice *dev = [self findDeviceByRef:device];
-    NJInput *handler = [dev handlerForEvent:value];
-    if (!handler)
-        return;
-    
-    [self expandRecursive:handler];
-    [outlineView selectRowIndexes:[NSIndexSet indexSetWithIndex:[outlineView rowForItem:handler]] byExtendingSelection: NO];
-    [outputController focusKey];
-}
-
-static void input_callback(void *ctx, IOReturn inResult, void *inSender, IOHIDValueRef value) {
-    NJDeviceController *controller = (__bridge NJDeviceController *)ctx;
-    IOHIDDeviceRef device = IOHIDQueueGetDevice(inSender);
-    
-    if (controller.translatingEvents) {
-        [controller runOutputForDevice:device value:value];
-    } else if ([NSApplication sharedApplication].mainWindow.isVisible) {
-        [controller showOutputForDevice:device value:value];
-    }
-}
-
-static int findAvailableIndex(NSArray *list, NJDevice *dev) {
-    for (int index = 1; ; index++) {
-        BOOL available = YES;
-        for (NJDevice *used in list) {
-            if ([used.productName isEqualToString:dev.productName] && used.index == index) {
-                available = NO;
-                break;
-            }
-        }
-        if (available)
-            return index;
-    }
-}
-
-- (void)addDeviceForDevice:(IOHIDDeviceRef)device {
-    IOHIDDeviceRegisterInputValueCallback(device, input_callback, (__bridge void*)self);
-    NJDevice *dev = [[NJDevice alloc] initWithDevice:device];
-    dev.index = findAvailableIndex(_devices, dev);
-    [_devices addObject:dev];
-    [outlineView reloadData];
-}
-
-static void add_callback(void *ctx, IOReturn inResult, void *inSender, IOHIDDeviceRef device) {
-    NJDeviceController *controller = (__bridge NJDeviceController *)ctx;
-    [controller addDeviceForDevice:device];
-}
-
-- (NJDevice *)findDeviceByRef:(IOHIDDeviceRef)device {
-    for (NJDevice *dev in _devices)
-        if (dev.device == device)
-            return dev;
-    return nil;
-}
-
-static void remove_callback(void *ctx, IOReturn inResult, void *inSender, IOHIDDeviceRef device) {
-    NJDeviceController *controller = (__bridge NJDeviceController *)ctx;
-    [controller removeDeviceForDevice:device];
-}
-
-- (void)removeDeviceForDevice:(IOHIDDeviceRef)device {
-    NJDevice *match = [self findDeviceByRef:device];
-    IOHIDDeviceRegisterInputValueCallback(device, NULL, NULL);
-    if (match) {
-        [_devices removeObject:match];
-        [outlineView reloadData];
-    }
-    
-}
-
-- (void)updateContinuousInputs:(NSTimer *)timer {
-    self.mouseLoc = [NSEvent mouseLocation];
-    for (NJOutput *output in [runningOutputs copy]) {
-        if (![output update:self]) {
-            [runningOutputs removeObject:output];
-        }
-    }
-    if (!runningOutputs.count) {
-        [continuousTimer invalidate];
-        continuousTimer = nil;
-        NSLog(@"Unscheduled continuous output timer.");
-    }
-}
-
-#define NSSTR(e) ((NSString *)CFSTR(e))
-
-- (void)setup {
-    hidManager = IOHIDManagerCreate(kCFAllocatorDefault, kIOHIDOptionsTypeNone);
-    NSArray *criteria = @[ @{ NSSTR(kIOHIDDeviceUsagePageKey) : @(kHIDPage_GenericDesktop),
-                              NSSTR(kIOHIDDeviceUsageKey) : @(kHIDUsage_GD_Joystick) },
-                           @{ NSSTR(kIOHIDDeviceUsagePageKey) : @(kHIDPage_GenericDesktop),
-                              NSSTR(kIOHIDDeviceUsageKey) : @(kHIDUsage_GD_GamePad) },
-                           @{ NSSTR(kIOHIDDeviceUsagePageKey) : @(kHIDPage_GenericDesktop),
-                              NSSTR(kIOHIDDeviceUsageKey) : @(kHIDUsage_GD_MultiAxisController) }
-                           ];
-    IOHIDManagerSetDeviceMatchingMultiple(hidManager, (__bridge CFArrayRef)criteria);
-    
-    IOHIDManagerScheduleWithRunLoop(hidManager, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode);
-    IOReturn ret = IOHIDManagerOpen(hidManager, kIOHIDOptionsTypeNone);
-    if (ret != kIOReturnSuccess) {
-        [[NSAlert alertWithMessageText:@"Input devices are unavailable"
-                         defaultButton:nil
-                       alternateButton:nil
-                           otherButton:nil
-             informativeTextWithFormat:@"Error 0x%08x occured trying to access your devices. "
-                                       @"Input may not be correctly detected or mapped.",
-                                       ret]
-         beginSheetModalForWindow:outlineView.window
-                    modalDelegate:nil
-                   didEndSelector:nil
-                      contextInfo:nil];
-    }
-    
-    IOHIDManagerRegisterDeviceMatchingCallback(hidManager, add_callback, (__bridge void *)self);
-    IOHIDManagerRegisterDeviceRemovalCallback(hidManager, remove_callback, (__bridge void *)self);
-}
-
-- (NJInput *)selectedInput {
-    id <NJInputPathElement> item = [outlineView itemAtRow:outlineView.selectedRow];
-    return (!item.children && item.base) ? item : nil;
-}
-
-- (NSInteger)outlineView:(NSOutlineView *)outlineView
-  numberOfChildrenOfItem:(id <NJInputPathElement>)item {
-    return item ? item.children.count : _devices.count;
-}
-
-- (BOOL)outlineView:(NSOutlineView *)outlineView
-   isItemExpandable:(id <NJInputPathElement>)item {
-    return item ? [[item children] count] > 0: YES;
-}
-
-- (id)outlineView:(NSOutlineView *)outlineView
-            child:(NSInteger)index
-           ofItem:(id <NJInputPathElement>)item {
-    return item ? item.children[index] : _devices[index];
-}
-
-- (id)outlineView:(NSOutlineView *)outlineView
-objectValueForTableColumn:(NSTableColumn *)tableColumn
-           byItem:(id <NJInputPathElement>)item  {
-    return item ? item.name : @"root";
-}
-
-- (void)outlineViewSelectionDidChange:(NSNotification *)notification {
-    
-    [outputController loadCurrent];
-}
-
-- (void)setTranslatingEvents:(BOOL)translatingEvents {
-    if (translatingEvents != _translatingEvents) {
-        _translatingEvents = translatingEvents;
-        NSInteger state = translatingEvents ? NSOnState : NSOffState;
-        translatingEventsButton.state = state;
-        translatingEventsMenu.title = translatingEvents ? @"Disable" : @"Enable";
-        NSString *name = translatingEvents
-            ? NJEventTranslationActivated
-            : NJEventTranslationDeactivated;
-        [NSNotificationCenter.defaultCenter postNotificationName:name
-                                                          object:self];
-    }
-}
-
-- (IBAction)translatingEventsChanged:(NSButton *)sender {
-    self.translatingEvents = sender.state == NSOnState;
-}
-
-
-@end
diff --git a/NJEvents.h b/NJEvents.h
deleted file mode 100644 (file)
index ce87b24..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-//
-//  NJEvents.h
-//  Enjoyable
-//
-//  Created by Joe Wreschnig on 3/2/13.
-//
-//
-
-#define NJEventMappingChanged @"NJEventMappingChanged"
-#define NJEventMappingListChanged @"NJEventMappingListChanged"
-#define NJEventTranslationActivated @"NJEventTranslationActivated"
-#define NJEventTranslationDeactivated @"NJEventTranslationDeactivated"
diff --git a/NJInput.h b/NJInput.h
deleted file mode 100644 (file)
index 380e858..0000000
--- a/NJInput.h
+++ /dev/null
@@ -1,26 +0,0 @@
-//
-//  NJInput.h
-//  Enjoy
-//
-//  Created by Sam McCall on 4/05/09.
-//  Copyright 2009 University of Otago. All rights reserved.
-//
-
-#import "NJInputPathElement.h"
-
-@interface NJInput : NSObject <NJInputPathElement>
-
-@property (nonatomic, assign) IOHIDElementCookie cookie;
-@property (nonatomic, copy) NSArray *children;
-@property (nonatomic, weak) id base;
-@property (nonatomic, copy) NSString *name;
-@property (nonatomic, assign) BOOL active;
-@property (nonatomic, assign) float magnitude;
-@property (readonly) NSString *uid;
-
-- (id)initWithName:(NSString *)newName base:(id <NJInputPathElement>)newBase;
-
-- (void)notifyEvent:(IOHIDValueRef)value;
-- (id)findSubInputForValue:(IOHIDValueRef)value;
-
-@end
diff --git a/NJInput.m b/NJInput.m
deleted file mode 100644 (file)
index 077dac8..0000000
--- a/NJInput.m
+++ /dev/null
@@ -1,32 +0,0 @@
-//
-//  NJInput.m
-//  Enjoy
-//
-//  Created by Sam McCall on 4/05/09.
-//
-
-#import "NJInput.h"
-
-@implementation NJInput
-
-- (id)initWithName:(NSString *)newName base:(id <NJInputPathElement>)newBase {
-    if ((self = [super init])) {
-        self.name = newName;
-        self.base = newBase;
-    }
-    return self;
-}
-
-- (id)findSubInputForValue:(IOHIDValueRef)value {
-    return NULL;
-}
-
-- (NSString *)uid {
-    return [NSString stringWithFormat:@"%@~%@", [_base uid], _name];
-}
-
-- (void)notifyEvent:(IOHIDValueRef)value {
-    [self doesNotRecognizeSelector:_cmd];
-}
-
-@end
diff --git a/NJInputAnalog.h b/NJInputAnalog.h
deleted file mode 100644 (file)
index e79ed89..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-//
-//  NJInputAnalog.h
-//  Enjoy
-//
-//  Created by Sam McCall on 5/05/09.
-//  Copyright 2009 University of Otago. All rights reserved.
-//
-
-#import <Cocoa/Cocoa.h>
-
-#import "NJInput.h"
-
-@interface NJInputAnalog : NJInput
-
-- (id)initWithIndex:(int)index rawMin:(long)rawMin rawMax:(long)rawMax;
-
-@end
diff --git a/NJInputAnalog.m b/NJInputAnalog.m
deleted file mode 100644 (file)
index 7b4b15a..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-//
-//  NJInputAnalog.m
-//  Enjoy
-//
-//  Created by Sam McCall on 5/05/09.
-//
-
-#define DEAD_ZONE 0.3
-
-#import "NJInputAnalog.h"
-
-static float normalize(long p, long min, long max) {
-    return 2 * (p - min) / (float)(max - min) - 1;
-}
-
-@implementation NJInputAnalog {
-    float magnitude;
-    long rawMin;
-    long rawMax;
-}
-
-- (id)initWithIndex:(int)index rawMin:(long)rawMin_ rawMax:(long)rawMax_ {
-    if ((self = [super init])) {
-        self.name = [[NSString alloc] initWithFormat: @"Axis %d", index];
-        self.children = @[[[NJInput alloc] initWithName:@"Low" base:self],
-                          [[NJInput alloc] initWithName:@"High" base:self]];
-        rawMax = rawMax_;
-        rawMin = rawMin_;
-    }
-    return self;
-}
-
-- (id)findSubInputForValue:(IOHIDValueRef)value {
-    float mag = normalize(IOHIDValueGetIntegerValue(value), rawMin, rawMax);
-    if (mag < -DEAD_ZONE)
-        return self.children[0];
-    else if (mag > DEAD_ZONE)
-        return self.children[1];
-    else
-        return nil;
-}
-
-- (void)notifyEvent:(IOHIDValueRef)value {
-    magnitude = normalize(IOHIDValueGetIntegerValue(value), rawMin, rawMax);
-    [self.children[0] setMagnitude:fabsf(MIN(magnitude, 0))];
-    [self.children[1] setMagnitude:fabsf(MAX(magnitude, 0))];
-    [self.children[0] setActive:magnitude < -DEAD_ZONE];
-    [self.children[1] setActive:magnitude > DEAD_ZONE];
-}
-
-- (float)magnitude {
-    return magnitude;
-}
-
-@end
diff --git a/NJInputButton.h b/NJInputButton.h
deleted file mode 100644 (file)
index 31cba73..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-//
-//  NJInputButton.h
-//  Enjoy
-//
-//  Created by Sam McCall on 5/05/09.
-//  Copyright 2009 University of Otago. All rights reserved.
-//
-
-#import "NJInput.h"
-
-@interface NJInputButton : NJInput
-
-- (id)initWithName:(NSString *)name idx:(int)idx max:(long)max;
-
-@end
diff --git a/NJInputButton.m b/NJInputButton.m
deleted file mode 100644 (file)
index 0c3b0ce..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-//
-//  NJInputButton.m
-//  Enjoy
-//
-//  Created by Sam McCall on 5/05/09.
-//
-
-#import "NJInputButton.h"
-
-@implementation NJInputButton {
-    long _max;
-}
-
-- (id)initWithName:(NSString *)name idx:(int)idx max:(long)max {
-    if ((self = [super init])) {
-        _max = max;
-        if (name.length)
-            self.name = [NSString stringWithFormat:@"Button %d - %@", idx, name];
-        else
-            self.name = [NSString stringWithFormat:@"Button %d", idx];
-    }
-    return self;
-}
-
-- (id)findSubInputForValue:(IOHIDValueRef)val {
-    return (IOHIDValueGetIntegerValue(val) == _max) ? self : nil;
-}
-
-- (void)notifyEvent:(IOHIDValueRef)value {
-    self.active = IOHIDValueGetIntegerValue(value) == _max;
-    self.magnitude = IOHIDValueGetIntegerValue(value) / (float)_max;
-}
-
-@end
diff --git a/NJInputHat.h b/NJInputHat.h
deleted file mode 100644 (file)
index 5290d71..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-//
-//  NJInputHat.h
-//  Enjoy
-//
-//  Created by Sam McCall on 5/05/09.
-//  Copyright 2009 University of Otago. All rights reserved.
-//
-
-#import "NJInput.h"
-
-@interface NJInputHat : NJInput
-
-- (id)initWithIndex:(int)index;
-
-@end
diff --git a/NJInputHat.m b/NJInputHat.m
deleted file mode 100644 (file)
index e0e127f..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-//
-//  NJInputHat.m
-//  Enjoy
-//
-//  Created by Sam McCall on 5/05/09.
-//
-
-#import "NJInputHat.h"
-
-static BOOL active_eightway[36] = {
-    NO,  NO,  NO,  NO , // center
-    YES, NO,  NO,  NO , // N
-    YES, NO,  NO,  YES, // NE
-    NO,  NO,  NO,  YES, // E
-    NO,  YES, NO,  YES, // SE
-    NO,  YES, NO,  NO , // S
-    NO,  YES, YES, NO , // SW
-    NO,  NO,  YES, NO , // W
-    YES, NO,  YES, NO , // NW
-};
-
-static BOOL active_fourway[20] = {
-    NO,  NO,  NO,  NO , // center
-    YES, NO,  NO,  NO , // N
-    NO,  NO,  NO,  YES, // E
-    NO,  YES, NO,  NO , // S
-    NO,  NO,  YES, NO , // W
-};
-
-@implementation NJInputHat
-
-- (id)initWithIndex:(int)index {
-    if ((self = [super init])) {
-        self.children = @[[[NJInput alloc] initWithName:@"Up" base:self],
-                          [[NJInput alloc] initWithName:@"Down" base:self],
-                          [[NJInput alloc] initWithName:@"Left" base:self],
-                          [[NJInput alloc] initWithName:@"Right" base:self]];
-        self.name = [NSString stringWithFormat:@"Hat Switch %d", index];
-    }
-    return self;
-}
-
-- (id)findSubInputForValue:(IOHIDValueRef)value {
-    long parsed = IOHIDValueGetIntegerValue(value);
-    switch (IOHIDElementGetLogicalMax(IOHIDValueGetElement(value))) {
-        case 7: // 8-way switch, 0-7.
-            switch (parsed) {
-                case 0: return self.children[0];
-                case 4: return self.children[1];
-                case 6: return self.children[2];
-                case 2: return self.children[3];
-                default: return nil;
-            }
-        case 8: // 8-way switch, 1-8 (neutral 0).
-            switch (parsed) {
-                case 1: return self.children[0];
-                case 5: return self.children[1];
-                case 7: return self.children[2];
-                case 3: return self.children[3];
-                default: return nil;
-            }
-        case 3: // 4-way switch, 0-3.
-            switch (parsed) {
-                case 0: return self.children[0];
-                case 2: return self.children[1];
-                case 3: return self.children[2];
-                case 1: return self.children[3];
-                default: return nil;
-            }
-        case 4: // 4-way switch, 1-4 (neutral 0).
-            switch (parsed) {
-                case 1: return self.children[0];
-                case 3: return self.children[1];
-                case 4: return self.children[2];
-                case 2: return self.children[3];
-                default: return nil;
-            }
-        default:
-            return nil;
-    }
-}
-
-- (void)notifyEvent:(IOHIDValueRef)value {
-    long parsed = IOHIDValueGetIntegerValue(value);
-    long size = IOHIDElementGetLogicalMax(IOHIDValueGetElement(value));
-    // Skip first row in table if 0 is not neutral.
-    if (size & 1) {
-        parsed++;
-        size++;
-    }
-    BOOL *activechildren = (size == 8) ? active_eightway : active_fourway;
-    for (unsigned i = 0; i < 4; i++) {
-        BOOL active = activechildren[parsed * 4 + i];
-        [self.children[i] setActive:active];
-        [self.children[i] setMagnitude:active];
-    }
-}
-
-@end
diff --git a/NJInputPathElement.h b/NJInputPathElement.h
deleted file mode 100644 (file)
index 8fe5c65..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-#import <Foundation/Foundation.h>
-
-@protocol NJInputPathElement <NSObject>
-
-- (NSArray *)children;
-- (id <NJInputPathElement>) base;
-- (NSString *)name;
-
-@end
diff --git a/NJKeyInputField.h b/NJKeyInputField.h
deleted file mode 100644 (file)
index ad026d3..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-//
-//  NJKeyInputField.h
-//  Enjoyable
-//
-//  Copyright 2013 Joe Wreschnig.
-//
-
-#import <Cocoa/Cocoa.h>
-
-extern CGKeyCode NJKeyInputFieldEmpty;
-
-@protocol NJKeyInputFieldDelegate;
-
-@interface NJKeyInputField : NSTextField
-    // An NJKeyInputField is a NSTextField-like widget that receives
-    // exactly one key press, and displays the name of that key, then
-    // resigns its first responder status. It can also inform a
-    // special delegate when its content changes.
-
-+ (NSString *)stringForKeyCode:(CGKeyCode)keyCode;
-    // Give the string name for a virtual key code.
-
-@property (nonatomic, weak) IBOutlet id <NJKeyInputFieldDelegate> keyDelegate;
-
-@property (nonatomic, assign) CGKeyCode keyCode;
-    // The currently displayed key code, or NJKeyInputFieldEmpty if no
-    // key is active.  Changing this will update the display but not
-    // inform the delegate.
-
-@property (nonatomic, readonly) BOOL hasKeyCode;
-    // True if any key is active, false otherwise.
-
-- (void)clear;
-    // Clear the currently active key and call the delegate.
-
-@end
-
-@protocol NJKeyInputFieldDelegate <NSObject>
-
-- (void)keyInputField:(NJKeyInputField *)keyInput
-         didChangeKey:(CGKeyCode)keyCode;
-- (void)keyInputFieldDidClear:(NJKeyInputField *)keyInput;
-
-@end
-
diff --git a/NJKeyInputField.m b/NJKeyInputField.m
deleted file mode 100644 (file)
index ec08150..0000000
+++ /dev/null
@@ -1,213 +0,0 @@
-//
-//  NJKeyInputField.h
-//  Enjoyable
-//
-//  Copyright 2013 Joe Wreschnig.
-//
-
-#import "NJKeyInputField.h"
-
-CGKeyCode NJKeyInputFieldEmpty = 0xFFFF;
-
-@implementation NJKeyInputField
-
-- (id)initWithFrame:(NSRect)frameRect {
-    if ((self = [super initWithFrame:frameRect])) {
-        self.alignment = NSCenterTextAlignment;
-        [self setEditable:NO];
-        [self setSelectable:NO];
-    }
-    return self;
-}
-
-- (void)clear {
-    self.keyCode = NJKeyInputFieldEmpty;
-    [self.keyDelegate keyInputFieldDidClear:self];
-    [self resignIfFirstResponder];
-}
-
-- (BOOL)hasKeyCode {
-    return self.keyCode != NJKeyInputFieldEmpty;
-}
-
-+ (NSString *)stringForKeyCode:(CGKeyCode)keyCode {
-    switch (keyCode) {
-        case 0xffff: return @"";
-        case 0x7a: return @"F1";
-        case 0x78: return @"F2";
-        case 0x63: return @"F3";
-        case 0x76: return @"F4";
-        case 0x60: return @"F5";
-        case 0x61: return @"F6";
-        case 0x62: return @"F7";
-        case 0x64: return @"F8";
-        case 0x65: return @"F9";
-        case 0x6d: return @"F10";
-        case 0x67: return @"F11";
-        case 0x6f: return @"F12";
-        case 0x69: return @"F13";
-        case 0x6b: return @"F14";
-        case 0x71: return @"F15";
-        case 0x6a: return @"F16";
-        case 0x40: return @"F17";
-        case 0x4f: return @"F18";
-        case 0x50: return @"F19";
-            
-        case 0x35: return @"Esc";
-        case 0x32: return @"`";
-            
-        case 0x12: return @"1";
-        case 0x13: return @"2";
-        case 0x14: return @"3";
-        case 0x15: return @"4";
-        case 0x17: return @"5";
-        case 0x16: return @"6";
-        case 0x1a: return @"7";
-        case 0x1c: return @"8";
-        case 0x19: return @"9";
-        case 0x1d: return @"0";
-        case 0x1b: return @"-";
-        case 0x18: return @"=";
-            
-        case 0x3f: return @"Fn";
-        case 0x36: return @"Right Command";
-        case 0x37: return @"Left Command";
-        case 0x38: return @"Left Shift";
-        case 0x39: return @"Caps Lock";
-        case 0x3a: return @"Left Option";
-        case 0x3b: return @"Left Control";
-        case 0x3c: return @"Right Shift";
-        case 0x3d: return @"Right Option";
-        case 0x3e: return @"Right Control";
-            
-        case 0x73: return @"Home";
-        case 0x74: return @"Page Up";
-        case 0x75: return @"Delete";
-        case 0x77: return @"End";
-        case 0x79: return @"Page Down";
-            
-        case 0x30: return @"Tab";
-        case 0x33: return @"Backspace";
-        case 0x24: return @"Return";
-        case 0x31: return @"Space";
-            
-        case 0x0c: return @"Q";
-        case 0x0d: return @"W";
-        case 0x0e: return @"E";
-        case 0x0f: return @"R";
-        case 0x11: return @"T";
-        case 0x10: return @"Y";
-        case 0x20: return @"U";
-        case 0x22: return @"I";
-        case 0x1f: return @"O";
-        case 0x23: return @"P";
-        case 0x21: return @"[";
-        case 0x1e: return @"]";
-        case 0x2a: return @"\\";
-        case 0x00: return @"A";
-        case 0x01: return @"S";
-        case 0x02: return @"D";
-        case 0x03: return @"F";
-        case 0x05: return @"G";
-        case 0x04: return @"H";
-        case 0x26: return @"J";
-        case 0x28: return @"K";
-        case 0x25: return @"L";
-        case 0x29: return @";";
-        case 0x27: return @"'";
-        case 0x06: return @"Z";
-        case 0x07: return @"X";
-        case 0x08: return @"C";
-        case 0x09: return @"V";
-        case 0x0b: return @"B";
-        case 0x2d: return @"N";
-        case 0x2e: return @"M";
-        case 0x2b: return @",";
-        case 0x2f: return @".";
-        case 0x2c: return @"/";
-            
-        case 0x47: return @"Clear";
-        case 0x51: return @"Keypad =";
-        case 0x4b: return @"Keypad /";
-        case 0x43: return @"Keypad *";
-        case 0x59: return @"Keypad 7";
-        case 0x5b: return @"Keypad 8";
-        case 0x5c: return @"Keypad 9";
-        case 0x4e: return @"Keypad -";
-        case 0x56: return @"Keypad 4";
-        case 0x57: return @"Keypad 5";
-        case 0x58: return @"Keypad 6";
-        case 0x45: return @"Keypad +";
-        case 0x53: return @"Keypad 1";
-        case 0x54: return @"Keypad 2";
-        case 0x55: return @"Keypad 3";
-        case 0x52: return @"Keypad 0";
-        case 0x41: return @"Keypad .";
-        case 0x4c: return @"Enter";
-            
-        case 0x7e: return @"Up";
-        case 0x7d: return @"Down";
-        case 0x7b: return @"Left";
-        case 0x7c: return @"Right";
-        default:
-            return [[NSString alloc] initWithFormat:@"Key 0x%x", keyCode];
-    }
-}
-
-- (BOOL)acceptsFirstResponder {
-    return self.isEnabled;
-}
-
-- (BOOL)becomeFirstResponder {
-    self.backgroundColor = NSColor.selectedTextBackgroundColor;
-    return [super becomeFirstResponder];
-}
-
-- (BOOL)resignFirstResponder {
-    self.backgroundColor = NSColor.textBackgroundColor;
-    return [super resignFirstResponder];
-}
-
-- (void)setKeyCode:(CGKeyCode)keyCode {
-    _keyCode = keyCode;
-    self.stringValue = [NJKeyInputField stringForKeyCode:keyCode];
-}
-
-- (void)keyDown:(NSEvent *)theEvent {
-    if (!theEvent.isARepeat) {
-        if ((theEvent.modifierFlags & NSAlternateKeyMask)
-            && 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];
-        }
-        [self resignIfFirstResponder];
-    }
-}
-
-- (void)mouseDown:(NSEvent *)theEvent {
-    if (self.acceptsFirstResponder)
-        [self.window makeFirstResponder:self];
-}
-
-- (void)flagsChanged:(NSEvent *)theEvent {
-    // Many keys are only available on MacBook keyboards by using the
-    // Fn modifier key (e.g. Fn+Left for Home), so delay processing
-    // modifiers until the up event is received in order to let the
-    // user type these virtual keys. However, there is no actual event
-    // for modifier key up - so detect it by checking to see if any
-    // modifiers are still down.
-    if (!(theEvent.modifierFlags & NSDeviceIndependentModifierFlagsMask)) {
-        self.keyCode = theEvent.keyCode;
-        [self.keyDelegate keyInputField:self didChangeKey:_keyCode];
-    }
-}
-
-@end
diff --git a/NJMapping.h b/NJMapping.h
deleted file mode 100644 (file)
index 5653745..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-//
-//  NJMapping.h
-//  Enjoy
-//
-//  Created by Sam McCall on 4/05/09.
-//  Copyright 2009 University of Otago. All rights reserved.
-//
-
-@class NJOutput;
-@class NJInput;
-
-@interface NJMapping : NSObject
-
-@property (nonatomic, copy) NSString *name;
-@property (nonatomic, readonly) NSMutableDictionary *entries;
-
-- (id)initWithName:(NSString *)name;
-- (NJOutput *)objectForKeyedSubscript:(NJInput *)input;
-- (void)setObject:(NJOutput *)output forKeyedSubscript:(NJInput *)input;
-- (NSDictionary *)serialize;
-- (BOOL)writeToURL:(NSURL *)url error:(NSError **)error;
-
-+ (id)mappingWithContentsOfURL:(NSURL *)url mappings:(NSArray *)mappings error:(NSError **)error;
-
-@end
diff --git a/NJMapping.m b/NJMapping.m
deleted file mode 100644 (file)
index 8cc5724..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-//
-//  NJMapping.m
-//  Enjoy
-//
-//  Created by Sam McCall on 4/05/09.
-//
-
-#import "NJMapping.h"
-
-#import "NJInput.h"
-#import "NJOutput.h"
-
-@implementation NJMapping
-
-- (id)initWithName:(NSString *)name {
-    if ((self = [super init])) {
-        self.name = name ? name : @"Untitled";
-        _entries = [[NSMutableDictionary alloc] init];
-    }
-    return self;
-}
-
-- (NJOutput *)objectForKeyedSubscript:(NJInput *)input {
-    return input ? _entries[input.uid] : nil;
-}
-
-- (void)setObject:(NJOutput *)output forKeyedSubscript:(NJInput *)input {
-    if (input) {
-        if (output)
-            _entries[input.uid] = output;
-        else
-            [_entries removeObjectForKey:input.uid];
-    }
-}
-
-- (NSDictionary *)serialize {
-    NSMutableDictionary *entries = [[NSMutableDictionary alloc] initWithCapacity:_entries.count];
-    for (id key in _entries) {
-        id serialized = [_entries[key] serialize];
-        if (serialized)
-            entries[key] = serialized;
-    }
-    return @{ @"name": _name, @"entries": entries };
-}
-
-- (BOOL)writeToURL:(NSURL *)url error:(NSError **)error {
-    [NSProcessInfo.processInfo disableSuddenTermination];
-    NSDictionary *serialization = [self serialize];
-    NSData *json = [NSJSONSerialization dataWithJSONObject:serialization
-                                                   options:NSJSONWritingPrettyPrinted
-                                                     error:error];
-    BOOL success = json && [json writeToURL:url options:NSDataWritingAtomic error:error];
-    [NSProcessInfo.processInfo enableSuddenTermination];
-    return success;
-}
-
-+ (id)mappingWithContentsOfURL:(NSURL *)url mappings:(NSArray *)mappings error:(NSError **)error {
-    NSInputStream *stream = [NSInputStream inputStreamWithURL:url];
-    [stream open];
-    NSDictionary *serialization = stream && !*error
-        ? [NSJSONSerialization JSONObjectWithStream:stream options:0 error:error]
-        : nil;
-    [stream close];
-    
-    if (!serialization && error)
-        return nil;
-    
-    if (!([serialization isKindOfClass:NSDictionary.class]
-          && [serialization[@"name"] isKindOfClass:NSString.class]
-          && [serialization[@"entries"] isKindOfClass:NSDictionary.class])) {
-        *error = [NSError errorWithDomain:@"Enjoyable"
-                                     code:0
-                              description:@"This isn't a valid mapping file."];
-        return nil;
-    }
-    
-    NSDictionary *entries = serialization[@"entries"];
-    NJMapping *mapping = [[NJMapping alloc] initWithName:serialization[@"name"]];
-    for (id key in entries) {
-        NSDictionary *value = entries[key];
-        if ([key isKindOfClass:NSString.class]) {
-            NJOutput *output = [NJOutput outputDeserialize:value
-                                              withMappings:mappings];
-            if (output)
-                mapping.entries[key] = output;
-        }
-    }
-    return mapping;
-}
-
-@end
diff --git a/NJMappingsController.h b/NJMappingsController.h
deleted file mode 100644 (file)
index b252904..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-//
-//  NJMappingsController.h
-//  Enjoy
-//
-//  Created by Sam McCall on 4/05/09.
-//  Copyright 2009 University of Otago. All rights reserved.
-//
-
-@class NJMapping;
-@class NJOutputController;
-
-@interface NJMappingsController : NSObject <NSTableViewDataSource,
-                                            NSTableViewDelegate,
-                                            NSOpenSavePanelDelegate,
-                                            NSPopoverDelegate,
-                                            NSFastEnumeration>
-{
-    IBOutlet NSButton *removeButton;
-    IBOutlet NSTableView *tableView;
-    IBOutlet NJOutputController *outputController;
-    IBOutlet NSButton *popoverActivate;
-    IBOutlet NSPopover *popover;
-    IBOutlet NSButton *moveUp;
-    IBOutlet NSButton *moveDown;
-}
-
-@property (nonatomic, readonly) NJMapping *currentMapping;
-@property (nonatomic, readonly) NSArray *mappings;
-
-- (NJMapping *)objectForKeyedSubscript:(NSString *)name;
-- (NJMapping *)objectAtIndexedSubscript:(NSUInteger)idx;
-- (void)addMappingWithContentsOfURL:(NSURL *)url;
-- (void)activateMapping:(NJMapping *)mapping;
-- (void)activateMappingForProcess:(NSString *)processName;
-- (void)save;
-- (void)load;
-
-- (IBAction)mappingPressed:(id)sender;
-- (IBAction)addPressed:(id)sender;
-- (IBAction)removePressed:(id)sender;
-- (IBAction)moveUpPressed:(id)sender;
-- (IBAction)moveDownPressed:(id)sender;
-- (IBAction)importPressed:(id)sender;
-- (IBAction)exportPressed:(id)sender;
-
-@end
diff --git a/NJMappingsController.m b/NJMappingsController.m
deleted file mode 100644 (file)
index ea8137f..0000000
+++ /dev/null
@@ -1,436 +0,0 @@
-//
-//  NJMappingsController.m
-//  Enjoy
-//
-//  Created by Sam McCall on 4/05/09.
-//
-
-#import "NJMappingsController.h"
-
-#import "NJMapping.h"
-#import "NJMappingsController.h"
-#import "NJOutput.h"
-#import "NJOutputController.h"
-#import "NJEvents.h"
-
-#define PB_ROW @"com.yukkurigames.Enjoyable.MappingRow"
-
-@implementation NJMappingsController {
-    NSMutableArray *_mappings;
-    NJMapping *manualMapping;
-    NSString *draggingName;
-}
-
-- (id)init {
-    if ((self = [super init])) {
-        _mappings = [[NSMutableArray alloc] init];
-        _currentMapping = [[NJMapping alloc] initWithName:@"(default)"];
-        manualMapping = _currentMapping;
-        [_mappings addObject:_currentMapping];
-    }
-    return self;
-}
-
-- (void)awakeFromNib {
-    [tableView registerForDraggedTypes:@[PB_ROW, NSURLPboardType]];
-    [tableView setDraggingSourceOperationMask:NSDragOperationCopy forLocal:NO];
-}
-
-- (NJMapping *)objectForKeyedSubscript:(NSString *)name {
-    for (NJMapping *mapping in _mappings)
-        if ([name isEqualToString:mapping.name])
-            return mapping;
-    return nil;
-}
-
-- (NJMapping *)objectAtIndexedSubscript:(NSUInteger)idx {
-    return idx < _mappings.count ? _mappings[idx] : nil;
-}
-
-- (void)mappingsChanged {
-    [self save];
-    [tableView reloadData];
-    popoverActivate.title = _currentMapping.name;
-    [self updateInterfaceForCurrentMapping];
-    [NSNotificationCenter.defaultCenter
-        postNotificationName:NJEventMappingListChanged
-        object:_mappings];
-}
-
-- (NSUInteger)countByEnumeratingWithState:(NSFastEnumerationState *)state
-                                  objects:(__unsafe_unretained id [])buffer
-                                    count:(NSUInteger)len {
-    return [_mappings countByEnumeratingWithState:state
-                                          objects:buffer
-                                            count:len];
-}
-
-- (void)activateMappingForProcess:(NSString *)processName {
-    if ([manualMapping.name.lowercaseString isEqualToString:@"@application"]) {
-        manualMapping.name = processName;
-        [self mappingsChanged];
-    } else {
-        NJMapping *oldMapping = manualMapping;
-        NJMapping *newMapping = self[processName];
-        if (!newMapping)
-            newMapping = oldMapping;
-        if (newMapping != _currentMapping)
-            [self activateMapping:newMapping];
-        manualMapping = oldMapping;
-    }
-}
-
-- (void)updateInterfaceForCurrentMapping {
-    NSUInteger selected = [_mappings indexOfObject:_currentMapping];
-    [removeButton setEnabled:selected != 0];
-    [moveDown setEnabled:selected && selected != _mappings.count - 1];
-    [moveUp setEnabled:selected > 1];
-    popoverActivate.title = _currentMapping.name;
-    [tableView selectRowIndexes:[NSIndexSet indexSetWithIndex:selected] byExtendingSelection:NO];
-    [NSUserDefaults.standardUserDefaults setInteger:selected forKey:@"selected"];
-}
-
-- (void)activateMapping:(NJMapping *)mapping {
-    if (!mapping)
-        mapping = manualMapping;
-    if (mapping == _currentMapping)
-        return;
-    NSLog(@"Switching to mapping %@.", mapping.name);
-    manualMapping = mapping;
-    _currentMapping = mapping;
-    [self updateInterfaceForCurrentMapping];
-    [outputController loadCurrent];
-    [NSNotificationCenter.defaultCenter postNotificationName:NJEventMappingChanged
-                                                      object:_currentMapping];
-}
-
-- (IBAction)addPressed:(id)sender {
-    NJMapping *newMapping = [[NJMapping alloc] initWithName:@"Untitled"];
-    [_mappings addObject:newMapping];
-    [self activateMapping:newMapping];
-    [self mappingsChanged];
-    [tableView editColumn:0 row:_mappings.count - 1 withEvent:nil select:YES];
-}
-
-- (IBAction)removePressed:(id)sender {
-    if (tableView.selectedRow == 0)
-        return;
-    
-    NSInteger selectedRow = tableView.selectedRow;
-    [_mappings removeObjectAtIndex:selectedRow];
-    [self activateMapping:_mappings[MIN(selectedRow, _mappings.count - 1)]];
-    [self mappingsChanged];
-}
-
-- (void)tableViewSelectionDidChange:(NSNotification *)notify {
-    [self activateMapping:self[tableView.selectedRow]];
-}
-
-- (id)tableView:(NSTableView *)view objectValueForTableColumn:(NSTableColumn *)column row:(NSInteger)index {
-    return self[index].name;
-}
-
-- (void)tableView:(NSTableView *)view
-   setObjectValue:(NSString *)obj
-   forTableColumn:(NSTableColumn *)col
-              row:(NSInteger)index {
-    self[index].name = obj;
-    [self mappingsChanged];
-}
-
-- (NSInteger)numberOfRowsInTableView:(NSTableView *)tableView {
-    return _mappings.count;
-}
-
-- (BOOL)tableView:(NSTableView *)view shouldEditTableColumn:(NSTableColumn *)column row:(NSInteger)index {
-    return YES;
-}
-
-- (void)save {
-    NSLog(@"Saving mappings to defaults.");
-    NSMutableArray *ary = [[NSMutableArray alloc] initWithCapacity:_mappings.count];
-    for (NJMapping *mapping in _mappings)
-        [ary addObject:[mapping serialize]];
-    [NSUserDefaults.standardUserDefaults setObject:ary forKey:@"mappings"];
-}
-
-- (void)load {
-    NSUInteger selected = [NSUserDefaults.standardUserDefaults integerForKey:@"selected"];
-    NSArray *mappings = [NSUserDefaults.standardUserDefaults arrayForKey:@"mappings"];
-    [self loadAllFrom:mappings andActivate:selected];
-}
-
-- (void)loadAllFrom:(NSArray *)storedMappings andActivate:(NSUInteger)selected {
-    NSMutableArray* newMappings = [[NSMutableArray alloc] initWithCapacity:storedMappings.count];
-
-    // have to do two passes in case mapping1 refers to mapping2 via a NJOutputMapping
-    for (NSDictionary *storedMapping in storedMappings) {
-        NJMapping *mapping = [[NJMapping alloc] initWithName:storedMapping[@"name"]];
-        [newMappings addObject:mapping];
-    }
-
-    for (unsigned i = 0; i < storedMappings.count; ++i) {
-        NSDictionary *entries = storedMappings[i][@"entries"];
-        NJMapping *mapping = newMappings[i];
-        for (id key in entries) {
-            NJOutput *output = [NJOutput outputDeserialize:entries[key]
-                                              withMappings:newMappings];
-            if (output)
-                mapping.entries[key] = output;
-        }
-    }
-    
-    if (newMappings.count) {
-        _mappings = newMappings;
-        if (selected >= newMappings.count)
-            selected = 0;
-        [self activateMapping:_mappings[selected]];
-        [self mappingsChanged];
-    }
-}
-
-- (NJMapping *)mappingWithURL:(NSURL *)url error:(NSError **)error {
-    NSInputStream *stream = [NSInputStream inputStreamWithURL:url];
-    [stream open];
-    NSDictionary *serialization = !*error
-        ? [NSJSONSerialization JSONObjectWithStream:stream options:0 error:error]
-        : nil;
-    [stream close];
-    
-    if (!([serialization isKindOfClass:NSDictionary.class]
-          && [serialization[@"name"] isKindOfClass:NSString.class]
-          && [serialization[@"entries"] isKindOfClass:NSDictionary.class])) {
-        *error = [NSError errorWithDomain:@"Enjoyable"
-                                     code:0
-                              description:@"This isn't a valid mapping file."];
-        return nil;
-    }
-
-    NSDictionary *entries = serialization[@"entries"];
-    NJMapping *mapping = [[NJMapping alloc] initWithName:serialization[@"name"]];
-    for (id key in entries) {
-        NSDictionary *value = entries[key];
-        if ([key isKindOfClass:NSString.class]) {
-            NJOutput *output = [NJOutput outputDeserialize:value
-                                              withMappings:_mappings];
-            if (output)
-                mapping.entries[key] = output;
-        }
-    }
-    return mapping;
-}
-
-- (void)addMappingWithContentsOfURL:(NSURL *)url {
-    NSWindow *window = popoverActivate.window;
-    NSError *error;
-    NJMapping *mapping = [NJMapping mappingWithContentsOfURL:url
-                                                    mappings:_mappings
-                                                       error:&error];
-    
-    if (mapping && !error) {
-        BOOL conflict = NO;
-        NJMapping *mergeInto = self[mapping.name];
-        for (id key in mapping.entries) {
-            if (mergeInto.entries[key]
-                && ![mergeInto.entries[key] isEqual:mapping.entries[key]]) {
-                conflict = YES;
-                break;
-            }
-        }
-        
-        if (conflict) {
-            NSAlert *conflictAlert = [[NSAlert alloc] init];
-            conflictAlert.messageText = @"Replace existing mappings?";
-            conflictAlert.informativeText =
-            [NSString stringWithFormat:
-             @"This file contains inputs you've already mapped in \"%@\". Do you "
-             @"want to merge them and replace your existing mappings, or import this "
-             @"as a separate mapping?", mapping.name];
-            [conflictAlert addButtonWithTitle:@"Merge"];
-            [conflictAlert addButtonWithTitle:@"Cancel"];
-            [conflictAlert addButtonWithTitle:@"New Mapping"];
-            NSInteger res = [conflictAlert runModal];
-            if (res == NSAlertSecondButtonReturn)
-                return;
-            else if (res == NSAlertThirdButtonReturn)
-                mergeInto = nil;
-        }
-        
-        if (mergeInto) {
-            [mergeInto.entries addEntriesFromDictionary:mapping.entries];
-            mapping = mergeInto;
-        } else {
-            [_mappings addObject:mapping];
-        }
-        
-        [self activateMapping:mapping];
-        [self mappingsChanged];
-        
-        if (conflict && !mergeInto) {
-            [tableView selectRowIndexes:[NSIndexSet indexSetWithIndex:_mappings.count - 1] byExtendingSelection:NO];
-            [tableView editColumn:0 row:_mappings.count - 1 withEvent:nil select:YES];
-        }
-    }
-    
-    if (error) {
-        [window presentError:error
-              modalForWindow:window
-                    delegate:nil
-          didPresentSelector:nil
-                 contextInfo:nil];
-    }
-}
-
-- (void)importPressed:(id)sender {
-    NSOpenPanel *panel = [NSOpenPanel openPanel];
-    panel.allowedFileTypes = @[ @"enjoyable", @"json", @"txt" ];
-    NSWindow *window = NSApplication.sharedApplication.keyWindow;
-    [panel beginSheetModalForWindow:window
-                  completionHandler:^(NSInteger result) {
-                      if (result != NSFileHandlingPanelOKButton)
-                          return;
-                      [panel close];
-                      [self addMappingWithContentsOfURL:panel.URL];
-                  }];
-    
-}
-
-- (void)exportPressed:(id)sender {
-    NSSavePanel *panel = [NSSavePanel savePanel];
-    panel.allowedFileTypes = @[ @"enjoyable" ];
-    NJMapping *mapping = _currentMapping;
-    panel.nameFieldStringValue = [mapping.name stringByFixingPathComponent];
-    NSWindow *window = NSApplication.sharedApplication.keyWindow;
-    [panel beginSheetModalForWindow:window
-                  completionHandler:^(NSInteger result) {
-                      if (result != NSFileHandlingPanelOKButton)
-                          return;
-                      [panel close];
-                      NSError *error;
-                      [mapping writeToURL:panel.URL error:&error];
-                      if (error) {
-                          [window presentError:error
-                                modalForWindow:window
-                                      delegate:nil
-                            didPresentSelector:nil
-                                   contextInfo:nil];
-                      }
-                  }];
-}
-
-- (IBAction)mappingPressed:(id)sender {
-    [popover showRelativeToRect:popoverActivate.bounds
-                         ofView:popoverActivate
-                  preferredEdge:NSMinXEdge];
-}
-
-- (void)popoverWillShow:(NSNotification *)notification {
-    popoverActivate.state = NSOnState;
-}
-
-- (void)popoverWillClose:(NSNotification *)notification {
-    popoverActivate.state = NSOffState;
-}
-
-- (IBAction)moveUpPressed:(id)sender {
-    NSUInteger idx = [_mappings indexOfObject:_currentMapping];
-    if (idx > 1 && idx != NSNotFound) {
-        [_mappings exchangeObjectAtIndex:idx withObjectAtIndex:idx - 1];
-        [self mappingsChanged];
-    }
-}
-
-- (IBAction)moveDownPressed:(id)sender {
-    NSUInteger idx = [_mappings indexOfObject:_currentMapping];
-    if (idx < _mappings.count - 1) {
-        [_mappings exchangeObjectAtIndex:idx withObjectAtIndex:idx + 1];
-        [self mappingsChanged];
-    }
-}
-
-- (BOOL)tableView:(NSTableView *)tableView_
-       acceptDrop:(id <NSDraggingInfo>)info
-              row:(NSInteger)row
-    dropOperation:(NSTableViewDropOperation)dropOperation {
-    NSPasteboard *pboard = [info draggingPasteboard];
-    if ([pboard.types containsObject:PB_ROW]) {
-        NSString *value = [pboard stringForType:PB_ROW];
-        NSUInteger srcRow = [value intValue];
-        [_mappings moveObjectAtIndex:srcRow toIndex:row];
-        [self mappingsChanged];
-        return YES;
-    } else if ([pboard.types containsObject:NSURLPboardType]) {
-        NSURL *url = [NSURL URLFromPasteboard:pboard];
-        NSError *error;
-        NJMapping *mapping = [NJMapping mappingWithContentsOfURL:url
-                                                        mappings:_mappings
-                                                           error:&error];
-        if (error) {
-            [tableView_ presentError:error];
-            return NO;
-        } else {
-            [_mappings insertObject:mapping atIndex:row];
-            [self mappingsChanged];
-            return YES;
-        }
-    } else {
-        return NO;
-    }
-}
-
-- (NSDragOperation)tableView:(NSTableView *)tableView_
-                validateDrop:(id <NSDraggingInfo>)info
-                 proposedRow:(NSInteger)row
-       proposedDropOperation:(NSTableViewDropOperation)dropOperation {
-    NSPasteboard *pboard = [info draggingPasteboard];
-    if ([pboard.types containsObject:PB_ROW]) {
-        [tableView_ setDropRow:MAX(1, row) dropOperation:NSTableViewDropAbove];
-        return NSDragOperationMove;
-    } else if ([pboard.types containsObject:NSURLPboardType]) {
-        NSURL *url = [NSURL URLFromPasteboard:pboard];
-        if ([url.pathExtension isEqualToString:@"enjoyable"]) {
-            [tableView_ setDropRow:MAX(1, row) dropOperation:NSTableViewDropAbove];
-            return NSDragOperationCopy;
-        } else {
-            return NSDragOperationNone;
-        }
-    } else {
-        return NSDragOperationNone;
-    }
-}
-
-- (NSArray *)tableView:(NSTableView *)tableView_
-namesOfPromisedFilesDroppedAtDestination:(NSURL *)dropDestination
-forDraggedRowsWithIndexes:(NSIndexSet *)indexSet {
-    NJMapping *toSave = self[indexSet.firstIndex];
-    NSString *filename = [[toSave.name stringByFixingPathComponent]
-                          stringByAppendingPathExtension:@"enjoyable"];
-    NSURL *dst = [dropDestination URLByAppendingPathComponent:filename];
-    dst = [NSFileManager.defaultManager generateUniqueURLWithBase:dst];     
-    NSError *error;
-    if (![toSave writeToURL:dst error:&error]) {
-        [tableView_ presentError:error];
-        return @[];
-    } else {
-        return @[dst.lastPathComponent];
-    }
-}
-
-- (BOOL)tableView:(NSTableView *)tableView_
-writeRowsWithIndexes:(NSIndexSet *)rowIndexes
-     toPasteboard:(NSPasteboard *)pboard {
-    if (rowIndexes.count == 1 && rowIndexes.firstIndex != 0) {
-        [pboard declareTypes:@[PB_ROW, NSFilesPromisePboardType] owner:nil];
-        [pboard setString:@(rowIndexes.firstIndex).stringValue forType:PB_ROW];
-        [pboard setPropertyList:@[@"enjoyable"] forType:NSFilesPromisePboardType];
-        return YES;
-    } else if (rowIndexes.count == 1 && rowIndexes.firstIndex == 0) {
-        [pboard declareTypes:@[NSFilesPromisePboardType] owner:nil];
-        [pboard setPropertyList:@[@"enjoyable"] forType:NSFilesPromisePboardType];
-        return YES;
-    } else {
-        return NO;
-    }
-}
-
-@end
diff --git a/NJOutput.h b/NJOutput.h
deleted file mode 100644 (file)
index b82c4e7..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-//
-//  NJOutput.h
-//  Enjoy
-//
-//  Created by Sam McCall on 5/05/09.
-//  Copyright 2009 University of Otago. All rights reserved.
-//
-
-@class NJDeviceController;
-
-@interface NJOutput : NSObject
-
-@property (nonatomic, assign) float magnitude;
-@property (nonatomic, assign) BOOL running;
-@property (nonatomic, readonly) BOOL isContinuous;
-
-- (void)trigger;
-- (void)untrigger;
-- (BOOL)update:(NJDeviceController *)jc;
-
-- (NSDictionary *)serialize;
-+ (NJOutput *)outputDeserialize:(NSDictionary *)serialization
-                   withMappings:(NSArray *)mappings;
-+ (NSString *)serializationCode;
-
-@end
diff --git a/NJOutput.m b/NJOutput.m
deleted file mode 100644 (file)
index 409b3e6..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-//
-//  NJOutput.m
-//  Enjoy
-//
-//  Created by Sam McCall on 5/05/09.
-//
-
-#import "NJOutput.h"
-
-#import "NJOutputKeyPress.h"
-#import "NJOutputMapping.h"
-#import "NJOutputMouseMove.h"
-#import "NJOutputMouseButton.h"
-#import "NJOutputMouseScroll.h"
-
-@implementation NJOutput {
-    BOOL running;
-}
-
-+ (NSString *)serializationCode {
-    [self doesNotRecognizeSelector:_cmd];
-    return nil;
-}
-
-- (NSDictionary *)serialize {
-    [self doesNotRecognizeSelector:_cmd];
-    return nil;    
-}
-
-- (BOOL)isEqual:(id)object {
-    return [object isKindOfClass:NJOutput.class]
-        && [[self serialize] isEqual:[object serialize]];
-}
-
-- (NSUInteger)hash {
-    return [[self serialize] hash];
-}
-
-+ (NJOutput *)outputDeserialize:(NSDictionary *)serialization
-                  withMappings:(NSArray *)mappings {
-    // Don't crash loading old/bad mappings (but don't load them either).
-    if (![serialization isKindOfClass:NSDictionary.class])
-        return nil;
-    NSString *type = serialization[@"type"];
-    for (Class cls in @[NJOutputKeyPress.class,
-                        NJOutputMapping.class,
-                        NJOutputMouseMove.class,
-                        NJOutputMouseButton.class,
-                        NJOutputMouseScroll.class
-         ]) {
-        if ([type isEqualToString:cls.serializationCode])
-            return [cls outputDeserialize:serialization withMappings:mappings];
-    }
-    
-    return nil;
-}
-
-- (void)trigger {
-}
-
-- (void)untrigger {
-}
-
-- (BOOL)update:(NJDeviceController *)jc {
-    return NO;
-}
-
-- (BOOL)isContinuous {
-    return NO;
-}
-
-- (BOOL)running {
-    return running;
-}
-
-- (void)setRunning:(BOOL)newRunning {
-    if (running != newRunning) {
-        running = newRunning;
-        if (running)
-            [self trigger];
-        else
-            [self untrigger];
-    }
-}
-
-
-@end
diff --git a/NJOutputController.h b/NJOutputController.h
deleted file mode 100644 (file)
index f8052e7..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-//
-//  NJOutputController.h
-//  Enjoy
-//
-//  Created by Sam McCall on 5/05/09.
-//  Copyright 2009 University of Otago. All rights reserved.
-//
-
-#import "NJKeyInputField.h"
-
-@class NJMappingsController;
-@class NJDeviceController;
-@class NJOutput;
-@class NJOutputMouseMove;
-
-@interface NJOutputController : NSObject <NJKeyInputFieldDelegate> {
-    IBOutlet NJKeyInputField *keyInput;
-    IBOutlet NSMatrix *radioButtons;
-    IBOutlet NSSegmentedControl *mouseDirSelect;
-    IBOutlet NSSlider *mouseSpeedSlider;
-    IBOutlet NSSegmentedControl *mouseBtnSelect;
-    IBOutlet NSSegmentedControl *scrollDirSelect;
-    IBOutlet NSSlider *scrollSpeedSlider;
-    IBOutlet NSTextField *title;
-    IBOutlet NSPopUpButton *mappingPopup;
-    IBOutlet NJMappingsController *mappingsController;
-    IBOutlet NJDeviceController *inputController;
-}
-
-@property (assign) BOOL enabled;
-
-- (void)loadCurrent;
-- (IBAction)radioChanged:(id)sender;
-- (IBAction)mdirChanged:(id)sender;
-- (IBAction)mbtnChanged:(id)sender;
-- (IBAction)sdirChanged:(id)sender;
-- (IBAction)mouseSpeedChanged:(id)sender;
-- (IBAction)scrollSpeedChanged:(id)sender;
-
-- (void)focusKey;
-
-@end
diff --git a/NJOutputController.m b/NJOutputController.m
deleted file mode 100644 (file)
index bcafe0d..0000000
+++ /dev/null
@@ -1,283 +0,0 @@
-//
-//  NJOutputController.m
-//  Enjoy
-//
-//  Created by Sam McCall on 5/05/09.
-//
-
-#import "NJOutputController.h"
-
-#import "NJMappingsController.h"
-#import "NJMapping.h"
-#import "NJInput.h"
-#import "NJEvents.h"
-#import "NJDeviceController.h"
-#import "NJKeyInputField.h"
-#import "NJOutputMapping.h"
-#import "NJOutputController.h"
-#import "NJOutputKeyPress.h"
-#import "NJOutputMouseButton.h"
-#import "NJOutputMouseMove.h"
-#import "NJOutputMouseScroll.h"
-
-@implementation NJOutputController
-
-- (id)init {
-    if ((self = [super init])) {
-        [NSNotificationCenter.defaultCenter
-            addObserver:self
-            selector:@selector(mappingListDidChange:)
-            name:NJEventMappingListChanged
-            object:nil];
-    }
-    return self;
-}
-
-- (void)dealloc {
-    [NSNotificationCenter.defaultCenter removeObserver:self];
-}
-
-- (void)cleanUpInterface {
-    NSInteger row = radioButtons.selectedRow;
-    
-    if (row != 1) {
-        keyInput.keyCode = NJKeyInputFieldEmpty;
-        [keyInput resignIfFirstResponder];
-    }
-    
-    if (row != 2) {
-        [mappingPopup selectItemAtIndex:-1];
-        [mappingPopup resignIfFirstResponder];
-    } else if (!mappingPopup.selectedItem)
-        [mappingPopup selectItemAtIndex:0];
-    
-    if (row != 3) {
-        mouseDirSelect.selectedSegment = -1;
-        mouseSpeedSlider.floatValue = mouseSpeedSlider.minValue;
-        [mouseDirSelect resignIfFirstResponder];
-    } else {
-        if (mouseDirSelect.selectedSegment == -1)
-            mouseDirSelect.selectedSegment = 0;
-        if (!mouseSpeedSlider.floatValue)
-            mouseSpeedSlider.floatValue = 4;
-    }
-    
-    if (row != 4) {
-        mouseBtnSelect.selectedSegment = -1;
-        [mouseBtnSelect resignIfFirstResponder];
-    } else if (mouseBtnSelect.selectedSegment == -1)
-        mouseBtnSelect.selectedSegment = 0;
-    
-    if (row != 5) {
-        scrollDirSelect.selectedSegment = -1;
-        scrollSpeedSlider.floatValue = scrollSpeedSlider.minValue;
-        [scrollDirSelect resignIfFirstResponder];
-    } else {
-        if (scrollDirSelect.selectedSegment == -1)
-            scrollDirSelect.selectedSegment = 0;
-        if (scrollDirSelect.selectedSegment < 2
-            && !scrollSpeedSlider.floatValue)
-            scrollSpeedSlider.floatValue = 15.f;
-        else if (scrollDirSelect.selectedSegment >= 2
-                 && scrollSpeedSlider.floatValue)
-            scrollSpeedSlider.floatValue = scrollSpeedSlider.minValue;
-    }
-        
-}
-
-- (IBAction)radioChanged:(NSView *)sender {
-    [sender.window makeFirstResponder:sender];
-    if (radioButtons.selectedRow == 1)
-        [keyInput.window makeFirstResponder:keyInput];
-    [self commit];
-}
-
-- (void)keyInputField:(NJKeyInputField *)keyInput didChangeKey:(CGKeyCode)keyCode {
-    [radioButtons selectCellAtRow:1 column:0];
-    [radioButtons.window makeFirstResponder:radioButtons];
-    [self commit];
-}
-
-- (void)keyInputFieldDidClear:(NJKeyInputField *)keyInput {
-    [radioButtons selectCellAtRow:0 column:0];
-    [self commit];
-}
-
-- (void)mappingChosen:(id)sender {
-    [radioButtons selectCellAtRow:2 column:0];
-    [mappingPopup.window makeFirstResponder:mappingPopup];
-    [self commit];
-}
-
-- (void)mdirChanged:(NSView *)sender {
-    [radioButtons selectCellAtRow:3 column:0];
-    [sender.window makeFirstResponder:sender];
-    [self commit];
-}
-
-- (void)mouseSpeedChanged:(NSSlider *)sender {
-    [radioButtons selectCellAtRow:3 column:0];
-    [sender.window makeFirstResponder:sender];
-    [self commit];
-}
-
-- (void)mbtnChanged:(NSView *)sender {
-    [radioButtons selectCellAtRow:4 column:0];
-    [sender.window makeFirstResponder:sender];
-    [self commit];
-}
-
-- (void)sdirChanged:(NSView *)sender {
-    [radioButtons selectCellAtRow:5 column:0];
-    [sender.window makeFirstResponder:sender];
-    [self commit];
-}
-
-- (void)scrollSpeedChanged:(NSSlider *)sender {
-    [radioButtons selectCellAtRow:5 column:0];
-    [sender.window makeFirstResponder:sender];
-    if (!sender.floatValue && scrollDirSelect.selectedSegment < 2)
-        scrollDirSelect.selectedSegment += 2;
-    else if (sender.floatValue && scrollDirSelect.selectedSegment >= 2)
-        scrollDirSelect.selectedSegment -= 2;
-    [self commit];
-}
-
-- (NJOutput *)currentOutput {
-    return mappingsController.currentMapping[inputController.selectedInput];
-}
-
-- (NJOutput *)makeOutput {
-    switch (radioButtons.selectedRow) {
-        case 0:
-            return nil;
-        case 1:
-            if (keyInput.hasKeyCode) {
-                NJOutputKeyPress *k = [[NJOutputKeyPress alloc] init];
-                k.vk = keyInput.keyCode;
-                return k;
-            } else {
-                return nil;
-            }
-            break;
-        case 2: {
-            NJOutputMapping *c = [[NJOutputMapping alloc] init];
-            c.mapping = mappingsController[mappingPopup.indexOfSelectedItem];
-            return c;
-        }
-        case 3: {
-            NJOutputMouseMove *mm = [[NJOutputMouseMove alloc] init];
-            mm.axis = mouseDirSelect.selectedSegment;
-            mm.speed = mouseSpeedSlider.floatValue;
-            return mm;
-        }
-        case 4: {
-            NJOutputMouseButton *mb = [[NJOutputMouseButton alloc] init];
-            mb.button = mouseBtnSelect.selectedSegment == 0 ? kCGMouseButtonLeft : kCGMouseButtonRight;
-            return mb;
-        }
-        case 5: {
-            NJOutputMouseScroll *ms = [[NJOutputMouseScroll alloc] init];
-            ms.direction = (scrollDirSelect.selectedSegment & 1) ? 1 : -1;
-            ms.speed = scrollDirSelect.selectedSegment < 2
-                ? scrollSpeedSlider.floatValue
-                : 0.f;
-            return ms;
-        }
-        default:
-            return nil;
-    }
-}
-
-- (void)commit {
-    [self cleanUpInterface];
-    mappingsController.currentMapping[inputController.selectedInput] = [self makeOutput];
-    [mappingsController save];
-}
-
-- (BOOL)enabled {
-    return [radioButtons isEnabled];
-}
-
-- (void)setEnabled:(BOOL)enabled {
-    [radioButtons setEnabled:enabled];
-    [keyInput setEnabled:enabled];
-    [mappingPopup setEnabled:enabled];
-    [mouseDirSelect setEnabled:enabled];
-    [mouseSpeedSlider setEnabled:enabled];
-    [mouseBtnSelect setEnabled:enabled];
-    [scrollDirSelect setEnabled:enabled];
-    [scrollSpeedSlider setEnabled:enabled];
-}
-
-- (void)loadOutput:(NJOutput *)output forInput:(NJInput *)input {
-    if (!input) {
-        self.enabled = NO;
-        title.stringValue = @"";
-    } else {
-        self.enabled = YES;
-        NSString *inpFullName = input.name;
-        for (id <NJInputPathElement> cur = input.base; cur; cur = cur.base) {
-            inpFullName = [[NSString alloc] initWithFormat:@"%@ > %@", cur.name, inpFullName];
-        }
-        title.stringValue = inpFullName;
-    }
-
-    if ([output isKindOfClass:NJOutputKeyPress.class]) {
-        [radioButtons selectCellAtRow:1 column:0];
-        keyInput.keyCode = [(NJOutputKeyPress*)output vk];
-    } else if ([output isKindOfClass:NJOutputMapping.class]) {
-        [radioButtons selectCellAtRow:2 column:0];
-        NSMenuItem *item = [mappingPopup itemWithRepresentedObject:[(NJOutputMapping *)output mapping]];
-        [mappingPopup selectItem:item];
-        if (!item)
-            [radioButtons selectCellAtRow:self.enabled ? 0 : -1 column:0];
-    }
-    else if ([output isKindOfClass:NJOutputMouseMove.class]) {
-        [radioButtons selectCellAtRow:3 column:0];
-        mouseDirSelect.selectedSegment = [(NJOutputMouseMove *)output axis];
-        mouseSpeedSlider.floatValue = [(NJOutputMouseMove *)output speed];
-    }
-    else if ([output isKindOfClass:NJOutputMouseButton.class]) {
-        [radioButtons selectCellAtRow:4 column:0];
-        mouseBtnSelect.selectedSegment = [(NJOutputMouseButton *)output button] == kCGMouseButtonLeft ? 0 : 1;
-    }
-    else if ([output isKindOfClass:NJOutputMouseScroll.class]) {
-        [radioButtons selectCellAtRow:5 column:0];
-        int direction = [(NJOutputMouseScroll *)output direction];
-        float speed = [(NJOutputMouseScroll *)output speed];
-        scrollDirSelect.selectedSegment = (direction > 0) + !speed * 2;
-        scrollSpeedSlider.floatValue = speed;
-    } else {
-        [radioButtons selectCellAtRow:self.enabled ? 0 : -1 column:0];
-    }
-    [self cleanUpInterface];
-}
-
-- (void)loadCurrent {
-    [self loadOutput:self.currentOutput forInput:inputController.selectedInput];
-}
-
-- (void)focusKey {
-    if (radioButtons.selectedRow <= 1)
-        [keyInput.window makeFirstResponder:keyInput];
-    else
-        [keyInput resignIfFirstResponder];
-}
-
-- (void)mappingListDidChange:(NSNotification *)note {
-    NSArray *mappings = note.object;
-    NJMapping *current = mappingPopup.selectedItem.representedObject;
-    [mappingPopup.menu removeAllItems];
-    for (NJMapping *mapping in mappings) {
-        NSMenuItem *item = [[NSMenuItem alloc] initWithTitle:mapping.name
-                                                      action:@selector(mappingChosen:)
-                                               keyEquivalent:@""];
-        item.target = self;
-        item.representedObject = mapping;
-        [mappingPopup.menu addItem:item];
-    }
-    [mappingPopup selectItemWithRepresentedObject:current];
-}
-
-@end
diff --git a/NJOutputKeyPress.h b/NJOutputKeyPress.h
deleted file mode 100644 (file)
index 052b010..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-//
-//  NJOutputKeyPress.h
-//  Enjoy
-//
-//  Created by Sam McCall on 5/05/09.
-//  Copyright 2009 University of Otago. All rights reserved.
-//
-
-#import "NJOutput.h"
-
-@interface NJOutputKeyPress : NJOutput
-
-@property (nonatomic, assign) CGKeyCode vk;
-
-@end
diff --git a/NJOutputKeyPress.m b/NJOutputKeyPress.m
deleted file mode 100644 (file)
index 622cf41..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-//
-//  NJOutputKeyPress.m
-//  Enjoy
-//
-//  Created by Sam McCall on 5/05/09.
-//
-
-#import "NJOutputKeyPress.h"
-
-#import "NJKeyInputField.h"
-
-@implementation NJOutputKeyPress
-
-+ (NSString *)serializationCode {
-    return @"key press";
-}
-
-- (NSDictionary *)serialize {
-    return _vk != NJKeyInputFieldEmpty
-        ? @{ @"type": self.class.serializationCode, @"key": @(_vk) }
-        : nil;
-}
-
-+ (NJOutput *)outputDeserialize:(NSDictionary *)serialization
-                  withMappings:(NSArray *)mappings {
-    NJOutputKeyPress *output = [[NJOutputKeyPress alloc] init];
-    output.vk = [serialization[@"key"] intValue];
-    return output;
-}
-
-- (void)trigger {
-    CGEventRef keyDown = CGEventCreateKeyboardEvent(NULL, _vk, YES);
-    CGEventPost(kCGHIDEventTap, keyDown);
-    CFRelease(keyDown);
-}
-
-- (void)untrigger {
-    CGEventRef keyUp = CGEventCreateKeyboardEvent(NULL, _vk, NO);
-    CGEventPost(kCGHIDEventTap, keyUp);
-    CFRelease(keyUp);
-}
-
-@end
diff --git a/NJOutputMapping.h b/NJOutputMapping.h
deleted file mode 100644 (file)
index e8c3029..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-//
-//  NJOutputMapping.h
-//  Enjoy
-//
-//  Created by Sam McCall on 6/05/09.
-//  Copyright 2009 University of Otago. All rights reserved.
-//
-
-#import "NJOutput.h"
-
-@class NJMapping;
-
-@interface NJOutputMapping : NJOutput
-
-@property (nonatomic, weak) NJMapping *mapping;
-
-@end
diff --git a/NJOutputMapping.m b/NJOutputMapping.m
deleted file mode 100644 (file)
index fa8fda1..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-//
-//  NJOutputMapping.m
-//  Enjoy
-//
-//  Created by Sam McCall on 6/05/09.
-//
-
-#import "NJOutputMapping.h"
-
-#import "EnjoyableApplicationDelegate.h"
-#import "NJMapping.h"
-#import "NJMappingsController.h"
-
-@implementation NJOutputMapping
-
-+ (NSString *)serializationCode {
-    return @"mapping";
-}
-
-- (NSDictionary *)serialize {
-    return _mapping
-        ? @{ @"type": self.class.serializationCode, @"name": _mapping.name }
-        : nil;
-}
-
-+ (NJOutputMapping *)outputDeserialize:(NSDictionary *)serialization
-                        withMappings:(NSArray *)mappings {
-    NSString *name = serialization[@"name"];
-    NJOutputMapping *output = [[NJOutputMapping alloc] init];
-    for (NJMapping *mapping in mappings) {
-        if ([mapping.name isEqualToString:name]) {
-            output.mapping = mapping;
-            return output;
-        }
-    }
-    return nil;
-}
-
-- (void)trigger {
-    EnjoyableApplicationDelegate *ctrl = (EnjoyableApplicationDelegate *)NSApplication.sharedApplication.delegate;
-    [ctrl.mappingsController activateMapping:_mapping];
-}
-
-@end
diff --git a/NJOutputMouseButton.h b/NJOutputMouseButton.h
deleted file mode 100644 (file)
index 4d790e5..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-//
-//  NJOutputMouseButton.h
-//  Enjoy
-//
-//  Created by Yifeng Huang on 7/27/12.
-//
-
-#import "NJOutput.h"
-
-@interface NJOutputMouseButton : NJOutput
-
-@property (nonatomic, assign) CGMouseButton button;
-
-@end
diff --git a/NJOutputMouseButton.m b/NJOutputMouseButton.m
deleted file mode 100644 (file)
index d5b1f16..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-//
-//  NJOutputMouseButton.m
-//  Enjoy
-//
-//  Created by Yifeng Huang on 7/27/12.
-//
-
-#import "NJOutputMouseButton.h"
-
-@implementation NJOutputMouseButton
-
-+ (NSString *)serializationCode {
-    return @"mouse button";
-}
-
-- (NSDictionary *)serialize {
-    return @{ @"type": self.class.serializationCode, @"button": @(_button) };
-}
-
-+ (NJOutput *)outputDeserialize:(NSDictionary *)serialization
-                  withMappings:(NSArray *)mappings {
-    NJOutputMouseButton *output = [[NJOutputMouseButton alloc] init];
-    output.button = [serialization[@"button"] intValue];
-    return output;
-}
-
-- (void)trigger {
-    CGFloat height = NSScreen.mainScreen.frame.size.height;
-    NSPoint mouseLoc = NSEvent.mouseLocation;
-    CGEventType eventType = (_button == kCGMouseButtonLeft) ? kCGEventLeftMouseDown : kCGEventRightMouseDown;
-    CGEventRef click = CGEventCreateMouseEvent(NULL,
-                                               eventType,
-                                               CGPointMake(mouseLoc.x, height - mouseLoc.y),
-                                               _button);
-    CGEventPost(kCGHIDEventTap, click);
-    CFRelease(click);
-}
-
-- (void)untrigger {
-    CGFloat height = NSScreen.mainScreen.frame.size.height;
-    NSPoint mouseLoc = NSEvent.mouseLocation;
-    CGEventType eventType = (_button == kCGMouseButtonLeft) ? kCGEventLeftMouseUp : kCGEventRightMouseUp;
-    CGEventRef click = CGEventCreateMouseEvent(NULL,
-                                               eventType,
-                                               CGPointMake(mouseLoc.x, height - mouseLoc.y),
-                                               _button);
-    CGEventPost(kCGHIDEventTap, click);
-    CFRelease(click);
-}
-
-@end
diff --git a/NJOutputMouseMove.h b/NJOutputMouseMove.h
deleted file mode 100644 (file)
index 428416f..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-//
-//  NJOutputMouseMove.h
-//  Enjoy
-//
-//  Created by Yifeng Huang on 7/26/12.
-//
-
-#import "NJOutput.h"
-
-@interface NJOutputMouseMove : NJOutput
-
-@property (nonatomic, assign) int axis;
-@property (nonatomic, assign) float speed;
-
-@end
diff --git a/NJOutputMouseMove.m b/NJOutputMouseMove.m
deleted file mode 100644 (file)
index 884a3d3..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-//
-//  NJOutputMouseMove.m
-//  Enjoy
-//
-//  Created by Yifeng Huang on 7/26/12.
-//
-
-#import "NJOutputMouseMove.h"
-
-#import "NJDeviceController.h"
-
-@implementation NJOutputMouseMove
-
-+ (NSString *)serializationCode {
-    return @"mouse move";
-}
-
-- (NSDictionary *)serialize {
-    return @{ @"type": self.class.serializationCode,
-              @"axis": @(_axis),
-              @"speed": @(_speed),
-              };
-}
-
-+ (NJOutput *)outputDeserialize:(NSDictionary *)serialization
-                  withMappings:(NSArray *)mappings {
-    NJOutputMouseMove *output = [[NJOutputMouseMove alloc] init];
-    output.axis = [serialization[@"axis"] intValue];
-    output.speed = [serialization[@"speed"] floatValue];
-    if (!output.speed)
-        output.speed = 4;
-    return output;
-}
-
-- (BOOL)isContinuous {
-    return YES;
-}
-
-- (BOOL)update:(NJDeviceController *)jc {
-    if (self.magnitude < 0.05)
-        return NO; // dead zone
-    
-    CGFloat height = NSScreen.mainScreen.frame.size.height;
-    
-    float dx = 0.f, dy = 0.f;
-    switch (_axis) {
-        case 0:
-            dx = -self.magnitude * _speed;
-            break;
-        case 1:
-            dx = self.magnitude * _speed;
-            break;
-        case 2:
-            dy = -self.magnitude * _speed;
-            break;
-        case 3:
-            dy = self.magnitude * _speed;
-            break;
-    }
-    NSPoint mouseLoc = jc.mouseLoc;
-    mouseLoc.x += dx;
-    mouseLoc.y -= dy;
-    jc.mouseLoc = mouseLoc;
-    
-    CGEventRef move = CGEventCreateMouseEvent(NULL, kCGEventMouseMoved,
-                                              CGPointMake(mouseLoc.x, height - mouseLoc.y),
-                                              0);
-    CGEventSetType(move, kCGEventMouseMoved);
-    CGEventSetIntegerValueField(move, kCGMouseEventDeltaX, (int)dx);
-    CGEventSetIntegerValueField(move, kCGMouseEventDeltaY, (int)dy);
-    CGEventPost(kCGHIDEventTap, move);
-    CFRelease(move);
-    return YES;
-}
-
-@end
diff --git a/NJOutputMouseScroll.h b/NJOutputMouseScroll.h
deleted file mode 100644 (file)
index dd0444a..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-//
-//  NJOutputMouseScroll.h
-//  Enjoy
-//
-//  Created by Yifeng Huang on 7/28/12.
-//
-
-#import "NJOutput.h"
-
-@interface NJOutputMouseScroll : NJOutput
-
-@property (nonatomic, assign) int direction;
-@property (nonatomic, assign) float speed;
-
-@end
diff --git a/NJOutputMouseScroll.m b/NJOutputMouseScroll.m
deleted file mode 100644 (file)
index 812685f..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-//
-//  NJOutputMouseScroll.m
-//  Enjoy
-//
-//  Created by Yifeng Huang on 7/28/12.
-//
-
-#import "NJOutputMouseScroll.h"
-
-@implementation NJOutputMouseScroll
-
-+ (NSString *)serializationCode {
-    return @"mouse scroll";
-}
-
-- (NSDictionary *)serialize {
-    return @{ @"type": self.class.serializationCode,
-              @"direction": @(_direction),
-              @"speed": @(_speed)
-              };
-}
-
-+ (NJOutput *)outputDeserialize:(NSDictionary *)serialization
-                  withMappings:(NSArray *)mappings {
-    NJOutputMouseScroll *output = [[NJOutputMouseScroll alloc] init];
-    output.direction = [serialization[@"direction"] intValue];
-    output.speed = [serialization[@"direction"] floatValue];
-    return output;
-}
-
-- (BOOL)isContinuous {
-    return !!self.speed;
-}
-
-- (void)trigger {
-    if (!self.speed) {
-        CGEventRef scroll = CGEventCreateScrollWheelEvent(NULL,
-                                                          kCGScrollEventUnitLine,
-                                                          1,
-                                                          _direction);
-        CGEventPost(kCGHIDEventTap, scroll);
-        CFRelease(scroll);
-    }
-}
-
-- (BOOL)update:(NJDeviceController *)jc {
-    if (self.magnitude < 0.05f)
-        return NO; // dead zone
-    
-    int amount = (int)(_speed * self.magnitude * _direction);
-    CGEventRef scroll = CGEventCreateScrollWheelEvent(NULL,
-                                                      kCGScrollEventUnitPixel,
-                                                      1,
-                                                      amount);
-    CGEventPost(kCGHIDEventTap, scroll);
-    CFRelease(scroll);
-
-    return YES;
-}
-
-@end
diff --git a/NSError+Description.h b/NSError+Description.h
deleted file mode 100644 (file)
index a722e9e..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-#import <Foundation/Foundation.h>
-
-@interface NSError (Description)
-
-+ (NSError *)errorWithDomain:(NSString *)domain
-                        code:(NSInteger)code
-                 description:(NSString *)description;
-
-@end
diff --git a/NSError+Description.m b/NSError+Description.m
deleted file mode 100644 (file)
index 126bb17..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-#import "NSError+Description.h"
-
-@implementation NSError (Description)
-
-+ (NSError *)errorWithDomain:(NSString *)domain
-                        code:(NSInteger)code
-                 description:(NSString *)description {
-    NSDictionary *errorDict = @{ NSLocalizedDescriptionKey : description };
-    return [NSError errorWithDomain:domain code:code userInfo:errorDict];
-
-}
-
-@end
diff --git a/NSFileManager+UniqueNames.h b/NSFileManager+UniqueNames.h
deleted file mode 100644 (file)
index 82c57d4..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-//
-//  NSFileManager+UniqueNames.h
-//  Enjoyable
-//
-//  Created by Joe Wreschnig on 3/7/13.
-//
-//
-
-#import <Foundation/Foundation.h>
-
-@interface NSFileManager (UniqueNames)
-
-- (NSURL *)generateUniqueURLWithBase:(NSURL *)canonical;
-    // Generate a probably-unique URL by trying sequential indices, e.g.
-    //     file://Test.txt
-    //     file://Test (1).txt
-    //     file://Test (2).txt
-    // and so on.
-    //
-    // The URL is only probably unique. It is subject to the usual
-    // race conditions associated with generating a filename before
-    // actually opening it. It also does not check remote resources,
-    // as it operates synchronously. Finally, it gives up after 10,000
-    // indices.
-
-@end
diff --git a/NSFileManager+UniqueNames.m b/NSFileManager+UniqueNames.m
deleted file mode 100644 (file)
index c7eb768..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-//
-//  NSFileManager+UniqueNames.m
-//  Enjoyable
-//
-//  Created by Joe Wreschnig on 3/7/13.
-//
-//
-
-#import "NSFileManager+UniqueNames.h"
-
-@implementation NSFileManager (UniqueNames)
-
-- (NSURL *)generateUniqueURLWithBase:(NSURL *)canonical {
-    // Punt for cases that are just too hard.
-    if (!canonical.isFileURL)
-        return canonical;
-
-    NSString *trying = canonical.path;
-    NSString *dirname = [trying stringByDeletingLastPathComponent];
-    NSString *basename = [trying.lastPathComponent stringByDeletingPathExtension];
-    NSString *extension = trying.pathExtension;
-    int index = 1;
-    while ([self fileExistsAtPath:trying] && index < 10000) {
-        NSString *indexName = [NSString stringWithFormat:@"%@ (%d)", basename, index++];
-        indexName = [indexName stringByAppendingPathExtension:extension];
-        trying = [dirname stringByAppendingPathComponent:indexName];
-    }
-    return [NSURL fileURLWithPath:trying];
-}
-
-@end
diff --git a/NSMenu+RepresentedObjectAccessors.h b/NSMenu+RepresentedObjectAccessors.h
deleted file mode 100644 (file)
index ecb28a6..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-//
-//  NSMenu+RepresentedObjectAccessors.h
-//  Enjoyable
-//
-//  Created by Joe Wreschnig on 3/4/13.
-//
-//
-
-#import <Cocoa/Cocoa.h>
-
-@interface NSMenu (RepresentedObjectAccessors)
-    // Helpers for using represented objects in menu items.
-
-- (NSMenuItem *)itemWithRepresentedObject:(id)object;
-    // Returns the first menu item in the receiver that has a given
-    // represented object.
-
-- (void)removeItemWithRepresentedObject:(id)object;
-    // Removes the first menu item representing the given object in the
-    // receiver.
-    //
-    // After it removes the menu item, this method posts an
-    // NSMenuDidRemoveItemNotification.
-
-- (NSMenuItem *)lastItem;
-    // Return the last menu item in the receiver, or nil if the menu
-    // has no items.
-
-- (void)removeLastItem;
-    // Removes the last menu item in the receiver, if there is one.
-    //
-    // After and if it removes the menu item, this method posts an
-    // NSMenuDidRemoveItemNotification.
-
-@end
-
-@interface NSPopUpButton (RepresentedObjectAccessors)
-
-- (NSMenuItem *)itemWithRepresentedObject:(id)object;
-    // Returns the first item in the receiver's menu that has a given
-    // represented object.
-
-- (void)selectItemWithRepresentedObject:(id)object;
-    // Selects the first item in the receiver's menu that has a give
-    // represented object.
-
-@end
diff --git a/NSMenu+RepresentedObjectAccessors.m b/NSMenu+RepresentedObjectAccessors.m
deleted file mode 100644 (file)
index a63f083..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-//
-//  NSMenu+RepresentedObjectAccessors.m
-//  Enjoyable
-//
-//  Created by Joe Wreschnig on 3/4/13.
-//
-//
-
-#import "NSMenu+RepresentedObjectAccessors.h"
-
-@implementation NSMenu (RepresentedObjectAccessors)
-
-- (NSMenuItem *)itemWithRepresentedObject:(id)object {
-    for (NSMenuItem *item in self.itemArray)
-        if ([item.representedObject isEqual:object])
-            return item;
-    return nil;
-}
-
-- (void)removeItemWithRepresentedObject:(id)object {
-    NSInteger idx = [self indexOfItemWithRepresentedObject:object];
-    if (idx != -1)
-        [self removeItemAtIndex:idx];
-}
-
-- (NSMenuItem *)lastItem {
-    return self.itemArray.lastObject;
-}
-
-- (void)removeLastItem {
-    if (self.numberOfItems)
-        [self removeItemAtIndex:self.numberOfItems - 1];
-}
-
-@end
-
-@implementation NSPopUpButton (RepresentedObjectAccessors)
-
-- (NSMenuItem *)itemWithRepresentedObject:(id)object {
-    return [self.menu itemWithRepresentedObject:object];
-}
-
-- (void)selectItemWithRepresentedObject:(id)object {
-    [self selectItemAtIndex:[self indexOfItemWithRepresentedObject:object]];
-}
-
-
-@end
diff --git a/NSMutableArray+MoveObject.h b/NSMutableArray+MoveObject.h
deleted file mode 100644 (file)
index c1c60d2..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-//
-//  NSMutableArray+MoveObject.h
-//  Enjoyable
-//
-//  Created by Joe Wreschnig on 3/7/13.
-//
-//
-
-#import <Foundation/Foundation.h>
-
-@interface NSMutableArray (MoveObject)
-
-- (void)moveObjectAtIndex:(NSUInteger)src toIndex:(NSUInteger)dst;
-
-@end
diff --git a/NSMutableArray+MoveObject.m b/NSMutableArray+MoveObject.m
deleted file mode 100644 (file)
index 8d9a4ee..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-//
-//  NSMutableArray+MoveObject.m
-//  Enjoyable
-//
-//  Created by Joe Wreschnig on 3/7/13.
-//
-//
-
-#import "NSMutableArray+MoveObject.h"
-
-@implementation NSMutableArray (MoveObject)
-
-- (void)moveObjectAtIndex:(NSUInteger)src toIndex:(NSUInteger)dst {
-    id obj = self[src];
-    [self removeObjectAtIndex:src];
-    [self insertObject:obj atIndex:dst > src ? dst - 1 : dst];
-}
-
-@end
diff --git a/NSString+FixFilename.h b/NSString+FixFilename.h
deleted file mode 100644 (file)
index b3e318f..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-//
-//  NSString+FixFilename.h
-//  Enjoyable
-//
-//  Created by Joe Wreschnig on 3/7/13.
-//
-//
-
-#import <Foundation/Foundation.h>
-
-@interface NSCharacterSet (FixFilename)
-
-+ (NSCharacterSet *)invalidPathComponentCharacterSet;
-    // A character set containing the characters that are invalid to
-    // use in path components on common filesystems.
-
-@end
-
-@interface NSString (FixFilename)
-
-- (NSString *)stringByFixingPathComponent;
-    // Does various operations to make this string suitable for use as
-    // a single path component of a normal filename. Removes
-    // characters that are invalid. Strips whitespace from the
-    // beginning and end. If the first character is a . or a -, a _ is
-    // added to the front.
-
-@end
diff --git a/NSString+FixFilename.m b/NSString+FixFilename.m
deleted file mode 100644 (file)
index 06a837c..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-//
-//  NSString+FixFilename.m
-//  Enjoyable
-//
-//  Created by Joe Wreschnig on 3/7/13.
-//
-//
-
-#import "NSString+FixFilename.h"
-
-@implementation NSCharacterSet (FixFilename)
-
-+ (NSCharacterSet *)invalidPathComponentCharacterSet {
-    return [NSCharacterSet characterSetWithCharactersInString:@"\"\\/:*?<>|"];
-}
-
-@end
-
-@implementation NSString (FixFilename)
-
-- (NSString *)stringByFixingPathComponent {
-    NSCharacterSet *invalid = NSCharacterSet.invalidPathComponentCharacterSet;
-    NSCharacterSet *whitespace = NSCharacterSet.whitespaceAndNewlineCharacterSet;
-    NSArray *parts = [self componentsSeparatedByCharactersInSet:invalid];
-    NSString *name = [parts componentsJoinedByString:@"_"];
-    name = [name stringByTrimmingCharactersInSet:whitespace];
-    if (!name.length)
-        return @"_";
-    unichar first = [name characterAtIndex:0];
-    if (first == '.' || first == '-')
-        name = [@"_" stringByAppendingString:name];
-    return name;
-}
-
-@end
diff --git a/NSView+FirstResponder.h b/NSView+FirstResponder.h
deleted file mode 100644 (file)
index cd89aa5..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#import <Cocoa/Cocoa.h>
-
-@interface NSView (FirstResponder)
-
-- (BOOL)resignIfFirstResponder;
-    // Resign first responder status if this view is the active first
-    // responder in its window. Returns whether first responder status
-    // was resigned; YES if it was and NO if refused or the view was
-    // not the first responder.
-
-@end
diff --git a/NSView+FirstResponder.m b/NSView+FirstResponder.m
deleted file mode 100644 (file)
index 0575b0d..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-#import "NSView+FirstResponder.h"
-
-@implementation NSView (FirstResponder)
-
-- (BOOL)resignIfFirstResponder {
-    NSWindow *window = self.window;
-    return window.firstResponder == self
-        ? [window makeFirstResponder:nil]
-        : NO;
-}
-
-@end
diff --git a/Other Sources/Enjoyable_Prefix.pch b/Other Sources/Enjoyable_Prefix.pch
new file mode 100644 (file)
index 0000000..4845e9d
--- /dev/null
@@ -0,0 +1,16 @@
+//
+// Prefix header for all source files of the 'Enjoy' target in the 'Enjoy' project
+//
+
+#ifdef __OBJC__
+    #import <Cocoa/Cocoa.h>
+#endif
+
+#import <IOKit/hid/IOHIDLib.h>
+
+#import "NSError+Description.h"
+#import "NSMenu+RepresentedObjectAccessors.h"
+#import "NSView+FirstResponder.h"
+#import "NSMutableArray+MoveObject.h"
+#import "NSFileManager+UniqueNames.h"
+#import "NSString+FixFilename.h"
diff --git a/Other Sources/NJEvents.h b/Other Sources/NJEvents.h
new file mode 100644 (file)
index 0000000..ce87b24
--- /dev/null
@@ -0,0 +1,12 @@
+//
+//  NJEvents.h
+//  Enjoyable
+//
+//  Created by Joe Wreschnig on 3/2/13.
+//
+//
+
+#define NJEventMappingChanged @"NJEventMappingChanged"
+#define NJEventMappingListChanged @"NJEventMappingListChanged"
+#define NJEventTranslationActivated @"NJEventTranslationActivated"
+#define NJEventTranslationDeactivated @"NJEventTranslationDeactivated"
diff --git a/Other Sources/main.m b/Other Sources/main.m
new file mode 100644 (file)
index 0000000..9fbf37b
--- /dev/null
@@ -0,0 +1,13 @@
+//
+//  main.m
+//  Enjoy
+//
+//  Created by Sam McCall on 4/05/09.
+//
+
+#import <Cocoa/Cocoa.h>
+
+int main(int argc, char *argv[])
+{
+    return NSApplicationMain(argc,  (const char **) argv);
+}
diff --git a/Resources/English.lproj/InfoPlist.strings b/Resources/English.lproj/InfoPlist.strings
new file mode 100644 (file)
index 0000000..84fe32f
Binary files /dev/null and b/Resources/English.lproj/InfoPlist.strings differ
diff --git a/Resources/English.lproj/MainMenu.xib b/Resources/English.lproj/MainMenu.xib
new file mode 100644 (file)
index 0000000..cd9a1b9
--- /dev/null
@@ -0,0 +1,3084 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="8.00">
+       <data>
+               <int key="IBDocument.SystemTarget">1080</int>
+               <string key="IBDocument.SystemVersion">12C2034</string>
+               <string key="IBDocument.InterfaceBuilderVersion">3084</string>
+               <string key="IBDocument.AppKitVersion">1187.34</string>
+               <string key="IBDocument.HIToolboxVersion">625.00</string>
+               <object class="NSMutableDictionary" key="IBDocument.PluginVersions">
+                       <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                       <string key="NS.object.0">3084</string>
+               </object>
+               <array key="IBDocument.IntegratedClassDependencies">
+                       <string>NSBox</string>
+                       <string>NSButton</string>
+                       <string>NSButtonCell</string>
+                       <string>NSCustomObject</string>
+                       <string>NSCustomView</string>
+                       <string>NSMatrix</string>
+                       <string>NSMenu</string>
+                       <string>NSMenuItem</string>
+                       <string>NSOutlineView</string>
+                       <string>NSPopUpButton</string>
+                       <string>NSPopUpButtonCell</string>
+                       <string>NSPopover</string>
+                       <string>NSScrollView</string>
+                       <string>NSScroller</string>
+                       <string>NSSegmentedCell</string>
+                       <string>NSSegmentedControl</string>
+                       <string>NSSlider</string>
+                       <string>NSSliderCell</string>
+                       <string>NSSplitView</string>
+                       <string>NSTableColumn</string>
+                       <string>NSTableView</string>
+                       <string>NSTextField</string>
+                       <string>NSTextFieldCell</string>
+                       <string>NSToolbar</string>
+                       <string>NSToolbarFlexibleSpaceItem</string>
+                       <string>NSToolbarItem</string>
+                       <string>NSView</string>
+                       <string>NSViewController</string>
+                       <string>NSWindowTemplate</string>
+               </array>
+               <array key="IBDocument.PluginDependencies">
+                       <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+               </array>
+               <object class="NSMutableDictionary" key="IBDocument.Metadata">
+                       <string key="NS.key.0">PluginDependencyRecalculationVersion</string>
+                       <integer value="1" key="NS.object.0"/>
+               </object>
+               <array class="NSMutableArray" key="IBDocument.RootObjects" id="1048">
+                       <object class="NSCustomObject" id="1021">
+                               <string key="NSClassName">NSApplication</string>
+                       </object>
+                       <object class="NSCustomObject" id="1014">
+                               <string key="NSClassName">FirstResponder</string>
+                       </object>
+                       <object class="NSCustomObject" id="1050">
+                               <string key="NSClassName">NSApplication</string>
+                       </object>
+                       <object class="NSMenu" id="649796088">
+                               <string key="NSTitle">AMainMenu</string>
+                               <array class="NSMutableArray" key="NSMenuItems">
+                                       <object class="NSMenuItem" id="694149608">
+                                               <reference key="NSMenu" ref="649796088"/>
+                                               <string key="NSTitle">Enjoyable</string>
+                                               <string type="base64-UTF8" key="NSKeyEquiv">CA</string>
+                                               <int key="NSKeyEquivModMask">1048576</int>
+                                               <int key="NSMnemonicLoc">2147483647</int>
+                                               <object class="NSCustomResource" key="NSOnImage" id="35465992">
+                                                       <string key="NSClassName">NSImage</string>
+                                                       <string key="NSResourceName">NSMenuCheckmark</string>
+                                               </object>
+                                               <object class="NSCustomResource" key="NSMixedImage" id="502551668">
+                                                       <string key="NSClassName">NSImage</string>
+                                                       <string key="NSResourceName">NSMenuMixedState</string>
+                                               </object>
+                                               <string key="NSAction">submenuAction:</string>
+                                               <object class="NSMenu" key="NSSubmenu" id="110575045">
+                                                       <string key="NSTitle">Enjoyable</string>
+                                                       <array class="NSMutableArray" key="NSMenuItems">
+                                                               <object class="NSMenuItem" id="238522557">
+                                                                       <reference key="NSMenu" ref="110575045"/>
+                                                                       <string key="NSTitle">About Enjoyable</string>
+                                                                       <string key="NSKeyEquiv"/>
+                                                                       <int key="NSMnemonicLoc">2147483647</int>
+                                                                       <reference key="NSOnImage" ref="35465992"/>
+                                                                       <reference key="NSMixedImage" ref="502551668"/>
+                                                               </object>
+                                                               <object class="NSMenuItem" id="304266470">
+                                                                       <reference key="NSMenu" ref="110575045"/>
+                                                                       <bool key="NSIsDisabled">YES</bool>
+                                                                       <bool key="NSIsSeparator">YES</bool>
+                                                                       <string key="NSTitle"/>
+                                                                       <string key="NSKeyEquiv"/>
+                                                                       <int key="NSKeyEquivModMask">1048576</int>
+                                                                       <int key="NSMnemonicLoc">2147483647</int>
+                                                                       <reference key="NSOnImage" ref="35465992"/>
+                                                                       <reference key="NSMixedImage" ref="502551668"/>
+                                                               </object>
+                                                               <object class="NSMenuItem" id="1046388886">
+                                                                       <reference key="NSMenu" ref="110575045"/>
+                                                                       <string key="NSTitle">Services</string>
+                                                                       <string key="NSKeyEquiv"/>
+                                                                       <int key="NSKeyEquivModMask">1048576</int>
+                                                                       <int key="NSMnemonicLoc">2147483647</int>
+                                                                       <reference key="NSOnImage" ref="35465992"/>
+                                                                       <reference key="NSMixedImage" ref="502551668"/>
+                                                                       <string key="NSAction">submenuAction:</string>
+                                                                       <object class="NSMenu" key="NSSubmenu" id="752062318">
+                                                                               <string key="NSTitle">Services</string>
+                                                                               <array class="NSMutableArray" key="NSMenuItems"/>
+                                                                               <string key="NSName">_NSServicesMenu</string>
+                                                                       </object>
+                                                               </object>
+                                                               <object class="NSMenuItem" id="646227648">
+                                                                       <reference key="NSMenu" ref="110575045"/>
+                                                                       <bool key="NSIsDisabled">YES</bool>
+                                                                       <bool key="NSIsSeparator">YES</bool>
+                                                                       <string key="NSTitle"/>
+                                                                       <string key="NSKeyEquiv"/>
+                                                                       <int key="NSKeyEquivModMask">1048576</int>
+                                                                       <int key="NSMnemonicLoc">2147483647</int>
+                                                                       <reference key="NSOnImage" ref="35465992"/>
+                                                                       <reference key="NSMixedImage" ref="502551668"/>
+                                                               </object>
+                                                               <object class="NSMenuItem" id="755159360">
+                                                                       <reference key="NSMenu" ref="110575045"/>
+                                                                       <string key="NSTitle">Hide Enjoyable</string>
+                                                                       <string key="NSKeyEquiv">h</string>
+                                                                       <int key="NSKeyEquivModMask">1048576</int>
+                                                                       <int key="NSMnemonicLoc">2147483647</int>
+                                                                       <reference key="NSOnImage" ref="35465992"/>
+                                                                       <reference key="NSMixedImage" ref="502551668"/>
+                                                               </object>
+                                                               <object class="NSMenuItem" id="342932134">
+                                                                       <reference key="NSMenu" ref="110575045"/>
+                                                                       <string key="NSTitle">Hide Others</string>
+                                                                       <string key="NSKeyEquiv">h</string>
+                                                                       <int key="NSKeyEquivModMask">1572864</int>
+                                                                       <int key="NSMnemonicLoc">2147483647</int>
+                                                                       <reference key="NSOnImage" ref="35465992"/>
+                                                                       <reference key="NSMixedImage" ref="502551668"/>
+                                                               </object>
+                                                               <object class="NSMenuItem" id="908899353">
+                                                                       <reference key="NSMenu" ref="110575045"/>
+                                                                       <string key="NSTitle">Show All</string>
+                                                                       <string key="NSKeyEquiv"/>
+                                                                       <int key="NSKeyEquivModMask">1048576</int>
+                                                                       <int key="NSMnemonicLoc">2147483647</int>
+                                                                       <reference key="NSOnImage" ref="35465992"/>
+                                                                       <reference key="NSMixedImage" ref="502551668"/>
+                                                               </object>
+                                                               <object class="NSMenuItem" id="1056857174">
+                                                                       <reference key="NSMenu" ref="110575045"/>
+                                                                       <bool key="NSIsDisabled">YES</bool>
+                                                                       <bool key="NSIsSeparator">YES</bool>
+                                                                       <string key="NSTitle"/>
+                                                                       <string key="NSKeyEquiv"/>
+                                                                       <int key="NSKeyEquivModMask">1048576</int>
+                                                                       <int key="NSMnemonicLoc">2147483647</int>
+                                                                       <reference key="NSOnImage" ref="35465992"/>
+                                                                       <reference key="NSMixedImage" ref="502551668"/>
+                                                               </object>
+                                                               <object class="NSMenuItem" id="632727374">
+                                                                       <reference key="NSMenu" ref="110575045"/>
+                                                                       <string key="NSTitle">Quit Enjoyable</string>
+                                                                       <string key="NSKeyEquiv">q</string>
+                                                                       <int key="NSKeyEquivModMask">1048576</int>
+                                                                       <int key="NSMnemonicLoc">2147483647</int>
+                                                                       <reference key="NSOnImage" ref="35465992"/>
+                                                                       <reference key="NSMixedImage" ref="502551668"/>
+                                                               </object>
+                                                       </array>
+                                                       <string key="NSName">_NSAppleMenu</string>
+                                               </object>
+                                       </object>
+                                       <object class="NSMenuItem" id="379814623">
+                                               <reference key="NSMenu" ref="649796088"/>
+                                               <string key="NSTitle">Mappings</string>
+                                               <string key="NSKeyEquiv"/>
+                                               <int key="NSKeyEquivModMask">1048576</int>
+                                               <int key="NSMnemonicLoc">2147483647</int>
+                                               <reference key="NSOnImage" ref="35465992"/>
+                                               <reference key="NSMixedImage" ref="502551668"/>
+                                               <string key="NSAction">submenuAction:</string>
+                                               <object class="NSMenu" key="NSSubmenu" id="720053764">
+                                                       <string key="NSTitle">Mappings</string>
+                                                       <array class="NSMutableArray" key="NSMenuItems">
+                                                               <object class="NSMenuItem" id="632598200">
+                                                                       <reference key="NSMenu" ref="720053764"/>
+                                                                       <string key="NSTitle">Enable</string>
+                                                                       <string key="NSKeyEquiv">r</string>
+                                                                       <int key="NSKeyEquivModMask">1048576</int>
+                                                                       <int key="NSMnemonicLoc">2147483647</int>
+                                                                       <reference key="NSOnImage" ref="35465992"/>
+                                                                       <reference key="NSMixedImage" ref="502551668"/>
+                                                               </object>
+                                                               <object class="NSMenuItem" id="580069611">
+                                                                       <reference key="NSMenu" ref="720053764"/>
+                                                                       <bool key="NSIsDisabled">YES</bool>
+                                                                       <bool key="NSIsSeparator">YES</bool>
+                                                                       <string key="NSTitle"/>
+                                                                       <string key="NSKeyEquiv"/>
+                                                                       <int key="NSMnemonicLoc">2147483647</int>
+                                                                       <reference key="NSOnImage" ref="35465992"/>
+                                                                       <reference key="NSMixedImage" ref="502551668"/>
+                                                               </object>
+                                                               <object class="NSMenuItem" id="914355947">
+                                                                       <reference key="NSMenu" ref="720053764"/>
+                                                                       <string key="NSTitle">List</string>
+                                                                       <string key="NSKeyEquiv">l</string>
+                                                                       <int key="NSKeyEquivModMask">1048576</int>
+                                                                       <int key="NSMnemonicLoc">2147483647</int>
+                                                                       <reference key="NSOnImage" ref="35465992"/>
+                                                                       <reference key="NSMixedImage" ref="502551668"/>
+                                                               </object>
+                                                               <object class="NSMenuItem" id="187155117">
+                                                                       <reference key="NSMenu" ref="720053764"/>
+                                                                       <string key="NSTitle">Import…</string>
+                                                                       <string key="NSKeyEquiv">o</string>
+                                                                       <int key="NSKeyEquivModMask">1048576</int>
+                                                                       <int key="NSMnemonicLoc">2147483647</int>
+                                                                       <reference key="NSOnImage" ref="35465992"/>
+                                                                       <reference key="NSMixedImage" ref="502551668"/>
+                                                               </object>
+                                                               <object class="NSMenuItem" id="888617891">
+                                                                       <reference key="NSMenu" ref="720053764"/>
+                                                                       <string key="NSTitle">Export…</string>
+                                                                       <string key="NSKeyEquiv">s</string>
+                                                                       <int key="NSKeyEquivModMask">1048576</int>
+                                                                       <int key="NSMnemonicLoc">2147483647</int>
+                                                                       <reference key="NSOnImage" ref="35465992"/>
+                                                                       <reference key="NSMixedImage" ref="502551668"/>
+                                                               </object>
+                                                               <object class="NSMenuItem" id="773548144">
+                                                                       <reference key="NSMenu" ref="720053764"/>
+                                                                       <bool key="NSIsDisabled">YES</bool>
+                                                                       <bool key="NSIsSeparator">YES</bool>
+                                                                       <string key="NSTitle"/>
+                                                                       <string key="NSKeyEquiv"/>
+                                                                       <int key="NSMnemonicLoc">2147483647</int>
+                                                                       <reference key="NSOnImage" ref="35465992"/>
+                                                                       <reference key="NSMixedImage" ref="502551668"/>
+                                                                       <int key="NSTag">1</int>
+                                                               </object>
+                                                       </array>
+                                               </object>
+                                       </object>
+                                       <object class="NSMenuItem" id="713487014">
+                                               <reference key="NSMenu" ref="649796088"/>
+                                               <string key="NSTitle">Window</string>
+                                               <string key="NSKeyEquiv"/>
+                                               <int key="NSKeyEquivModMask">1048576</int>
+                                               <int key="NSMnemonicLoc">2147483647</int>
+                                               <reference key="NSOnImage" ref="35465992"/>
+                                               <reference key="NSMixedImage" ref="502551668"/>
+                                               <string key="NSAction">submenuAction:</string>
+                                               <object class="NSMenu" key="NSSubmenu" id="835318025">
+                                                       <string key="NSTitle">Window</string>
+                                                       <array class="NSMutableArray" key="NSMenuItems">
+                                                               <object class="NSMenuItem" id="1011231497">
+                                                                       <reference key="NSMenu" ref="835318025"/>
+                                                                       <string key="NSTitle">Minimize</string>
+                                                                       <string key="NSKeyEquiv">m</string>
+                                                                       <int key="NSKeyEquivModMask">1048576</int>
+                                                                       <int key="NSMnemonicLoc">2147483647</int>
+                                                                       <reference key="NSOnImage" ref="35465992"/>
+                                                                       <reference key="NSMixedImage" ref="502551668"/>
+                                                               </object>
+                                                               <object class="NSMenuItem" id="575023229">
+                                                                       <reference key="NSMenu" ref="835318025"/>
+                                                                       <string key="NSTitle">Zoom</string>
+                                                                       <string key="NSKeyEquiv"/>
+                                                                       <int key="NSKeyEquivModMask">1048576</int>
+                                                                       <int key="NSMnemonicLoc">2147483647</int>
+                                                                       <reference key="NSOnImage" ref="35465992"/>
+                                                                       <reference key="NSMixedImage" ref="502551668"/>
+                                                               </object>
+                                                               <object class="NSMenuItem" id="299356726">
+                                                                       <reference key="NSMenu" ref="835318025"/>
+                                                                       <bool key="NSIsDisabled">YES</bool>
+                                                                       <bool key="NSIsSeparator">YES</bool>
+                                                                       <string key="NSTitle"/>
+                                                                       <string key="NSKeyEquiv"/>
+                                                                       <int key="NSKeyEquivModMask">1048576</int>
+                                                                       <int key="NSMnemonicLoc">2147483647</int>
+                                                                       <reference key="NSOnImage" ref="35465992"/>
+                                                                       <reference key="NSMixedImage" ref="502551668"/>
+                                                               </object>
+                                                               <object class="NSMenuItem" id="625202149">
+                                                                       <reference key="NSMenu" ref="835318025"/>
+                                                                       <string key="NSTitle">Bring All to Front</string>
+                                                                       <string key="NSKeyEquiv"/>
+                                                                       <int key="NSKeyEquivModMask">1048576</int>
+                                                                       <int key="NSMnemonicLoc">2147483647</int>
+                                                                       <reference key="NSOnImage" ref="35465992"/>
+                                                                       <reference key="NSMixedImage" ref="502551668"/>
+                                                               </object>
+                                                       </array>
+                                                       <string key="NSName">_NSWindowsMenu</string>
+                                               </object>
+                                       </object>
+                                       <object class="NSMenuItem" id="693056251">
+                                               <reference key="NSMenu" ref="649796088"/>
+                                               <string key="NSTitle">Help</string>
+                                               <string key="NSKeyEquiv"/>
+                                               <int key="NSMnemonicLoc">2147483647</int>
+                                               <reference key="NSOnImage" ref="35465992"/>
+                                               <reference key="NSMixedImage" ref="502551668"/>
+                                               <string key="NSAction">submenuAction:</string>
+                                               <object class="NSMenu" key="NSSubmenu" id="997802319">
+                                                       <string key="NSTitle">Help</string>
+                                                       <array class="NSMutableArray" key="NSMenuItems">
+                                                               <object class="NSMenuItem" id="842970531">
+                                                                       <reference key="NSMenu" ref="997802319"/>
+                                                                       <string key="NSTitle">Enjoyable Help</string>
+                                                                       <string key="NSKeyEquiv">?</string>
+                                                                       <int key="NSKeyEquivModMask">1048576</int>
+                                                                       <int key="NSMnemonicLoc">2147483647</int>
+                                                                       <reference key="NSOnImage" ref="35465992"/>
+                                                                       <reference key="NSMixedImage" ref="502551668"/>
+                                                               </object>
+                                                       </array>
+                                                       <string key="NSName">_NSHelpMenu</string>
+                                               </object>
+                                       </object>
+                               </array>
+                               <string key="NSName">_NSMainMenu</string>
+                       </object>
+                       <object class="NSWindowTemplate" id="808667431">
+                               <int key="NSWindowStyleMask">15</int>
+                               <int key="NSWindowBacking">2</int>
+                               <string key="NSWindowRect">{{355, 59}, {640, 320}}</string>
+                               <int key="NSWTFlags">1685585920</int>
+                               <string key="NSWindowTitle">Enjoyable</string>
+                               <string key="NSWindowClass">NSWindow</string>
+                               <object class="NSToolbar" key="NSViewClass" id="1043384830">
+                                       <object class="NSMutableString" key="NSToolbarIdentifier">
+                                               <characters key="NS.bytes">AC1F5C48-4C16-4C9D-9779-B783AF35E2E1</characters>
+                                       </object>
+                                       <nil key="NSToolbarDelegate"/>
+                                       <bool key="NSToolbarPrefersToBeShown">YES</bool>
+                                       <bool key="NSToolbarShowsBaselineSeparator">YES</bool>
+                                       <bool key="NSToolbarAllowsUserCustomization">NO</bool>
+                                       <bool key="NSToolbarAutosavesConfiguration">YES</bool>
+                                       <int key="NSToolbarDisplayMode">2</int>
+                                       <int key="NSToolbarSizeMode">1</int>
+                                       <dictionary class="NSMutableDictionary" key="NSToolbarIBIdentifiedItems">
+                                               <object class="NSToolbarItem" key="2CB21E35-9CF1-4C67-9670-31139C914D10" id="985167622">
+                                                       <object class="NSMutableString" key="NSToolbarItemIdentifier">
+                                                               <characters key="NS.bytes">2CB21E35-9CF1-4C67-9670-31139C914D10</characters>
+                                                       </object>
+                                                       <string key="NSToolbarItemLabel">Enabled</string>
+                                                       <string key="NSToolbarItemPaletteLabel">Enabled</string>
+                                                       <nil key="NSToolbarItemToolTip"/>
+                                                       <object class="NSButton" key="NSToolbarItemView" id="385218002">
+                                                               <nil key="NSNextResponder"/>
+                                                               <int key="NSvFlags">268</int>
+                                                               <string key="NSFrame">{{7, 14}, {36, 25}}</string>
+                                                               <string key="NSReuseIdentifierKey">_NS:9</string>
+                                                               <bool key="NSEnabled">YES</bool>
+                                                               <object class="NSButtonCell" key="NSCell" id="422366518">
+                                                                       <int key="NSCellFlags">67108864</int>
+                                                                       <int key="NSCellFlags2">134217728</int>
+                                                                       <string key="NSContents"/>
+                                                                       <object class="NSFont" key="NSSupport" id="45863614">
+                                                                               <string key="NSName">LucidaGrande</string>
+                                                                               <double key="NSSize">13</double>
+                                                                               <int key="NSfFlags">1044</int>
+                                                                       </object>
+                                                                       <string key="NSCellIdentifier">_NS:9</string>
+                                                                       <reference key="NSControlView" ref="385218002"/>
+                                                                       <int key="NSButtonFlags">-1228128256</int>
+                                                                       <int key="NSButtonFlags2">163</int>
+                                                                       <object class="NSCustomResource" key="NSNormalImage" id="80448349">
+                                                                               <string key="NSClassName">NSImage</string>
+                                                                               <string key="NSResourceName">NSRightFacingTriangleTemplate</string>
+                                                                       </object>
+                                                                       <string key="NSAlternateContents"/>
+                                                                       <string key="NSKeyEquivalent"/>
+                                                                       <int key="NSPeriodicDelay">200</int>
+                                                                       <int key="NSPeriodicInterval">25</int>
+                                                               </object>
+                                                               <bool key="NSAllowsLogicalLayoutDirection">NO</bool>
+                                                       </object>
+                                                       <reference key="NSToolbarItemImage" ref="80448349"/>
+                                                       <nil key="NSToolbarItemTarget"/>
+                                                       <nil key="NSToolbarItemAction"/>
+                                                       <string key="NSToolbarItemMinSize">{36, 25}</string>
+                                                       <string key="NSToolbarItemMaxSize">{36, 25}</string>
+                                                       <bool key="NSToolbarItemEnabled">YES</bool>
+                                                       <bool key="NSToolbarItemAutovalidates">YES</bool>
+                                                       <int key="NSToolbarItemTag">0</int>
+                                                       <bool key="NSToolbarIsUserRemovable">YES</bool>
+                                                       <int key="NSToolbarItemVisibilityPriority">0</int>
+                                               </object>
+                                               <object class="NSToolbarItem" key="4AC66688-76E8-47ED-AC0A-7462220A4019" id="496378711">
+                                                       <object class="NSMutableString" key="NSToolbarItemIdentifier">
+                                                               <characters key="NS.bytes">4AC66688-76E8-47ED-AC0A-7462220A4019</characters>
+                                                       </object>
+                                                       <string key="NSToolbarItemLabel">Mapping Selector</string>
+                                                       <string key="NSToolbarItemPaletteLabel">Mapping Selector</string>
+                                                       <nil key="NSToolbarItemToolTip"/>
+                                                       <object class="NSButton" key="NSToolbarItemView" id="227597319">
+                                                               <nil key="NSNextResponder"/>
+                                                               <int key="NSvFlags">268</int>
+                                                               <string key="NSFrame">{{0, 14}, {140, 25}}</string>
+                                                               <string key="NSReuseIdentifierKey">_NS:9</string>
+                                                               <bool key="NSEnabled">YES</bool>
+                                                               <object class="NSButtonCell" key="NSCell" id="850080795">
+                                                                       <int key="NSCellFlags">67108864</int>
+                                                                       <int key="NSCellFlags2">134217728</int>
+                                                                       <string key="NSContents">(default)</string>
+                                                                       <reference key="NSSupport" ref="45863614"/>
+                                                                       <string key="NSCellIdentifier">_NS:9</string>
+                                                                       <reference key="NSControlView" ref="227597319"/>
+                                                                       <int key="NSButtonFlags">918306816</int>
+                                                                       <int key="NSButtonFlags2">163</int>
+                                                                       <object class="NSCustomResource" key="NSNormalImage" id="13197350">
+                                                                               <string key="NSClassName">NSImage</string>
+                                                                               <string key="NSResourceName">NSListViewTemplate</string>
+                                                                       </object>
+                                                                       <string key="NSAlternateContents"/>
+                                                                       <string key="NSKeyEquivalent"/>
+                                                                       <int key="NSPeriodicDelay">400</int>
+                                                                       <int key="NSPeriodicInterval">75</int>
+                                                               </object>
+                                                               <bool key="NSAllowsLogicalLayoutDirection">NO</bool>
+                                                       </object>
+                                                       <reference key="NSToolbarItemImage" ref="13197350"/>
+                                                       <nil key="NSToolbarItemTarget"/>
+                                                       <nil key="NSToolbarItemAction"/>
+                                                       <string key="NSToolbarItemMinSize">{13, 25}</string>
+                                                       <string key="NSToolbarItemMaxSize">{141, 25}</string>
+                                                       <bool key="NSToolbarItemEnabled">YES</bool>
+                                                       <bool key="NSToolbarItemAutovalidates">NO</bool>
+                                                       <int key="NSToolbarItemTag">0</int>
+                                                       <bool key="NSToolbarIsUserRemovable">YES</bool>
+                                                       <int key="NSToolbarItemVisibilityPriority">0</int>
+                                               </object>
+                                               <object class="NSToolbarFlexibleSpaceItem" key="NSToolbarFlexibleSpaceItem" id="658903347">
+                                                       <string key="NSToolbarItemIdentifier">NSToolbarFlexibleSpaceItem</string>
+                                                       <string key="NSToolbarItemLabel"/>
+                                                       <string key="NSToolbarItemPaletteLabel">Flexible Space</string>
+                                                       <nil key="NSToolbarItemToolTip"/>
+                                                       <nil key="NSToolbarItemView"/>
+                                                       <nil key="NSToolbarItemImage"/>
+                                                       <nil key="NSToolbarItemTarget"/>
+                                                       <nil key="NSToolbarItemAction"/>
+                                                       <string key="NSToolbarItemMinSize">{1, 5}</string>
+                                                       <string key="NSToolbarItemMaxSize">{20000, 32}</string>
+                                                       <bool key="NSToolbarItemEnabled">YES</bool>
+                                                       <bool key="NSToolbarItemAutovalidates">YES</bool>
+                                                       <int key="NSToolbarItemTag">-1</int>
+                                                       <bool key="NSToolbarIsUserRemovable">YES</bool>
+                                                       <int key="NSToolbarItemVisibilityPriority">0</int>
+                                                       <object class="NSMenuItem" key="NSToolbarItemMenuFormRepresentation">
+                                                               <bool key="NSIsDisabled">YES</bool>
+                                                               <bool key="NSIsSeparator">YES</bool>
+                                                               <string key="NSTitle"/>
+                                                               <string key="NSKeyEquiv"/>
+                                                               <int key="NSKeyEquivModMask">1048576</int>
+                                                               <int key="NSMnemonicLoc">2147483647</int>
+                                                               <reference key="NSOnImage" ref="35465992"/>
+                                                               <reference key="NSMixedImage" ref="502551668"/>
+                                                       </object>
+                                               </object>
+                                       </dictionary>
+                                       <array key="NSToolbarIBAllowedItems">
+                                               <reference ref="496378711"/>
+                                               <reference ref="658903347"/>
+                                               <reference ref="985167622"/>
+                                       </array>
+                                       <array key="NSToolbarIBDefaultItems">
+                                               <reference ref="496378711"/>
+                                               <reference ref="658903347"/>
+                                               <reference ref="985167622"/>
+                                       </array>
+                                       <array key="NSToolbarIBSelectableItems" id="0"/>
+                               </object>
+                               <nil key="NSUserInterfaceItemIdentifier"/>
+                               <string key="NSWindowContentMinSize">{640, 320}</string>
+                               <object class="NSView" key="NSWindowView" id="177223957">
+                                       <reference key="NSNextResponder"/>
+                                       <int key="NSvFlags">256</int>
+                                       <array class="NSMutableArray" key="NSSubviews">
+                                               <object class="NSSplitView" id="206489479">
+                                                       <reference key="NSNextResponder" ref="177223957"/>
+                                                       <int key="NSvFlags">274</int>
+                                                       <array class="NSMutableArray" key="NSSubviews">
+                                                               <object class="NSCustomView" id="977242492">
+                                                                       <reference key="NSNextResponder" ref="206489479"/>
+                                                                       <int key="NSvFlags">256</int>
+                                                                       <array class="NSMutableArray" key="NSSubviews">
+                                                                               <object class="NSScrollView" id="364857164">
+                                                                                       <reference key="NSNextResponder" ref="977242492"/>
+                                                                                       <int key="NSvFlags">274</int>
+                                                                                       <array class="NSMutableArray" key="NSSubviews">
+                                                                                               <object class="NSClipView" id="698362889">
+                                                                                                       <reference key="NSNextResponder" ref="364857164"/>
+                                                                                                       <int key="NSvFlags">2304</int>
+                                                                                                       <array class="NSMutableArray" key="NSSubviews">
+                                                                                                               <object class="NSOutlineView" id="365506042">
+                                                                                                                       <reference key="NSNextResponder" ref="698362889"/>
+                                                                                                                       <int key="NSvFlags">256</int>
+                                                                                                                       <string key="NSFrameSize">{200, 318}</string>
+                                                                                                                       <reference key="NSSuperview" ref="698362889"/>
+                                                                                                                       <reference key="NSWindow"/>
+                                                                                                                       <reference key="NSNextKeyView" ref="1036252745"/>
+                                                                                                                       <bool key="NSEnabled">YES</bool>
+                                                                                                                       <bool key="NSAllowsLogicalLayoutDirection">NO</bool>
+                                                                                                                       <bool key="NSControlAllowsExpansionToolTips">YES</bool>
+                                                                                                                       <object class="_NSCornerView" key="NSCornerView">
+                                                                                                                               <nil key="NSNextResponder"/>
+                                                                                                                               <int key="NSvFlags">256</int>
+                                                                                                                               <string key="NSFrame">{{474, 0}, {16, 17}}</string>
+                                                                                                                       </object>
+                                                                                                                       <array class="NSMutableArray" key="NSTableColumns">
+                                                                                                                               <object class="NSTableColumn" id="290995057">
+                                                                                                                                       <double key="NSWidth">197</double>
+                                                                                                                                       <double key="NSMinWidth">16</double>
+                                                                                                                                       <double key="NSMaxWidth">1000</double>
+                                                                                                                                       <object class="NSTableHeaderCell" key="NSHeaderCell">
+                                                                                                                                               <int key="NSCellFlags">75497536</int>
+                                                                                                                                               <int key="NSCellFlags2">2048</int>
+                                                                                                                                               <string key="NSContents"/>
+                                                                                                                                               <object class="NSFont" key="NSSupport" id="26">
+                                                                                                                                                       <string key="NSName">LucidaGrande</string>
+                                                                                                                                                       <double key="NSSize">11</double>
+                                                                                                                                                       <int key="NSfFlags">3100</int>
+                                                                                                                                               </object>
+                                                                                                                                               <object class="NSColor" key="NSBackgroundColor">
+                                                                                                                                                       <int key="NSColorSpace">3</int>
+                                                                                                                                                       <bytes key="NSWhite">MC4zMzMzMzI5OQA</bytes>
+                                                                                                                                               </object>
+                                                                                                                                               <object class="NSColor" key="NSTextColor" id="809574366">
+                                                                                                                                                       <int key="NSColorSpace">6</int>
+                                                                                                                                                       <string key="NSCatalogName">System</string>
+                                                                                                                                                       <string key="NSColorName">headerTextColor</string>
+                                                                                                                                                       <object class="NSColor" key="NSColor" id="838935852">
+                                                                                                                                                               <int key="NSColorSpace">3</int>
+                                                                                                                                                               <bytes key="NSWhite">MAA</bytes>
+                                                                                                                                                       </object>
+                                                                                                                                               </object>
+                                                                                                                                       </object>
+                                                                                                                                       <object class="NSTextFieldCell" key="NSDataCell" id="158646067">
+                                                                                                                                               <int key="NSCellFlags">67108928</int>
+                                                                                                                                               <int key="NSCellFlags2">2624</int>
+                                                                                                                                               <string key="NSContents">Text Cell</string>
+                                                                                                                                               <reference key="NSSupport" ref="45863614"/>
+                                                                                                                                               <reference key="NSControlView" ref="365506042"/>
+                                                                                                                                               <object class="NSColor" key="NSBackgroundColor" id="834857663">
+                                                                                                                                                       <int key="NSColorSpace">6</int>
+                                                                                                                                                       <string key="NSCatalogName">System</string>
+                                                                                                                                                       <string key="NSColorName">controlBackgroundColor</string>
+                                                                                                                                                       <object class="NSColor" key="NSColor" id="783809746">
+                                                                                                                                                               <int key="NSColorSpace">3</int>
+                                                                                                                                                               <bytes key="NSWhite">MC42NjY2NjY2NjY3AA</bytes>
+                                                                                                                                                       </object>
+                                                                                                                                               </object>
+                                                                                                                                               <object class="NSColor" key="NSTextColor" id="813255721">
+                                                                                                                                                       <int key="NSColorSpace">6</int>
+                                                                                                                                                       <string key="NSCatalogName">System</string>
+                                                                                                                                                       <string key="NSColorName">controlTextColor</string>
+                                                                                                                                                       <reference key="NSColor" ref="838935852"/>
+                                                                                                                                               </object>
+                                                                                                                                       </object>
+                                                                                                                                       <int key="NSResizingMask">1</int>
+                                                                                                                                       <bool key="NSIsResizeable">YES</bool>
+                                                                                                                                       <reference key="NSTableView" ref="365506042"/>
+                                                                                                                               </object>
+                                                                                                                       </array>
+                                                                                                                       <double key="NSIntercellSpacingWidth">3</double>
+                                                                                                                       <double key="NSIntercellSpacingHeight">2</double>
+                                                                                                                       <object class="NSColor" key="NSBackgroundColor" id="214000480">
+                                                                                                                               <int key="NSColorSpace">3</int>
+                                                                                                                               <bytes key="NSWhite">MQA</bytes>
+                                                                                                                       </object>
+                                                                                                                       <object class="NSColor" key="NSGridColor" id="133906332">
+                                                                                                                               <int key="NSColorSpace">6</int>
+                                                                                                                               <string key="NSCatalogName">System</string>
+                                                                                                                               <string key="NSColorName">gridColor</string>
+                                                                                                                               <object class="NSColor" key="NSColor">
+                                                                                                                                       <int key="NSColorSpace">3</int>
+                                                                                                                                       <bytes key="NSWhite">MC41AA</bytes>
+                                                                                                                               </object>
+                                                                                                                       </object>
+                                                                                                                       <double key="NSRowHeight">20</double>
+                                                                                                                       <int key="NSTvFlags">306184192</int>
+                                                                                                                       <reference key="NSDelegate"/>
+                                                                                                                       <reference key="NSDataSource"/>
+                                                                                                                       <int key="NSColumnAutoresizingStyle">4</int>
+                                                                                                                       <int key="NSDraggingSourceMaskForLocal">15</int>
+                                                                                                                       <int key="NSDraggingSourceMaskForNonLocal">0</int>
+                                                                                                                       <bool key="NSAllowsTypeSelect">YES</bool>
+                                                                                                                       <int key="NSTableViewDraggingDestinationStyle">0</int>
+                                                                                                                       <int key="NSTableViewGroupRowStyle">1</int>
+                                                                                                                       <int key="NSTableViewRowSizeStyle">-1</int>
+                                                                                                                       <bool key="NSOutlineViewAutoresizesOutlineColumnKey">NO</bool>
+                                                                                                               </object>
+                                                                                                       </array>
+                                                                                                       <string key="NSFrame">{{1, 1}, {200, 318}}</string>
+                                                                                                       <reference key="NSSuperview" ref="364857164"/>
+                                                                                                       <reference key="NSWindow"/>
+                                                                                                       <reference key="NSNextKeyView" ref="365506042"/>
+                                                                                                       <reference key="NSDocView" ref="365506042"/>
+                                                                                                       <reference key="NSBGColor" ref="834857663"/>
+                                                                                                       <int key="NScvFlags">4</int>
+                                                                                               </object>
+                                                                                               <object class="NSScroller" id="1036252745">
+                                                                                                       <reference key="NSNextResponder" ref="364857164"/>
+                                                                                                       <int key="NSvFlags">-2147483392</int>
+                                                                                                       <string key="NSFrame">{{1, 1}, {8, 298}}</string>
+                                                                                                       <reference key="NSSuperview" ref="364857164"/>
+                                                                                                       <reference key="NSWindow"/>
+                                                                                                       <reference key="NSNextKeyView" ref="606740242"/>
+                                                                                                       <bool key="NSAllowsLogicalLayoutDirection">NO</bool>
+                                                                                                       <reference key="NSTarget" ref="364857164"/>
+                                                                                                       <string key="NSAction">_doScroller:</string>
+                                                                                                       <double key="NSPercent">0.4210526</double>
+                                                                                               </object>
+                                                                                               <object class="NSScroller" id="892486973">
+                                                                                                       <reference key="NSNextResponder" ref="364857164"/>
+                                                                                                       <int key="NSvFlags">-2147483392</int>
+                                                                                                       <string key="NSFrame">{{-100, -100}, {473, 15}}</string>
+                                                                                                       <reference key="NSSuperview" ref="364857164"/>
+                                                                                                       <reference key="NSWindow"/>
+                                                                                                       <reference key="NSNextKeyView" ref="698362889"/>
+                                                                                                       <bool key="NSAllowsLogicalLayoutDirection">NO</bool>
+                                                                                                       <int key="NSsFlags">1</int>
+                                                                                                       <reference key="NSTarget" ref="364857164"/>
+                                                                                                       <string key="NSAction">_doScroller:</string>
+                                                                                                       <double key="NSPercent">0.99789030000000001</double>
+                                                                                               </object>
+                                                                                       </array>
+                                                                                       <string key="NSFrameSize">{202, 320}</string>
+                                                                                       <reference key="NSSuperview" ref="977242492"/>
+                                                                                       <reference key="NSWindow"/>
+                                                                                       <reference key="NSNextKeyView" ref="892486973"/>
+                                                                                       <int key="NSsFlags">150034</int>
+                                                                                       <reference key="NSVScroller" ref="1036252745"/>
+                                                                                       <reference key="NSHScroller" ref="892486973"/>
+                                                                                       <reference key="NSContentView" ref="698362889"/>
+                                                                                       <bytes key="NSScrollAmts">QSAAAEEgAABBsAAAQbAAAA</bytes>
+                                                                                       <double key="NSMinMagnification">0.25</double>
+                                                                                       <double key="NSMaxMagnification">4</double>
+                                                                                       <double key="NSMagnification">1</double>
+                                                                               </object>
+                                                                       </array>
+                                                                       <string key="NSFrameSize">{202, 320}</string>
+                                                                       <reference key="NSSuperview" ref="206489479"/>
+                                                                       <reference key="NSWindow"/>
+                                                                       <reference key="NSNextKeyView" ref="364857164"/>
+                                                                       <string key="NSClassName">NSView</string>
+                                                               </object>
+                                                               <object class="NSCustomView" id="606740242">
+                                                                       <reference key="NSNextResponder" ref="206489479"/>
+                                                                       <int key="NSvFlags">256</int>
+                                                                       <array class="NSMutableArray" key="NSSubviews">
+                                                                               <object class="NSSlider" id="792189805">
+                                                                                       <reference key="NSNextResponder" ref="606740242"/>
+                                                                                       <int key="NSvFlags">265</int>
+                                                                                       <string key="NSFrame">{{228, 21}, {130, 12}}</string>
+                                                                                       <reference key="NSSuperview" ref="606740242"/>
+                                                                                       <reference key="NSWindow"/>
+                                                                                       <reference key="NSNextKeyView"/>
+                                                                                       <string key="NSReuseIdentifierKey">_NS:9</string>
+                                                                                       <bool key="NSEnabled">YES</bool>
+                                                                                       <object class="NSSliderCell" key="NSCell" id="423057230">
+                                                                                               <int key="NSCellFlags">-2080374784</int>
+                                                                                               <int key="NSCellFlags2">262144</int>
+                                                                                               <string key="NSContents"/>
+                                                                                               <string key="NSCellIdentifier">_NS:9</string>
+                                                                                               <reference key="NSControlView" ref="792189805"/>
+                                                                                               <double key="NSMaxValue">30</double>
+                                                                                               <double key="NSMinValue">0.0</double>
+                                                                                               <double key="NSValue">15</double>
+                                                                                               <double key="NSAltIncValue">0.0</double>
+                                                                                               <int key="NSNumberOfTickMarks">0</int>
+                                                                                               <int key="NSTickMarkPosition">1</int>
+                                                                                               <bool key="NSAllowsTickMarkValuesOnly">NO</bool>
+                                                                                               <bool key="NSVertical">NO</bool>
+                                                                                       </object>
+                                                                                       <bool key="NSAllowsLogicalLayoutDirection">NO</bool>
+                                                                               </object>
+                                                                               <object class="NSSlider" id="385416822">
+                                                                                       <reference key="NSNextResponder" ref="606740242"/>
+                                                                                       <int key="NSvFlags">265</int>
+                                                                                       <string key="NSFrame">{{228, 107}, {176, 12}}</string>
+                                                                                       <reference key="NSSuperview" ref="606740242"/>
+                                                                                       <reference key="NSWindow"/>
+                                                                                       <reference key="NSNextKeyView" ref="125828224"/>
+                                                                                       <string key="NSReuseIdentifierKey">_NS:9</string>
+                                                                                       <bool key="NSEnabled">YES</bool>
+                                                                                       <object class="NSSliderCell" key="NSCell" id="5417367">
+                                                                                               <int key="NSCellFlags">-2080374784</int>
+                                                                                               <int key="NSCellFlags2">262144</int>
+                                                                                               <string key="NSContents"/>
+                                                                                               <string key="NSCellIdentifier">_NS:9</string>
+                                                                                               <reference key="NSControlView" ref="385416822"/>
+                                                                                               <double key="NSMaxValue">20</double>
+                                                                                               <double key="NSMinValue">0.0</double>
+                                                                                               <double key="NSValue">4</double>
+                                                                                               <double key="NSAltIncValue">0.0</double>
+                                                                                               <int key="NSNumberOfTickMarks">0</int>
+                                                                                               <int key="NSTickMarkPosition">1</int>
+                                                                                               <bool key="NSAllowsTickMarkValuesOnly">NO</bool>
+                                                                                               <bool key="NSVertical">NO</bool>
+                                                                                       </object>
+                                                                                       <bool key="NSAllowsLogicalLayoutDirection">NO</bool>
+                                                                               </object>
+                                                                               <object class="NSSegmentedControl" id="875916470">
+                                                                                       <reference key="NSNextResponder" ref="606740242"/>
+                                                                                       <int key="NSvFlags">265</int>
+                                                                                       <string key="NSFrame">{{226, 117}, {180, 20}}</string>
+                                                                                       <reference key="NSSuperview" ref="606740242"/>
+                                                                                       <reference key="NSWindow"/>
+                                                                                       <reference key="NSNextKeyView" ref="385416822"/>
+                                                                                       <string key="NSReuseIdentifierKey">_NS:9</string>
+                                                                                       <bool key="NSEnabled">YES</bool>
+                                                                                       <object class="NSSegmentedCell" key="NSCell" id="241270212">
+                                                                                               <int key="NSCellFlags">67108864</int>
+                                                                                               <int key="NSCellFlags2">131072</int>
+                                                                                               <reference key="NSSupport" ref="26"/>
+                                                                                               <string key="NSCellIdentifier">_NS:9</string>
+                                                                                               <reference key="NSControlView" ref="875916470"/>
+                                                                                               <array class="NSMutableArray" key="NSSegmentImages">
+                                                                                                       <object class="NSSegmentItem">
+                                                                                                               <double key="NSSegmentItemWidth">44</double>
+                                                                                                               <string key="NSSegmentItemLabel">←</string>
+                                                                                                               <bool key="NSSegmentItemSelected">YES</bool>
+                                                                                                               <int key="NSSegmentItemImageScaling">0</int>
+                                                                                                       </object>
+                                                                                                       <object class="NSSegmentItem">
+                                                                                                               <double key="NSSegmentItemWidth">44</double>
+                                                                                                               <string key="NSSegmentItemLabel">→</string>
+                                                                                                               <int key="NSSegmentItemTag">1</int>
+                                                                                                               <int key="NSSegmentItemImageScaling">0</int>
+                                                                                                       </object>
+                                                                                                       <object class="NSSegmentItem">
+                                                                                                               <double key="NSSegmentItemWidth">42</double>
+                                                                                                               <string key="NSSegmentItemLabel">↑</string>
+                                                                                                               <int key="NSSegmentItemImageScaling">0</int>
+                                                                                                       </object>
+                                                                                                       <object class="NSSegmentItem">
+                                                                                                               <double key="NSSegmentItemWidth">41</double>
+                                                                                                               <string key="NSSegmentItemLabel">↓</string>
+                                                                                                               <int key="NSSegmentItemImageScaling">0</int>
+                                                                                                       </object>
+                                                                                               </array>
+                                                                                               <int key="NSSegmentStyle">1</int>
+                                                                                       </object>
+                                                                                       <bool key="NSAllowsLogicalLayoutDirection">NO</bool>
+                                                                               </object>
+                                                                               <object class="NSSegmentedControl" id="921829691">
+                                                                                       <reference key="NSNextResponder" ref="606740242"/>
+                                                                                       <int key="NSvFlags">265</int>
+                                                                                       <string key="NSFrame">{{226, 31}, {180, 20}}</string>
+                                                                                       <reference key="NSSuperview" ref="606740242"/>
+                                                                                       <reference key="NSWindow"/>
+                                                                                       <reference key="NSNextKeyView" ref="792189805"/>
+                                                                                       <string key="NSReuseIdentifierKey">_NS:9</string>
+                                                                                       <bool key="NSEnabled">YES</bool>
+                                                                                       <object class="NSSegmentedCell" key="NSCell" id="301345285">
+                                                                                               <int key="NSCellFlags">67108864</int>
+                                                                                               <int key="NSCellFlags2">131072</int>
+                                                                                               <reference key="NSSupport" ref="26"/>
+                                                                                               <string key="NSCellIdentifier">_NS:9</string>
+                                                                                               <reference key="NSControlView" ref="921829691"/>
+                                                                                               <array class="NSMutableArray" key="NSSegmentImages">
+                                                                                                       <object class="NSSegmentItem">
+                                                                                                               <double key="NSSegmentItemWidth">64</double>
+                                                                                                               <string key="NSSegmentItemLabel">↑</string>
+                                                                                                               <string key="NSSegmentItemTooltip">Scroll up continuously</string>
+                                                                                                               <bool key="NSSegmentItemSelected">YES</bool>
+                                                                                                               <int key="NSSegmentItemImageScaling">0</int>
+                                                                                                       </object>
+                                                                                                       <object class="NSSegmentItem">
+                                                                                                               <double key="NSSegmentItemWidth">63</double>
+                                                                                                               <string key="NSSegmentItemLabel">↓</string>
+                                                                                                               <string key="NSSegmentItemTooltip">Scroll down continuously</string>
+                                                                                                               <int key="NSSegmentItemTag">1</int>
+                                                                                                               <int key="NSSegmentItemImageScaling">0</int>
+                                                                                                       </object>
+                                                                                                       <object class="NSSegmentItem">
+                                                                                                               <string key="NSSegmentItemLabel">⤒</string>
+                                                                                                               <string key="NSSegmentItemTooltip">Scroll up one step</string>
+                                                                                                               <int key="NSSegmentItemImageScaling">0</int>
+                                                                                                       </object>
+                                                                                                       <object class="NSSegmentItem">
+                                                                                                               <string key="NSSegmentItemLabel">⤓</string>
+                                                                                                               <string key="NSSegmentItemTooltip">Scroll down one step</string>
+                                                                                                               <int key="NSSegmentItemImageScaling">0</int>
+                                                                                                       </object>
+                                                                                               </array>
+                                                                                               <int key="NSSegmentStyle">1</int>
+                                                                                       </object>
+                                                                                       <bool key="NSAllowsLogicalLayoutDirection">NO</bool>
+                                                                               </object>
+                                                                               <object class="NSSegmentedControl" id="125828224">
+                                                                                       <reference key="NSNextResponder" ref="606740242"/>
+                                                                                       <int key="NSvFlags">265</int>
+                                                                                       <string key="NSFrame">{{226, 67}, {180, 24}}</string>
+                                                                                       <reference key="NSSuperview" ref="606740242"/>
+                                                                                       <reference key="NSWindow"/>
+                                                                                       <reference key="NSNextKeyView" ref="921829691"/>
+                                                                                       <string key="NSReuseIdentifierKey">_NS:9</string>
+                                                                                       <bool key="NSEnabled">YES</bool>
+                                                                                       <object class="NSSegmentedCell" key="NSCell" id="514491330">
+                                                                                               <int key="NSCellFlags">67108864</int>
+                                                                                               <int key="NSCellFlags2">0</int>
+                                                                                               <object class="NSFont" key="NSSupport">
+                                                                                                       <string key="NSName">LucidaGrande</string>
+                                                                                                       <double key="NSSize">13</double>
+                                                                                                       <int key="NSfFlags">16</int>
+                                                                                               </object>
+                                                                                               <string key="NSCellIdentifier">_NS:9</string>
+                                                                                               <reference key="NSControlView" ref="125828224"/>
+                                                                                               <array class="NSMutableArray" key="NSSegmentImages">
+                                                                                                       <object class="NSSegmentItem">
+                                                                                                               <double key="NSSegmentItemWidth">87</double>
+                                                                                                               <string key="NSSegmentItemLabel">Left</string>
+                                                                                                               <bool key="NSSegmentItemSelected">YES</bool>
+                                                                                                               <int key="NSSegmentItemImageScaling">0</int>
+                                                                                                       </object>
+                                                                                                       <object class="NSSegmentItem">
+                                                                                                               <double key="NSSegmentItemWidth">86</double>
+                                                                                                               <string key="NSSegmentItemLabel">Right</string>
+                                                                                                               <int key="NSSegmentItemTag">1</int>
+                                                                                                               <int key="NSSegmentItemImageScaling">0</int>
+                                                                                                       </object>
+                                                                                               </array>
+                                                                                               <int key="NSSegmentStyle">1</int>
+                                                                                       </object>
+                                                                                       <bool key="NSAllowsLogicalLayoutDirection">NO</bool>
+                                                                               </object>
+                                                                               <object class="NSCustomView" id="57697638">
+                                                                                       <reference key="NSNextResponder" ref="606740242"/>
+                                                                                       <int key="NSvFlags">265</int>
+                                                                                       <string key="NSFrame">{{228, 197}, {176, 24}}</string>
+                                                                                       <reference key="NSSuperview" ref="606740242"/>
+                                                                                       <reference key="NSWindow"/>
+                                                                                       <reference key="NSNextKeyView" ref="194275224"/>
+                                                                                       <string key="NSReuseIdentifierKey">_NS:9</string>
+                                                                                       <string key="NSClassName">NJKeyInputField</string>
+                                                                               </object>
+                                                                               <object class="NSPopUpButton" id="194275224">
+                                                                                       <reference key="NSNextResponder" ref="606740242"/>
+                                                                                       <int key="NSvFlags">265</int>
+                                                                                       <string key="NSFrame">{{225, 152}, {182, 26}}</string>
+                                                                                       <reference key="NSSuperview" ref="606740242"/>
+                                                                                       <reference key="NSWindow"/>
+                                                                                       <reference key="NSNextKeyView" ref="875916470"/>
+                                                                                       <bool key="NSEnabled">YES</bool>
+                                                                                       <object class="NSPopUpButtonCell" key="NSCell" id="74311158">
+                                                                                               <int key="NSCellFlags">-1539309504</int>
+                                                                                               <int key="NSCellFlags2">2048</int>
+                                                                                               <reference key="NSSupport" ref="45863614"/>
+                                                                                               <reference key="NSControlView" ref="194275224"/>
+                                                                                               <int key="NSButtonFlags">109199360</int>
+                                                                                               <int key="NSButtonFlags2">129</int>
+                                                                                               <string key="NSAlternateContents"/>
+                                                                                               <string key="NSKeyEquivalent"/>
+                                                                                               <int key="NSPeriodicDelay">400</int>
+                                                                                               <int key="NSPeriodicInterval">75</int>
+                                                                                               <nil key="NSMenuItem"/>
+                                                                                               <bool key="NSMenuItemRespectAlignment">YES</bool>
+                                                                                               <object class="NSMenu" key="NSMenu" id="19633006">
+                                                                                                       <string key="NSTitle">OtherViews</string>
+                                                                                                       <array class="NSMutableArray" key="NSMenuItems"/>
+                                                                                               </object>
+                                                                                               <int key="NSSelectedIndex">-1</int>
+                                                                                               <int key="NSPreferredEdge">1</int>
+                                                                                               <bool key="NSUsesItemFromMenu">YES</bool>
+                                                                                               <bool key="NSAltersState">YES</bool>
+                                                                                               <int key="NSArrowPosition">2</int>
+                                                                                       </object>
+                                                                                       <bool key="NSAllowsLogicalLayoutDirection">NO</bool>
+                                                                               </object>
+                                                                               <object class="NSMatrix" id="120408205">
+                                                                                       <reference key="NSNextResponder" ref="606740242"/>
+                                                                                       <int key="NSvFlags">268</int>
+                                                                                       <string key="NSFrame">{{20, 16}, {200, 256}}</string>
+                                                                                       <reference key="NSSuperview" ref="606740242"/>
+                                                                                       <reference key="NSWindow"/>
+                                                                                       <reference key="NSNextKeyView" ref="57697638"/>
+                                                                                       <bool key="NSAllowsLogicalLayoutDirection">NO</bool>
+                                                                                       <int key="NSNumRows">6</int>
+                                                                                       <int key="NSNumCols">1</int>
+                                                                                       <array class="NSMutableArray" key="NSCells">
+                                                                                               <object class="NSButtonCell" id="177186415">
+                                                                                                       <int key="NSCellFlags">603979776</int>
+                                                                                                       <int key="NSCellFlags2">0</int>
+                                                                                                       <string key="NSContents">Do nothing</string>
+                                                                                                       <reference key="NSSupport" ref="45863614"/>
+                                                                                                       <reference key="NSControlView" ref="120408205"/>
+                                                                                                       <int key="NSTag">1</int>
+                                                                                                       <int key="NSButtonFlags">1211912448</int>
+                                                                                                       <int key="NSButtonFlags2">0</int>
+                                                                                                       <object class="NSCustomResource" key="NSNormalImage" id="421587711">
+                                                                                                               <string key="NSClassName">NSImage</string>
+                                                                                                               <string key="NSResourceName">NSRadioButton</string>
+                                                                                                       </object>
+                                                                                                       <object class="NSButtonImageSource" key="NSAlternateImage" id="68833793">
+                                                                                                               <string key="NSImageName">NSRadioButton</string>
+                                                                                                       </object>
+                                                                                                       <string key="NSAlternateContents"/>
+                                                                                                       <string key="NSKeyEquivalent"/>
+                                                                                                       <int key="NSPeriodicDelay">200</int>
+                                                                                                       <int key="NSPeriodicInterval">25</int>
+                                                                                               </object>
+                                                                                               <object class="NSButtonCell" id="387494389">
+                                                                                                       <int key="NSCellFlags">603979776</int>
+                                                                                                       <int key="NSCellFlags2">0</int>
+                                                                                                       <string key="NSContents">Press a key</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>
+                                                                                               <object class="NSButtonCell" id="339215895">
+                                                                                                       <int key="NSCellFlags">603979776</int>
+                                                                                                       <int key="NSCellFlags2">0</int>
+                                                                                                       <string key="NSContents">Switch to mapping</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>
+                                                                                               <object class="NSButtonCell" id="820968178">
+                                                                                                       <int key="NSCellFlags">603979776</int>
+                                                                                                       <int key="NSCellFlags2">0</int>
+                                                                                                       <string key="NSContents">Move the mouse</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>
+                                                                                               <object class="NSButtonCell" id="275466816">
+                                                                                                       <int key="NSCellFlags">603979776</int>
+                                                                                                       <int key="NSCellFlags2">0</int>
+                                                                                                       <string key="NSContents">Press a mouse button</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>
+                                                                                               <object class="NSButtonCell" id="134694197">
+                                                                                                       <int key="NSCellFlags">603979776</int>
+                                                                                                       <int key="NSCellFlags2">0</int>
+                                                                                                       <string key="NSContents">Scroll the mouse</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, 41}</string>
+                                                                                       <string key="NSIntercellSpacing">{4, 2}</string>
+                                                                                       <int key="NSMatrixFlags">1353195520</int>
+                                                                                       <string key="NSCellClass">NSActionCell</string>
+                                                                                       <object class="NSButtonCell" key="NSProtoCell" id="632642090">
+                                                                                               <int key="NSCellFlags">603979776</int>
+                                                                                               <int key="NSCellFlags2">0</int>
+                                                                                               <string key="NSContents">Radio</string>
+                                                                                               <reference key="NSSupport" ref="45863614"/>
+                                                                                               <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>
+                                                                                       <int key="NSSelectedRow">-1</int>
+                                                                                       <int key="NSSelectedCol">-1</int>
+                                                                                       <object class="NSColor" key="NSBackgroundColor" id="473846075">
+                                                                                               <int key="NSColorSpace">6</int>
+                                                                                               <string key="NSCatalogName">System</string>
+                                                                                               <string key="NSColorName">controlColor</string>
+                                                                                               <reference key="NSColor" ref="783809746"/>
+                                                                                       </object>
+                                                                                       <reference key="NSCellBackgroundColor" ref="214000480"/>
+                                                                                       <reference key="NSFont" ref="45863614"/>
+                                                                               </object>
+                                                                               <object class="NSTextField" id="1016088174">
+                                                                                       <reference key="NSNextResponder" ref="606740242"/>
+                                                                                       <int key="NSvFlags">266</int>
+                                                                                       <string key="NSFrame">{{0, 289}, {429, 17}}</string>
+                                                                                       <reference key="NSSuperview" ref="606740242"/>
+                                                                                       <reference key="NSWindow"/>
+                                                                                       <reference key="NSNextKeyView" ref="497528019"/>
+                                                                                       <bool key="NSEnabled">YES</bool>
+                                                                                       <object class="NSTextFieldCell" key="NSCell" id="853503577">
+                                                                                               <int key="NSCellFlags">67108928</int>
+                                                                                               <int key="NSCellFlags2">138414656</int>
+                                                                                               <string key="NSContents"/>
+                                                                                               <object class="NSFont" key="NSSupport">
+                                                                                                       <string key="NSName">LucidaGrande-Bold</string>
+                                                                                                       <double key="NSSize">13</double>
+                                                                                                       <int key="NSfFlags">16</int>
+                                                                                               </object>
+                                                                                               <string key="NSPlaceholderString">No input selected</string>
+                                                                                               <reference key="NSControlView" ref="1016088174"/>
+                                                                                               <reference key="NSBackgroundColor" ref="473846075"/>
+                                                                                               <reference key="NSTextColor" ref="813255721"/>
+                                                                                       </object>
+                                                                                       <bool key="NSAllowsLogicalLayoutDirection">NO</bool>
+                                                                               </object>
+                                                                               <object class="NSBox" id="497528019">
+                                                                                       <reference key="NSNextResponder" ref="606740242"/>
+                                                                                       <int key="NSvFlags">10</int>
+                                                                                       <string key="NSFrame">{{12, 278}, {405, 5}}</string>
+                                                                                       <reference key="NSSuperview" ref="606740242"/>
+                                                                                       <reference key="NSWindow"/>
+                                                                                       <reference key="NSNextKeyView" ref="120408205"/>
+                                                                                       <string key="NSOffsets">{0, 0}</string>
+                                                                                       <object class="NSTextFieldCell" key="NSTitleCell">
+                                                                                               <int key="NSCellFlags">67108864</int>
+                                                                                               <int key="NSCellFlags2">0</int>
+                                                                                               <string key="NSContents">Box</string>
+                                                                                               <reference key="NSSupport" ref="45863614"/>
+                                                                                               <object class="NSColor" key="NSBackgroundColor">
+                                                                                                       <int key="NSColorSpace">6</int>
+                                                                                                       <string key="NSCatalogName">System</string>
+                                                                                                       <string key="NSColorName">textBackgroundColor</string>
+                                                                                                       <reference key="NSColor" ref="214000480"/>
+                                                                                               </object>
+                                                                                               <object class="NSColor" key="NSTextColor">
+                                                                                                       <int key="NSColorSpace">3</int>
+                                                                                                       <bytes key="NSWhite">MCAwLjgwMDAwMDAxAA</bytes>
+                                                                                               </object>
+                                                                                       </object>
+                                                                                       <int key="NSBorderType">3</int>
+                                                                                       <int key="NSBoxType">2</int>
+                                                                                       <int key="NSTitlePosition">0</int>
+                                                                                       <bool key="NSTransparent">NO</bool>
+                                                                               </object>
+                                                                       </array>
+                                                                       <string key="NSFrame">{{211, 0}, {429, 320}}</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, 320}</string>
+                                                       <reference key="NSSuperview" ref="177223957"/>
+                                                       <reference key="NSWindow"/>
+                                                       <reference key="NSNextKeyView" ref="977242492"/>
+                                                       <bool key="NSIsVertical">YES</bool>
+                                                       <string key="NSAutosaveName">Main Split</string>
+                                                       <object class="NSMutableDictionary" key="NSHoldingPriorities">
+                                                               <bool key="EncodedWithXMLCoder">YES</bool>
+                                                               <array key="dict.sortedKeys">
+                                                                       <integer value="0"/>
+                                                                       <integer value="1"/>
+                                                               </array>
+                                                               <array key="dict.values">
+                                                                       <real value="250"/>
+                                                                       <real value="250"/>
+                                                               </array>
+                                                       </object>
+                                               </object>
+                                       </array>
+                                       <string key="NSFrameSize">{640, 320}</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, 375}</string>
+                               <string key="NSMaxSize">{10000000000000, 10000000000000}</string>
+                               <string key="NSFrameAutosaveName">Enjoyable</string>
+                               <bool key="NSWindowIsRestorable">YES</bool>
+                       </object>
+                       <object class="NSCustomView" id="671181514">
+                               <reference key="NSNextResponder"/>
+                               <int key="NSvFlags">256</int>
+                               <array class="NSMutableArray" key="NSSubviews">
+                                       <object class="NSScrollView" id="443618264">
+                                               <reference key="NSNextResponder" ref="671181514"/>
+                                               <int key="NSvFlags">274</int>
+                                               <array class="NSMutableArray" key="NSSubviews">
+                                                       <object class="NSClipView" id="947403733">
+                                                               <reference key="NSNextResponder" ref="443618264"/>
+                                                               <int key="NSvFlags">2304</int>
+                                                               <array class="NSMutableArray" key="NSSubviews">
+                                                                       <object class="NSTableView" id="762432499">
+                                                                               <reference key="NSNextResponder" ref="947403733"/>
+                                                                               <int key="NSvFlags">256</int>
+                                                                               <string key="NSFrameSize">{198, 198}</string>
+                                                                               <reference key="NSSuperview" ref="947403733"/>
+                                                                               <reference key="NSWindow"/>
+                                                                               <reference key="NSNextKeyView" ref="968378655"/>
+                                                                               <bool key="NSEnabled">YES</bool>
+                                                                               <bool key="NSAllowsLogicalLayoutDirection">NO</bool>
+                                                                               <bool key="NSControlAllowsExpansionToolTips">YES</bool>
+                                                                               <object class="_NSCornerView" key="NSCornerView">
+                                                                                       <nil key="NSNextResponder"/>
+                                                                                       <int key="NSvFlags">256</int>
+                                                                                       <string key="NSFrame">{{306, 0}, {16, 17}}</string>
+                                                                               </object>
+                                                                               <array class="NSMutableArray" key="NSTableColumns">
+                                                                                       <object class="NSTableColumn" id="827961598">
+                                                                                               <double key="NSWidth">190</double>
+                                                                                               <double key="NSMinWidth">190</double>
+                                                                                               <double key="NSMaxWidth">190</double>
+                                                                                               <object class="NSTableHeaderCell" key="NSHeaderCell">
+                                                                                                       <int key="NSCellFlags">75497536</int>
+                                                                                                       <int key="NSCellFlags2">2048</int>
+                                                                                                       <string key="NSContents"/>
+                                                                                                       <reference key="NSSupport" ref="26"/>
+                                                                                                       <object class="NSColor" key="NSBackgroundColor">
+                                                                                                               <int key="NSColorSpace">3</int>
+                                                                                                               <bytes key="NSWhite">MC4zMzMzMzI5OQA</bytes>
+                                                                                                       </object>
+                                                                                                       <reference key="NSTextColor" ref="809574366"/>
+                                                                                               </object>
+                                                                                               <object class="NSTextFieldCell" key="NSDataCell" id="638155037">
+                                                                                                       <int key="NSCellFlags">337641536</int>
+                                                                                                       <int key="NSCellFlags2">2048</int>
+                                                                                                       <string key="NSContents">Text Cell</string>
+                                                                                                       <reference key="NSSupport" ref="45863614"/>
+                                                                                                       <reference key="NSControlView" ref="762432499"/>
+                                                                                                       <reference key="NSBackgroundColor" ref="834857663"/>
+                                                                                                       <reference key="NSTextColor" ref="813255721"/>
+                                                                                               </object>
+                                                                                               <bool key="NSIsEditable">YES</bool>
+                                                                                               <reference key="NSTableView" ref="762432499"/>
+                                                                                       </object>
+                                                                               </array>
+                                                                               <double key="NSIntercellSpacingWidth">3</double>
+                                                                               <double key="NSIntercellSpacingHeight">2</double>
+                                                                               <reference key="NSBackgroundColor" ref="834857663"/>
+                                                                               <reference key="NSGridColor" ref="133906332"/>
+                                                                               <double key="NSRowHeight">20</double>
+                                                                               <int key="NSTvFlags">44072960</int>
+                                                                               <reference key="NSDelegate"/>
+                                                                               <reference key="NSDataSource"/>
+                                                                               <int key="NSColumnAutoresizingStyle">1</int>
+                                                                               <int key="NSDraggingSourceMaskForLocal">15</int>
+                                                                               <int key="NSDraggingSourceMaskForNonLocal">0</int>
+                                                                               <bool key="NSAllowsTypeSelect">NO</bool>
+                                                                               <int key="NSTableViewDraggingDestinationStyle">0</int>
+                                                                               <int key="NSTableViewGroupRowStyle">1</int>
+                                                                               <int key="NSTableViewRowSizeStyle">-1</int>
+                                                                       </object>
+                                                               </array>
+                                                               <string key="NSFrame">{{1, 1}, {198, 198}}</string>
+                                                               <reference key="NSSuperview" ref="443618264"/>
+                                                               <reference key="NSWindow"/>
+                                                               <reference key="NSNextKeyView" ref="762432499"/>
+                                                               <reference key="NSDocView" ref="762432499"/>
+                                                               <reference key="NSBGColor" ref="834857663"/>
+                                                               <int key="NScvFlags">4</int>
+                                                       </object>
+                                                       <object class="NSScroller" id="968378655">
+                                                               <reference key="NSNextResponder" ref="443618264"/>
+                                                               <int key="NSvFlags">-2147483392</int>
+                                                               <string key="NSFrame">{{306, 1}, {15, 403}}</string>
+                                                               <reference key="NSSuperview" ref="443618264"/>
+                                                               <reference key="NSWindow"/>
+                                                               <reference key="NSNextKeyView" ref="861276216"/>
+                                                               <bool key="NSAllowsLogicalLayoutDirection">NO</bool>
+                                                               <reference key="NSTarget" ref="443618264"/>
+                                                               <string key="NSAction">_doScroller:</string>
+                                                               <double key="NSPercent">0.99766359999999998</double>
+                                                       </object>
+                                                       <object class="NSScroller" id="553414014">
+                                                               <reference key="NSNextResponder" ref="443618264"/>
+                                                               <int key="NSvFlags">-2147483392</int>
+                                                               <string key="NSFrame">{{-100, -100}, {366, 16}}</string>
+                                                               <reference key="NSSuperview" ref="443618264"/>
+                                                               <reference key="NSWindow"/>
+                                                               <reference key="NSNextKeyView" ref="947403733"/>
+                                                               <bool key="NSAllowsLogicalLayoutDirection">NO</bool>
+                                                               <int key="NSsFlags">1</int>
+                                                               <reference key="NSTarget" ref="443618264"/>
+                                                               <string key="NSAction">_doScroller:</string>
+                                                               <double key="NSPercent">0.98123324396782841</double>
+                                                       </object>
+                                               </array>
+                                               <string key="NSFrame">{{0, 20}, {200, 200}}</string>
+                                               <reference key="NSSuperview" ref="671181514"/>
+                                               <reference key="NSWindow"/>
+                                               <reference key="NSNextKeyView" ref="553414014"/>
+                                               <int key="NSsFlags">150034</int>
+                                               <reference key="NSVScroller" ref="968378655"/>
+                                               <reference key="NSHScroller" ref="553414014"/>
+                                               <reference key="NSContentView" ref="947403733"/>
+                                               <bytes key="NSScrollAmts">QSAAAEEgAABBsAAAQbAAAA</bytes>
+                                               <double key="NSMinMagnification">0.25</double>
+                                               <double key="NSMaxMagnification">4</double>
+                                               <double key="NSMagnification">1</double>
+                                       </object>
+                                       <object class="NSButton" id="149148392">
+                                               <reference key="NSNextResponder" ref="671181514"/>
+                                               <int key="NSvFlags">268</int>
+                                               <string key="NSFrame">{{66, -1}, {68, 23}}</string>
+                                               <reference key="NSSuperview" ref="671181514"/>
+                                               <reference key="NSWindow"/>
+                                               <reference key="NSNextKeyView" ref="1023366520"/>
+                                               <string key="NSReuseIdentifierKey">_NS:22</string>
+                                               <bool key="NSEnabled">YES</bool>
+                                               <object class="NSButtonCell" key="NSCell" id="517346822">
+                                                       <int key="NSCellFlags">-2080374784</int>
+                                                       <int key="NSCellFlags2">168034304</int>
+                                                       <string key="NSContents"/>
+                                                       <object class="NSFont" key="NSSupport" id="22">
+                                                               <string key="NSName">LucidaGrande</string>
+                                                               <double key="NSSize">9</double>
+                                                               <int key="NSfFlags">3614</int>
+                                                       </object>
+                                                       <string key="NSCellIdentifier">_NS:22</string>
+                                                       <reference key="NSControlView" ref="149148392"/>
+                                                       <int key="NSButtonFlags">1221349376</int>
+                                                       <int key="NSButtonFlags2">162</int>
+                                                       <string key="NSAlternateContents"/>
+                                                       <string key="NSKeyEquivalent"/>
+                                                       <int key="NSPeriodicDelay">400</int>
+                                                       <int key="NSPeriodicInterval">75</int>
+                                               </object>
+                                               <bool key="NSAllowsLogicalLayoutDirection">NO</bool>
+                                       </object>
+                                       <object class="NSButton" id="861276216">
+                                               <reference key="NSNextResponder" ref="671181514"/>
+                                               <int key="NSvFlags">292</int>
+                                               <string key="NSFrame">{{0, -1}, {34, 23}}</string>
+                                               <reference key="NSSuperview" ref="671181514"/>
+                                               <reference key="NSWindow"/>
+                                               <reference key="NSNextKeyView" ref="456935010"/>
+                                               <bool key="NSEnabled">YES</bool>
+                                               <object class="NSButtonCell" key="NSCell" id="867532725">
+                                                       <int key="NSCellFlags">67108864</int>
+                                                       <int key="NSCellFlags2">134479872</int>
+                                                       <string key="NSContents"/>
+                                                       <reference key="NSSupport" ref="22"/>
+                                                       <reference key="NSControlView" ref="861276216"/>
+                                                       <int key="NSButtonFlags">-2033958912</int>
+                                                       <int key="NSButtonFlags2">268435618</int>
+                                                       <object class="NSCustomResource" key="NSNormalImage">
+                                                               <string key="NSClassName">NSImage</string>
+                                                               <string key="NSResourceName">NSAddTemplate</string>
+                                                       </object>
+                                                       <string key="NSAlternateContents"/>
+                                                       <string key="NSKeyEquivalent">n</string>
+                                                       <int key="NSPeriodicDelay">400</int>
+                                                       <int key="NSPeriodicInterval">75</int>
+                                               </object>
+                                               <bool key="NSAllowsLogicalLayoutDirection">NO</bool>
+                                       </object>
+                                       <object class="NSButton" id="1043784903">
+                                               <reference key="NSNextResponder" ref="671181514"/>
+                                               <int key="NSvFlags">292</int>
+                                               <string key="NSFrame">{{166, -1}, {34, 23}}</string>
+                                               <reference key="NSSuperview" ref="671181514"/>
+                                               <reference key="NSWindow"/>
+                                               <reference key="NSNextKeyView"/>
+                                               <bool key="NSEnabled">YES</bool>
+                                               <object class="NSButtonCell" key="NSCell" id="828611353">
+                                                       <int key="NSCellFlags">67108864</int>
+                                                       <int key="NSCellFlags2">134479872</int>
+                                                       <string key="NSContents">⬇</string>
+                                                       <reference key="NSSupport" ref="22"/>
+                                                       <reference key="NSControlView" ref="1043784903"/>
+                                                       <int key="NSButtonFlags">-2033434624</int>
+                                                       <int key="NSButtonFlags2">268435618</int>
+                                                       <string key="NSAlternateContents"/>
+                                                       <string key="NSKeyEquivalent"></string>
+                                                       <int key="NSPeriodicDelay">400</int>
+                                                       <int key="NSPeriodicInterval">75</int>
+                                               </object>
+                                               <bool key="NSAllowsLogicalLayoutDirection">NO</bool>
+                                       </object>
+                                       <object class="NSButton" id="1023366520">
+                                               <reference key="NSNextResponder" ref="671181514"/>
+                                               <int key="NSvFlags">292</int>
+                                               <string key="NSFrame">{{133, -1}, {34, 23}}</string>
+                                               <reference key="NSSuperview" ref="671181514"/>
+                                               <reference key="NSWindow"/>
+                                               <reference key="NSNextKeyView" ref="1043784903"/>
+                                               <bool key="NSEnabled">YES</bool>
+                                               <object class="NSButtonCell" key="NSCell" id="57592747">
+                                                       <int key="NSCellFlags">67108864</int>
+                                                       <int key="NSCellFlags2">134479872</int>
+                                                       <string key="NSContents">⬆</string>
+                                                       <reference key="NSSupport" ref="22"/>
+                                                       <reference key="NSControlView" ref="1023366520"/>
+                                                       <int key="NSButtonFlags">-2033434624</int>
+                                                       <int key="NSButtonFlags2">268435618</int>
+                                                       <string key="NSAlternateContents"/>
+                                                       <string key="NSKeyEquivalent"></string>
+                                                       <int key="NSPeriodicDelay">400</int>
+                                                       <int key="NSPeriodicInterval">75</int>
+                                               </object>
+                                               <bool key="NSAllowsLogicalLayoutDirection">NO</bool>
+                                       </object>
+                                       <object class="NSButton" id="456935010">
+                                               <reference key="NSNextResponder" ref="671181514"/>
+                                               <int key="NSvFlags">292</int>
+                                               <string key="NSFrame">{{33, -1}, {34, 23}}</string>
+                                               <reference key="NSSuperview" ref="671181514"/>
+                                               <reference key="NSWindow"/>
+                                               <reference key="NSNextKeyView" ref="149148392"/>
+                                               <bool key="NSEnabled">YES</bool>
+                                               <object class="NSButtonCell" key="NSCell" id="1008023024">
+                                                       <int key="NSCellFlags">67108864</int>
+                                                       <int key="NSCellFlags2">134479872</int>
+                                                       <string key="NSContents"/>
+                                                       <reference key="NSSupport" ref="22"/>
+                                                       <reference key="NSControlView" ref="456935010"/>
+                                                       <int key="NSButtonFlags">-2033958912</int>
+                                                       <int key="NSButtonFlags2">268435618</int>
+                                                       <object class="NSCustomResource" key="NSNormalImage">
+                                                               <string key="NSClassName">NSImage</string>
+                                                               <string key="NSResourceName">NSRemoveTemplate</string>
+                                                       </object>
+                                                       <string key="NSAlternateContents"/>
+                                                       <string type="base64-UTF8" key="NSKeyEquivalent">CA</string>
+                                                       <int key="NSPeriodicDelay">400</int>
+                                                       <int key="NSPeriodicInterval">75</int>
+                                               </object>
+                                               <bool key="NSAllowsLogicalLayoutDirection">NO</bool>
+                                       </object>
+                               </array>
+                               <string key="NSFrameSize">{200, 220}</string>
+                               <reference key="NSSuperview"/>
+                               <reference key="NSWindow"/>
+                               <reference key="NSNextKeyView" ref="443618264"/>
+                               <string key="NSClassName">NSView</string>
+                       </object>
+                       <object class="NSCustomObject" id="207406104">
+                               <string key="NSClassName">EnjoyableApplicationDelegate</string>
+                       </object>
+                       <object class="NSCustomObject" id="468285243">
+                               <string key="NSClassName">NJMappingsController</string>
+                       </object>
+                       <object class="NSCustomObject" id="1007832501">
+                               <string key="NSClassName">NJDeviceController</string>
+                       </object>
+                       <object class="NSCustomObject" id="801536542">
+                               <string key="NSClassName">NJOutputController</string>
+                       </object>
+                       <object class="NSViewController" id="328152383"/>
+                       <object class="NSPopover" id="586993839">
+                               <nil key="NSNextResponder"/>
+                               <int key="NSAppearance">0</int>
+                               <int key="NSBehavior">1</int>
+                               <double key="NSContentWidth">0.0</double>
+                               <double key="NSContentHeight">0.0</double>
+                               <bool key="NSAnimates">YES</bool>
+                       </object>
+               </array>
+               <object class="IBObjectContainer" key="IBDocument.Objects">
+                       <array class="NSMutableArray" key="connectionRecords">
+                               <object class="IBConnectionRecord">
+                                       <object class="IBActionConnection" key="connection">
+                                               <string key="label">terminate:</string>
+                                               <reference key="source" ref="1050"/>
+                                               <reference key="destination" ref="632727374"/>
+                                       </object>
+                                       <int key="connectionID">449</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBOutletConnection" key="connection">
+                                               <string key="label">delegate</string>
+                                               <reference key="source" ref="1050"/>
+                                               <reference key="destination" ref="207406104"/>
+                                       </object>
+                                       <int key="connectionID">483</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBOutletConnection" key="connection">
+                                               <string key="label">dockMenu</string>
+                                               <reference key="source" ref="1050"/>
+                                               <reference key="destination" ref="720053764"/>
+                                       </object>
+                                       <int key="connectionID">732</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBActionConnection" key="connection">
+                                               <string key="label">showHelp:</string>
+                                               <reference key="source" ref="1050"/>
+                                               <reference key="destination" ref="842970531"/>
+                                       </object>
+                                       <int key="connectionID">870</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBActionConnection" key="connection">
+                                               <string key="label">orderFrontStandardAboutPanel:</string>
+                                               <reference key="source" ref="1021"/>
+                                               <reference key="destination" ref="238522557"/>
+                                       </object>
+                                       <int key="connectionID">142</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBActionConnection" key="connection">
+                                               <string key="label">performMiniaturize:</string>
+                                               <reference key="source" ref="1014"/>
+                                               <reference key="destination" ref="1011231497"/>
+                                       </object>
+                                       <int key="connectionID">37</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBActionConnection" key="connection">
+                                               <string key="label">arrangeInFront:</string>
+                                               <reference key="source" ref="1014"/>
+                                               <reference key="destination" ref="625202149"/>
+                                       </object>
+                                       <int key="connectionID">39</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBActionConnection" key="connection">
+                                               <string key="label">performZoom:</string>
+                                               <reference key="source" ref="1014"/>
+                                               <reference key="destination" ref="575023229"/>
+                                       </object>
+                                       <int key="connectionID">240</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBActionConnection" key="connection">
+                                               <string key="label">hide:</string>
+                                               <reference key="source" ref="1014"/>
+                                               <reference key="destination" ref="755159360"/>
+                                       </object>
+                                       <int key="connectionID">367</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBActionConnection" key="connection">
+                                               <string key="label">hideOtherApplications:</string>
+                                               <reference key="source" ref="1014"/>
+                                               <reference key="destination" ref="342932134"/>
+                                       </object>
+                                       <int key="connectionID">368</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBActionConnection" key="connection">
+                                               <string key="label">unhideAllApplications:</string>
+                                               <reference key="source" ref="1014"/>
+                                               <reference key="destination" ref="908899353"/>
+                                       </object>
+                                       <int key="connectionID">370</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBOutletConnection" key="connection">
+                                               <string key="label">delegate</string>
+                                               <reference key="source" ref="762432499"/>
+                                               <reference key="destination" ref="468285243"/>
+                                       </object>
+                                       <int key="connectionID">517</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBOutletConnection" key="connection">
+                                               <string key="label">dataSource</string>
+                                               <reference key="source" ref="762432499"/>
+                                               <reference key="destination" ref="468285243"/>
+                                       </object>
+                                       <int key="connectionID">518</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBOutletConnection" key="connection">
+                                               <string key="label">outlineView</string>
+                                               <reference key="source" ref="1007832501"/>
+                                               <reference key="destination" ref="365506042"/>
+                                       </object>
+                                       <int key="connectionID">648</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBOutletConnection" key="connection">
+                                               <string key="label">mappingsController</string>
+                                               <reference key="source" ref="1007832501"/>
+                                               <reference key="destination" ref="468285243"/>
+                                       </object>
+                                       <int key="connectionID">822</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBOutletConnection" key="connection">
+                                               <string key="label">outputController</string>
+                                               <reference key="source" ref="1007832501"/>
+                                               <reference key="destination" ref="801536542"/>
+                                       </object>
+                                       <int key="connectionID">826</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBOutletConnection" key="connection">
+                                               <string key="label">translatingEventsMenu</string>
+                                               <reference key="source" ref="1007832501"/>
+                                               <reference key="destination" ref="632598200"/>
+                                       </object>
+                                       <int key="connectionID">877</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBActionConnection" key="connection">
+                                               <string key="label">translatingEventsChanged:</string>
+                                               <reference key="source" ref="1007832501"/>
+                                               <reference key="destination" ref="385218002"/>
+                                       </object>
+                                       <int key="connectionID">878</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBOutletConnection" key="connection">
+                                               <string key="label">translatingEventsButton</string>
+                                               <reference key="source" ref="1007832501"/>
+                                               <reference key="destination" ref="385218002"/>
+                                       </object>
+                                       <int key="connectionID">879</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBOutletConnection" key="connection">
+                                               <string key="label">dockMenuBase</string>
+                                               <reference key="source" ref="207406104"/>
+                                               <reference key="destination" ref="720053764"/>
+                                       </object>
+                                       <int key="connectionID">726</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBOutletConnection" key="connection">
+                                               <string key="label">inputController</string>
+                                               <reference key="source" ref="207406104"/>
+                                               <reference key="destination" ref="1007832501"/>
+                                       </object>
+                                       <int key="connectionID">819</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBOutletConnection" key="connection">
+                                               <string key="label">mappingsController</string>
+                                               <reference key="source" ref="207406104"/>
+                                               <reference key="destination" ref="468285243"/>
+                                       </object>
+                                       <int key="connectionID">820</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBOutletConnection" key="connection">
+                                               <string key="label">window</string>
+                                               <reference key="source" ref="207406104"/>
+                                               <reference key="destination" ref="808667431"/>
+                                       </object>
+                                       <int key="connectionID">865</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBActionConnection" key="connection">
+                                               <string key="label">removePressed:</string>
+                                               <reference key="source" ref="468285243"/>
+                                               <reference key="destination" ref="456935010"/>
+                                       </object>
+                                       <int key="connectionID">516</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBOutletConnection" key="connection">
+                                               <string key="label">removeButton</string>
+                                               <reference key="source" ref="468285243"/>
+                                               <reference key="destination" ref="456935010"/>
+                                       </object>
+                                       <int key="connectionID">519</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBOutletConnection" key="connection">
+                                               <string key="label">tableView</string>
+                                               <reference key="source" ref="468285243"/>
+                                               <reference key="destination" ref="762432499"/>
+                                       </object>
+                                       <int key="connectionID">520</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBActionConnection" key="connection">
+                                               <string key="label">exportPressed:</string>
+                                               <reference key="source" ref="468285243"/>
+                                               <reference key="destination" ref="888617891"/>
+                                       </object>
+                                       <int key="connectionID">815</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBActionConnection" key="connection">
+                                               <string key="label">importPressed:</string>
+                                               <reference key="source" ref="468285243"/>
+                                               <reference key="destination" ref="187155117"/>
+                                       </object>
+                                       <int key="connectionID">816</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBOutletConnection" key="connection">
+                                               <string key="label">outputController</string>
+                                               <reference key="source" ref="468285243"/>
+                                               <reference key="destination" ref="801536542"/>
+                                       </object>
+                                       <int key="connectionID">827</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBActionConnection" key="connection">
+                                               <string key="label">mappingPressed:</string>
+                                               <reference key="source" ref="468285243"/>
+                                               <reference key="destination" ref="227597319"/>
+                                       </object>
+                                       <int key="connectionID">855</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBOutletConnection" key="connection">
+                                               <string key="label">popover</string>
+                                               <reference key="source" ref="468285243"/>
+                                               <reference key="destination" ref="586993839"/>
+                                       </object>
+                                       <int key="connectionID">856</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBOutletConnection" key="connection">
+                                               <string key="label">popoverActivate</string>
+                                               <reference key="source" ref="468285243"/>
+                                               <reference key="destination" ref="227597319"/>
+                                       </object>
+                                       <int key="connectionID">857</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBActionConnection" key="connection">
+                                               <string key="label">addPressed:</string>
+                                               <reference key="source" ref="468285243"/>
+                                               <reference key="destination" ref="861276216"/>
+                                       </object>
+                                       <int key="connectionID">515</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBActionConnection" key="connection">
+                                               <string key="label">moveUpPressed:</string>
+                                               <reference key="source" ref="468285243"/>
+                                               <reference key="destination" ref="1023366520"/>
+                                       </object>
+                                       <int key="connectionID">899</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBActionConnection" key="connection">
+                                               <string key="label">moveDownPressed:</string>
+                                               <reference key="source" ref="468285243"/>
+                                               <reference key="destination" ref="1043784903"/>
+                                       </object>
+                                       <int key="connectionID">900</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBOutletConnection" key="connection">
+                                               <string key="label">moveUp</string>
+                                               <reference key="source" ref="468285243"/>
+                                               <reference key="destination" ref="1023366520"/>
+                                       </object>
+                                       <int key="connectionID">901</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBOutletConnection" key="connection">
+                                               <string key="label">moveDown</string>
+                                               <reference key="source" ref="468285243"/>
+                                               <reference key="destination" ref="1043784903"/>
+                                       </object>
+                                       <int key="connectionID">902</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBOutletConnection" key="connection">
+                                               <string key="label">dataSource</string>
+                                               <reference key="source" ref="365506042"/>
+                                               <reference key="destination" ref="1007832501"/>
+                                       </object>
+                                       <int key="connectionID">647</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBOutletConnection" key="connection">
+                                               <string key="label">delegate</string>
+                                               <reference key="source" ref="365506042"/>
+                                               <reference key="destination" ref="1007832501"/>
+                                       </object>
+                                       <int key="connectionID">696</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBOutletConnection" key="connection">
+                                               <string key="label">delegate</string>
+                                               <reference key="source" ref="206489479"/>
+                                               <reference key="destination" ref="207406104"/>
+                                       </object>
+                                       <int key="connectionID">892</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBOutletConnection" key="connection">
+                                               <string key="label">radioButtons</string>
+                                               <reference key="source" ref="801536542"/>
+                                               <reference key="destination" ref="120408205"/>
+                                       </object>
+                                       <int key="connectionID">692</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBOutletConnection" key="connection">
+                                               <string key="label">title</string>
+                                               <reference key="source" ref="801536542"/>
+                                               <reference key="destination" ref="1016088174"/>
+                                       </object>
+                                       <int key="connectionID">709</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBActionConnection" key="connection">
+                                               <string key="label">radioChanged:</string>
+                                               <reference key="source" ref="801536542"/>
+                                               <reference key="destination" ref="120408205"/>
+                                       </object>
+                                       <int key="connectionID">731</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBOutletConnection" key="connection">
+                                               <string key="label">mouseBtnSelect</string>
+                                               <reference key="source" ref="801536542"/>
+                                               <reference key="destination" ref="125828224"/>
+                                       </object>
+                                       <int key="connectionID">746</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBActionConnection" key="connection">
+                                               <string key="label">mbtnChanged:</string>
+                                               <reference key="source" ref="801536542"/>
+                                               <reference key="destination" ref="125828224"/>
+                                       </object>
+                                       <int key="connectionID">747</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBOutletConnection" key="connection">
+                                               <string key="label">scrollDirSelect</string>
+                                               <reference key="source" ref="801536542"/>
+                                               <reference key="destination" ref="921829691"/>
+                                       </object>
+                                       <int key="connectionID">751</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBActionConnection" key="connection">
+                                               <string key="label">sdirChanged:</string>
+                                               <reference key="source" ref="801536542"/>
+                                               <reference key="destination" ref="921829691"/>
+                                       </object>
+                                       <int key="connectionID">752</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBOutletConnection" key="connection">
+                                               <string key="label">mouseDirSelect</string>
+                                               <reference key="source" ref="801536542"/>
+                                               <reference key="destination" ref="875916470"/>
+                                       </object>
+                                       <int key="connectionID">756</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBActionConnection" key="connection">
+                                               <string key="label">mdirChanged:</string>
+                                               <reference key="source" ref="801536542"/>
+                                               <reference key="destination" ref="875916470"/>
+                                       </object>
+                                       <int key="connectionID">757</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBOutletConnection" key="connection">
+                                               <string key="label">keyInput</string>
+                                               <reference key="source" ref="801536542"/>
+                                               <reference key="destination" ref="57697638"/>
+                                       </object>
+                                       <int key="connectionID">781</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBOutletConnection" key="connection">
+                                               <string key="label">mappingsController</string>
+                                               <reference key="source" ref="801536542"/>
+                                               <reference key="destination" ref="468285243"/>
+                                       </object>
+                                       <int key="connectionID">821</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBOutletConnection" key="connection">
+                                               <string key="label">mappingPopup</string>
+                                               <reference key="source" ref="801536542"/>
+                                               <reference key="destination" ref="194275224"/>
+                                       </object>
+                                       <int key="connectionID">823</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBOutletConnection" key="connection">
+                                               <string key="label">inputController</string>
+                                               <reference key="source" ref="801536542"/>
+                                               <reference key="destination" ref="1007832501"/>
+                                       </object>
+                                       <int key="connectionID">828</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBActionConnection" key="connection">
+                                               <string key="label">mouseSpeedChanged:</string>
+                                               <reference key="source" ref="801536542"/>
+                                               <reference key="destination" ref="385416822"/>
+                                       </object>
+                                       <int key="connectionID">885</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBOutletConnection" key="connection">
+                                               <string key="label">mouseSpeedSlider</string>
+                                               <reference key="source" ref="801536542"/>
+                                               <reference key="destination" ref="385416822"/>
+                                       </object>
+                                       <int key="connectionID">886</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBActionConnection" key="connection">
+                                               <string key="label">scrollSpeedChanged:</string>
+                                               <reference key="source" ref="801536542"/>
+                                               <reference key="destination" ref="792189805"/>
+                                       </object>
+                                       <int key="connectionID">890</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBOutletConnection" key="connection">
+                                               <string key="label">scrollSpeedSlider</string>
+                                               <reference key="source" ref="801536542"/>
+                                               <reference key="destination" ref="792189805"/>
+                                       </object>
+                                       <int key="connectionID">891</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBOutletConnection" key="connection">
+                                               <string key="label">keyDelegate</string>
+                                               <reference key="source" ref="57697638"/>
+                                               <reference key="destination" ref="801536542"/>
+                                       </object>
+                                       <int key="connectionID">818</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBActionConnection" key="connection">
+                                               <string key="label">performClick:</string>
+                                               <reference key="source" ref="227597319"/>
+                                               <reference key="destination" ref="914355947"/>
+                                       </object>
+                                       <int key="connectionID">871</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBOutletConnection" key="connection">
+                                               <string key="label">view</string>
+                                               <reference key="source" ref="328152383"/>
+                                               <reference key="destination" ref="671181514"/>
+                                       </object>
+                                       <int key="connectionID">854</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBOutletConnection" key="connection">
+                                               <string key="label">contentViewController</string>
+                                               <reference key="source" ref="586993839"/>
+                                               <reference key="destination" ref="328152383"/>
+                                       </object>
+                                       <int key="connectionID">852</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBOutletConnection" key="connection">
+                                               <string key="label">delegate</string>
+                                               <reference key="source" ref="586993839"/>
+                                               <reference key="destination" ref="468285243"/>
+                                       </object>
+                                       <int key="connectionID">853</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBActionConnection" key="connection">
+                                               <string key="label">performClick:</string>
+                                               <reference key="source" ref="385218002"/>
+                                               <reference key="destination" ref="632598200"/>
+                                       </object>
+                                       <int key="connectionID">880</int>
+                               </object>
+                       </array>
+                       <object class="IBMutableOrderedSet" key="objectRecords">
+                               <array key="orderedObjects">
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">0</int>
+                                               <reference key="object" ref="0"/>
+                                               <reference key="children" ref="1048"/>
+                                               <nil key="parent"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">-2</int>
+                                               <reference key="object" ref="1021"/>
+                                               <reference key="parent" ref="0"/>
+                                               <string key="objectName">File's Owner</string>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">-1</int>
+                                               <reference key="object" ref="1014"/>
+                                               <reference key="parent" ref="0"/>
+                                               <string key="objectName">First Responder</string>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">-3</int>
+                                               <reference key="object" ref="1050"/>
+                                               <reference key="parent" ref="0"/>
+                                               <string key="objectName">Application</string>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">29</int>
+                                               <reference key="object" ref="649796088"/>
+                                               <array class="NSMutableArray" key="children">
+                                                       <reference ref="713487014"/>
+                                                       <reference ref="694149608"/>
+                                                       <reference ref="379814623"/>
+                                                       <reference ref="693056251"/>
+                                               </array>
+                                               <reference key="parent" ref="0"/>
+                                               <string key="objectName">Main Menu</string>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">19</int>
+                                               <reference key="object" ref="713487014"/>
+                                               <array class="NSMutableArray" key="children">
+                                                       <reference ref="835318025"/>
+                                               </array>
+                                               <reference key="parent" ref="649796088"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">56</int>
+                                               <reference key="object" ref="694149608"/>
+                                               <array class="NSMutableArray" key="children">
+                                                       <reference ref="110575045"/>
+                                               </array>
+                                               <reference key="parent" ref="649796088"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">83</int>
+                                               <reference key="object" ref="379814623"/>
+                                               <array class="NSMutableArray" key="children">
+                                                       <reference ref="720053764"/>
+                                               </array>
+                                               <reference key="parent" ref="649796088"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">81</int>
+                                               <reference key="object" ref="720053764"/>
+                                               <array class="NSMutableArray" key="children">
+                                                       <reference ref="632598200"/>
+                                                       <reference ref="773548144"/>
+                                                       <reference ref="914355947"/>
+                                                       <reference ref="580069611"/>
+                                                       <reference ref="888617891"/>
+                                                       <reference ref="187155117"/>
+                                               </array>
+                                               <reference key="parent" ref="379814623"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">57</int>
+                                               <reference key="object" ref="110575045"/>
+                                               <array class="NSMutableArray" key="children">
+                                                       <reference ref="238522557"/>
+                                                       <reference ref="755159360"/>
+                                                       <reference ref="908899353"/>
+                                                       <reference ref="632727374"/>
+                                                       <reference ref="646227648"/>
+                                                       <reference ref="304266470"/>
+                                                       <reference ref="1046388886"/>
+                                                       <reference ref="1056857174"/>
+                                                       <reference ref="342932134"/>
+                                               </array>
+                                               <reference key="parent" ref="694149608"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">58</int>
+                                               <reference key="object" ref="238522557"/>
+                                               <reference key="parent" ref="110575045"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">134</int>
+                                               <reference key="object" ref="755159360"/>
+                                               <reference key="parent" ref="110575045"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">150</int>
+                                               <reference key="object" ref="908899353"/>
+                                               <reference key="parent" ref="110575045"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">136</int>
+                                               <reference key="object" ref="632727374"/>
+                                               <reference key="parent" ref="110575045"/>
+                                               <string key="objectName">Quit Enjoy</string>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">144</int>
+                                               <reference key="object" ref="646227648"/>
+                                               <reference key="parent" ref="110575045"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">236</int>
+                                               <reference key="object" ref="304266470"/>
+                                               <reference key="parent" ref="110575045"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">131</int>
+                                               <reference key="object" ref="1046388886"/>
+                                               <array class="NSMutableArray" key="children">
+                                                       <reference ref="752062318"/>
+                                               </array>
+                                               <reference key="parent" ref="110575045"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">149</int>
+                                               <reference key="object" ref="1056857174"/>
+                                               <reference key="parent" ref="110575045"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">145</int>
+                                               <reference key="object" ref="342932134"/>
+                                               <reference key="parent" ref="110575045"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">130</int>
+                                               <reference key="object" ref="752062318"/>
+                                               <reference key="parent" ref="1046388886"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">24</int>
+                                               <reference key="object" ref="835318025"/>
+                                               <array class="NSMutableArray" key="children">
+                                                       <reference ref="299356726"/>
+                                                       <reference ref="625202149"/>
+                                                       <reference ref="575023229"/>
+                                                       <reference ref="1011231497"/>
+                                               </array>
+                                               <reference key="parent" ref="713487014"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">92</int>
+                                               <reference key="object" ref="299356726"/>
+                                               <reference key="parent" ref="835318025"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">5</int>
+                                               <reference key="object" ref="625202149"/>
+                                               <reference key="parent" ref="835318025"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">239</int>
+                                               <reference key="object" ref="575023229"/>
+                                               <reference key="parent" ref="835318025"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">23</int>
+                                               <reference key="object" ref="1011231497"/>
+                                               <reference key="parent" ref="835318025"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">450</int>
+                                               <reference key="object" ref="808667431"/>
+                                               <array class="NSMutableArray" key="children">
+                                                       <reference ref="177223957"/>
+                                                       <reference ref="1043384830"/>
+                                               </array>
+                                               <reference key="parent" ref="0"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">451</int>
+                                               <reference key="object" ref="671181514"/>
+                                               <array class="NSMutableArray" key="children">
+                                                       <reference ref="443618264"/>
+                                                       <reference ref="456935010"/>
+                                                       <reference ref="149148392"/>
+                                                       <reference ref="861276216"/>
+                                                       <reference ref="1023366520"/>
+                                                       <reference ref="1043784903"/>
+                                               </array>
+                                               <reference key="parent" ref="0"/>
+                                               <string key="objectName">Mapping List Popover Content</string>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">453</int>
+                                               <reference key="object" ref="177223957"/>
+                                               <array class="NSMutableArray" key="children">
+                                                       <reference ref="206489479"/>
+                                               </array>
+                                               <reference key="parent" ref="808667431"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">456</int>
+                                               <reference key="object" ref="443618264"/>
+                                               <array class="NSMutableArray" key="children">
+                                                       <reference ref="968378655"/>
+                                                       <reference ref="553414014"/>
+                                                       <reference ref="762432499"/>
+                                               </array>
+                                               <reference key="parent" ref="671181514"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">457</int>
+                                               <reference key="object" ref="968378655"/>
+                                               <reference key="parent" ref="443618264"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">458</int>
+                                               <reference key="object" ref="553414014"/>
+                                               <reference key="parent" ref="443618264"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">459</int>
+                                               <reference key="object" ref="762432499"/>
+                                               <array class="NSMutableArray" key="children">
+                                                       <reference ref="827961598"/>
+                                               </array>
+                                               <reference key="parent" ref="443618264"/>
+                                               <string key="objectName">Mapping List</string>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">461</int>
+                                               <reference key="object" ref="827961598"/>
+                                               <array class="NSMutableArray" key="children">
+                                                       <reference ref="638155037"/>
+                                               </array>
+                                               <reference key="parent" ref="762432499"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">464</int>
+                                               <reference key="object" ref="638155037"/>
+                                               <reference key="parent" ref="827961598"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">482</int>
+                                               <reference key="object" ref="207406104"/>
+                                               <reference key="parent" ref="0"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">487</int>
+                                               <reference key="object" ref="1043384830"/>
+                                               <array class="NSMutableArray" key="children">
+                                                       <reference ref="496378711"/>
+                                                       <reference ref="658903347"/>
+                                                       <reference ref="985167622"/>
+                                               </array>
+                                               <reference key="parent" ref="808667431"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">511</int>
+                                               <reference key="object" ref="456935010"/>
+                                               <array class="NSMutableArray" key="children">
+                                                       <reference ref="1008023024"/>
+                                               </array>
+                                               <reference key="parent" ref="671181514"/>
+                                               <string key="objectName">Remove Mapping</string>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">512</int>
+                                               <reference key="object" ref="1008023024"/>
+                                               <reference key="parent" ref="456935010"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">514</int>
+                                               <reference key="object" ref="468285243"/>
+                                               <reference key="parent" ref="0"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">479</int>
+                                               <reference key="object" ref="1007832501"/>
+                                               <reference key="parent" ref="0"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">606</int>
+                                               <reference key="object" ref="632598200"/>
+                                               <reference key="parent" ref="720053764"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">652</int>
+                                               <reference key="object" ref="206489479"/>
+                                               <array class="NSMutableArray" key="children">
+                                                       <reference ref="977242492"/>
+                                                       <reference ref="606740242"/>
+                                               </array>
+                                               <reference key="parent" ref="177223957"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">653</int>
+                                               <reference key="object" ref="977242492"/>
+                                               <array class="NSMutableArray" key="children">
+                                                       <reference ref="364857164"/>
+                                               </array>
+                                               <reference key="parent" ref="206489479"/>
+                                               <string key="objectName">Input Devices Pane</string>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">634</int>
+                                               <reference key="object" ref="364857164"/>
+                                               <array class="NSMutableArray" key="children">
+                                                       <reference ref="365506042"/>
+                                                       <reference ref="892486973"/>
+                                                       <reference ref="1036252745"/>
+                                               </array>
+                                               <reference key="parent" ref="977242492"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">637</int>
+                                               <reference key="object" ref="365506042"/>
+                                               <array class="NSMutableArray" key="children">
+                                                       <reference ref="290995057"/>
+                                               </array>
+                                               <reference key="parent" ref="364857164"/>
+                                               <string key="objectName">Input Device List</string>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">636</int>
+                                               <reference key="object" ref="892486973"/>
+                                               <reference key="parent" ref="364857164"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">635</int>
+                                               <reference key="object" ref="1036252745"/>
+                                               <reference key="parent" ref="364857164"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">639</int>
+                                               <reference key="object" ref="290995057"/>
+                                               <array class="NSMutableArray" key="children">
+                                                       <reference ref="158646067"/>
+                                               </array>
+                                               <reference key="parent" ref="365506042"/>
+                                               <string key="objectName">Device/Input Name</string>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">642</int>
+                                               <reference key="object" ref="158646067"/>
+                                               <reference key="parent" ref="290995057"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">654</int>
+                                               <reference key="object" ref="606740242"/>
+                                               <array class="NSMutableArray" key="children">
+                                                       <reference ref="497528019"/>
+                                                       <reference ref="921829691"/>
+                                                       <reference ref="125828224"/>
+                                                       <reference ref="875916470"/>
+                                                       <reference ref="1016088174"/>
+                                                       <reference ref="194275224"/>
+                                                       <reference ref="57697638"/>
+                                                       <reference ref="792189805"/>
+                                                       <reference ref="385416822"/>
+                                                       <reference ref="120408205"/>
+                                               </array>
+                                               <reference key="parent" ref="206489479"/>
+                                               <string key="objectName">Output Editor Pane</string>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">686</int>
+                                               <reference key="object" ref="801536542"/>
+                                               <reference key="parent" ref="0"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">656</int>
+                                               <reference key="object" ref="120408205"/>
+                                               <array class="NSMutableArray" key="children">
+                                                       <reference ref="177186415"/>
+                                                       <reference ref="632642090"/>
+                                                       <reference ref="387494389"/>
+                                                       <reference ref="339215895"/>
+                                                       <reference ref="820968178"/>
+                                                       <reference ref="275466816"/>
+                                                       <reference ref="134694197"/>
+                                               </array>
+                                               <reference key="parent" ref="606740242"/>
+                                               <string key="objectName">Output Types</string>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">657</int>
+                                               <reference key="object" ref="177186415"/>
+                                               <reference key="parent" ref="120408205"/>
+                                               <string key="objectName">Disabled</string>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">658</int>
+                                               <reference key="object" ref="387494389"/>
+                                               <reference key="parent" ref="120408205"/>
+                                               <string key="objectName">Key Press</string>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">699</int>
+                                               <reference key="object" ref="339215895"/>
+                                               <reference key="parent" ref="120408205"/>
+                                               <string key="objectName">Switch Mapping</string>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">700</int>
+                                               <reference key="object" ref="194275224"/>
+                                               <array class="NSMutableArray" key="children">
+                                                       <reference ref="74311158"/>
+                                               </array>
+                                               <reference key="parent" ref="606740242"/>
+                                               <string key="objectName">Mapping Choice List</string>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">701</int>
+                                               <reference key="object" ref="74311158"/>
+                                               <array class="NSMutableArray" key="children">
+                                                       <reference ref="19633006"/>
+                                               </array>
+                                               <reference key="parent" ref="194275224"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">702</int>
+                                               <reference key="object" ref="19633006"/>
+                                               <array class="NSMutableArray" key="children"/>
+                                               <reference key="parent" ref="74311158"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">706</int>
+                                               <reference key="object" ref="1016088174"/>
+                                               <array class="NSMutableArray" key="children">
+                                                       <reference ref="853503577"/>
+                                               </array>
+                                               <reference key="parent" ref="606740242"/>
+                                               <string key="objectName">Input Name</string>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">707</int>
+                                               <reference key="object" ref="853503577"/>
+                                               <reference key="parent" ref="1016088174"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">708</int>
+                                               <reference key="object" ref="497528019"/>
+                                               <reference key="parent" ref="606740242"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">723</int>
+                                               <reference key="object" ref="773548144"/>
+                                               <reference key="parent" ref="720053764"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">733</int>
+                                               <reference key="object" ref="820968178"/>
+                                               <reference key="parent" ref="120408205"/>
+                                               <string key="objectName">Mouse Movement</string>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">734</int>
+                                               <reference key="object" ref="275466816"/>
+                                               <reference key="parent" ref="120408205"/>
+                                               <string key="objectName">Mouse Button</string>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">735</int>
+                                               <reference key="object" ref="134694197"/>
+                                               <reference key="parent" ref="120408205"/>
+                                               <string key="objectName">Mouse Scroll</string>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">659</int>
+                                               <reference key="object" ref="632642090"/>
+                                               <reference key="parent" ref="120408205"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">744</int>
+                                               <reference key="object" ref="125828224"/>
+                                               <array class="NSMutableArray" key="children">
+                                                       <reference ref="514491330"/>
+                                               </array>
+                                               <reference key="parent" ref="606740242"/>
+                                               <string key="objectName">Mouse Button Selector</string>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">745</int>
+                                               <reference key="object" ref="514491330"/>
+                                               <reference key="parent" ref="125828224"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">749</int>
+                                               <reference key="object" ref="921829691"/>
+                                               <array class="NSMutableArray" key="children">
+                                                       <reference ref="301345285"/>
+                                               </array>
+                                               <reference key="parent" ref="606740242"/>
+                                               <string key="objectName">Mouse Scroll Selector</string>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">750</int>
+                                               <reference key="object" ref="301345285"/>
+                                               <reference key="parent" ref="921829691"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">754</int>
+                                               <reference key="object" ref="875916470"/>
+                                               <array class="NSMutableArray" key="children">
+                                                       <reference ref="241270212"/>
+                                               </array>
+                                               <reference key="parent" ref="606740242"/>
+                                               <string key="objectName">Mouse Motion Selector</string>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">755</int>
+                                               <reference key="object" ref="241270212"/>
+                                               <reference key="parent" ref="875916470"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">778</int>
+                                               <reference key="object" ref="57697638"/>
+                                               <reference key="parent" ref="606740242"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">812</int>
+                                               <reference key="object" ref="580069611"/>
+                                               <reference key="parent" ref="720053764"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">813</int>
+                                               <reference key="object" ref="888617891"/>
+                                               <reference key="parent" ref="720053764"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">814</int>
+                                               <reference key="object" ref="187155117"/>
+                                               <reference key="parent" ref="720053764"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">837</int>
+                                               <reference key="object" ref="496378711"/>
+                                               <array class="NSMutableArray" key="children">
+                                                       <reference ref="227597319"/>
+                                               </array>
+                                               <reference key="parent" ref="1043384830"/>
+                                               <string key="objectName">Mapping Selector</string>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">835</int>
+                                               <reference key="object" ref="227597319"/>
+                                               <array class="NSMutableArray" key="children">
+                                                       <reference ref="850080795"/>
+                                               </array>
+                                               <reference key="parent" ref="496378711"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">836</int>
+                                               <reference key="object" ref="850080795"/>
+                                               <reference key="parent" ref="227597319"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">849</int>
+                                               <reference key="object" ref="658903347"/>
+                                               <reference key="parent" ref="1043384830"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">850</int>
+                                               <reference key="object" ref="328152383"/>
+                                               <reference key="parent" ref="0"/>
+                                               <string key="objectName">Popover View Controller</string>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">851</int>
+                                               <reference key="object" ref="586993839"/>
+                                               <reference key="parent" ref="0"/>
+                                               <string key="objectName">Mapping List Popover</string>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">507</int>
+                                               <reference key="object" ref="861276216"/>
+                                               <array class="NSMutableArray" key="children">
+                                                       <reference ref="867532725"/>
+                                               </array>
+                                               <reference key="parent" ref="671181514"/>
+                                               <string key="objectName">Add Mapping</string>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">508</int>
+                                               <reference key="object" ref="867532725"/>
+                                               <reference key="parent" ref="861276216"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">862</int>
+                                               <reference key="object" ref="149148392"/>
+                                               <array class="NSMutableArray" key="children">
+                                                       <reference ref="517346822"/>
+                                               </array>
+                                               <reference key="parent" ref="671181514"/>
+                                               <string key="objectName">Gradient Space</string>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">863</int>
+                                               <reference key="object" ref="517346822"/>
+                                               <reference key="parent" ref="149148392"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">810</int>
+                                               <reference key="object" ref="914355947"/>
+                                               <reference key="parent" ref="720053764"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">866</int>
+                                               <reference key="object" ref="693056251"/>
+                                               <array class="NSMutableArray" key="children">
+                                                       <reference ref="997802319"/>
+                                               </array>
+                                               <reference key="parent" ref="649796088"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">867</int>
+                                               <reference key="object" ref="997802319"/>
+                                               <array class="NSMutableArray" key="children">
+                                                       <reference ref="842970531"/>
+                                               </array>
+                                               <reference key="parent" ref="693056251"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">868</int>
+                                               <reference key="object" ref="842970531"/>
+                                               <reference key="parent" ref="997802319"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">874</int>
+                                               <reference key="object" ref="985167622"/>
+                                               <array class="NSMutableArray" key="children">
+                                                       <reference ref="385218002"/>
+                                               </array>
+                                               <reference key="parent" ref="1043384830"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">872</int>
+                                               <reference key="object" ref="385218002"/>
+                                               <array class="NSMutableArray" key="children">
+                                                       <reference ref="422366518"/>
+                                               </array>
+                                               <reference key="parent" ref="985167622"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">873</int>
+                                               <reference key="object" ref="422366518"/>
+                                               <reference key="parent" ref="385218002"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">883</int>
+                                               <reference key="object" ref="385416822"/>
+                                               <array class="NSMutableArray" key="children">
+                                                       <reference ref="5417367"/>
+                                               </array>
+                                               <reference key="parent" ref="606740242"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">884</int>
+                                               <reference key="object" ref="5417367"/>
+                                               <reference key="parent" ref="385416822"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">887</int>
+                                               <reference key="object" ref="792189805"/>
+                                               <array class="NSMutableArray" key="children">
+                                                       <reference ref="423057230"/>
+                                               </array>
+                                               <reference key="parent" ref="606740242"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">888</int>
+                                               <reference key="object" ref="423057230"/>
+                                               <reference key="parent" ref="792189805"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">893</int>
+                                               <reference key="object" ref="1023366520"/>
+                                               <array class="NSMutableArray" key="children">
+                                                       <reference ref="57592747"/>
+                                               </array>
+                                               <reference key="parent" ref="671181514"/>
+                                               <string key="objectName">Move Mapping Up</string>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">894</int>
+                                               <reference key="object" ref="57592747"/>
+                                               <reference key="parent" ref="1023366520"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">896</int>
+                                               <reference key="object" ref="1043784903"/>
+                                               <array class="NSMutableArray" key="children">
+                                                       <reference ref="828611353"/>
+                                               </array>
+                                               <reference key="parent" ref="671181514"/>
+                                               <string key="objectName">Move Mapping Down</string>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">897</int>
+                                               <reference key="object" ref="828611353"/>
+                                               <reference key="parent" ref="1043784903"/>
+                                       </object>
+                               </array>
+                       </object>
+                       <dictionary class="NSMutableDictionary" key="flattenedProperties">
+                               <string key="-1.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                               <string key="-2.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                               <string key="-3.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                               <string key="130.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                               <string key="131.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                               <string key="134.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                               <string key="136.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                               <string key="144.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                               <string key="145.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                               <string key="149.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                               <string key="150.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                               <string key="19.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                               <string key="23.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                               <string key="236.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                               <string key="239.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                               <string key="24.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                               <string key="29.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                               <boolean value="YES" key="450.IBNSWindowAutoPositionCentersHorizontal"/>
+                               <boolean value="YES" key="450.IBNSWindowAutoPositionCentersVertical"/>
+                               <string key="450.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                               <string key="450.IBWindowTemplateEditedContentRect">{{114, 276}, {770, 487}}</string>
+                               <boolean value="YES" key="450.NSWindowTemplate.visibleAtLaunch"/>
+                               <string key="451.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                               <string key="453.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                               <string key="456.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                               <string key="457.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                               <string key="458.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                               <string key="459.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                               <string key="461.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                               <string key="464.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                               <string key="479.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                               <string key="482.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                               <string key="487.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                               <string key="5.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                               <object class="NSMutableDictionary" key="507.IBAttributePlaceholdersKey">
+                                       <string key="NS.key.0">ToolTip</string>
+                                       <object class="IBToolTipAttribute" key="NS.object.0">
+                                               <string key="name">ToolTip</string>
+                                               <reference key="object" ref="861276216"/>
+                                               <string key="toolTip">Create a new mapping</string>
+                                       </object>
+                               </object>
+                               <string key="507.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                               <string key="508.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                               <object class="NSMutableDictionary" key="511.IBAttributePlaceholdersKey">
+                                       <string key="NS.key.0">ToolTip</string>
+                                       <object class="IBToolTipAttribute" key="NS.object.0">
+                                               <string key="name">ToolTip</string>
+                                               <reference key="object" ref="456935010"/>
+                                               <string key="toolTip">Remove the selected mapping</string>
+                                       </object>
+                               </object>
+                               <string key="511.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                               <string key="512.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                               <string key="514.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                               <string key="56.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                               <string key="57.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                               <string key="58.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                               <string key="606.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                               <string key="634.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                               <string key="635.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                               <string key="636.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                               <string key="637.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                               <string key="639.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                               <string key="642.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                               <string key="652.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                               <string key="653.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                               <string key="654.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                               <string key="656.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                               <string key="657.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                               <string key="658.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                               <string key="659.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                               <string key="686.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                               <string key="699.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                               <string key="700.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                               <string key="701.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                               <string key="702.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                               <string key="706.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                               <string key="707.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                               <string key="708.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                               <string key="723.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                               <string key="733.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                               <string key="734.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                               <string key="735.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                               <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="749.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                               <integer value="1" key="750.IBNSSegmentedControlInspectorSelectedSegmentMetadataKey"/>
+                               <string key="750.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                               <string key="754.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                               <integer value="1" key="755.IBNSSegmentedControlInspectorSelectedSegmentMetadataKey"/>
+                               <string key="755.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                               <string key="778.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                               <string key="81.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                               <string key="810.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                               <string key="812.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                               <string key="813.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                               <string key="814.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                               <string key="83.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                               <object class="NSMutableDictionary" key="835.IBAttributePlaceholdersKey">
+                                       <string key="NS.key.0">ToolTip</string>
+                                       <object class="IBToolTipAttribute" key="NS.object.0">
+                                               <string key="name">ToolTip</string>
+                                               <reference key="object" ref="227597319"/>
+                                               <string key="toolTip">Change the active mapping</string>
+                                       </object>
+                               </object>
+                               <string key="835.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                               <string key="836.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                               <string key="837.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                               <boolean value="NO" key="837.toolbarItem.selectable"/>
+                               <string key="849.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                               <string key="850.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                               <string key="851.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                               <string key="862.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                               <string key="863.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                               <string key="866.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                               <string key="867.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                               <string key="868.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                               <object class="NSMutableDictionary" key="872.IBAttributePlaceholdersKey">
+                                       <string key="NS.key.0">ToolTip</string>
+                                       <object class="IBToolTipAttribute" key="NS.object.0">
+                                               <string key="name">ToolTip</string>
+                                               <reference key="object" ref="385218002"/>
+                                               <string key="toolTip">Enable mapped actions</string>
+                                       </object>
+                               </object>
+                               <string key="872.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                               <string key="873.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                               <string key="874.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                               <object class="NSMutableDictionary" key="883.IBAttributePlaceholdersKey">
+                                       <string key="NS.key.0">ToolTip</string>
+                                       <object class="IBToolTipAttribute" key="NS.object.0">
+                                               <string key="name">ToolTip</string>
+                                               <reference key="object" ref="385416822"/>
+                                               <string key="toolTip">Maximum mouse speed</string>
+                                       </object>
+                               </object>
+                               <string key="883.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                               <string key="884.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                               <object class="NSMutableDictionary" key="887.IBAttributePlaceholdersKey">
+                                       <string key="NS.key.0">ToolTip</string>
+                                       <object class="IBToolTipAttribute" key="NS.object.0">
+                                               <string key="name">ToolTip</string>
+                                               <reference key="object" ref="792189805"/>
+                                               <string key="toolTip">Mouse scroll speed</string>
+                                       </object>
+                               </object>
+                               <string key="887.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                               <string key="888.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                               <object class="NSMutableDictionary" key="893.IBAttributePlaceholdersKey">
+                                       <string key="NS.key.0">ToolTip</string>
+                                       <object class="IBToolTipAttribute" key="NS.object.0">
+                                               <string key="name">ToolTip</string>
+                                               <reference key="object" ref="1023366520"/>
+                                               <string key="toolTip">Move the selected mapping up the list</string>
+                                       </object>
+                               </object>
+                               <string key="893.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                               <string key="894.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                               <object class="NSMutableDictionary" key="896.IBAttributePlaceholdersKey">
+                                       <string key="NS.key.0">ToolTip</string>
+                                       <object class="IBToolTipAttribute" key="NS.object.0">
+                                               <string key="name">ToolTip</string>
+                                               <reference key="object" ref="1043784903"/>
+                                               <string key="toolTip">Move the selected mapping down the list</string>
+                                       </object>
+                               </object>
+                               <string key="896.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                               <string key="897.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                               <string key="92.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+                       </dictionary>
+                       <dictionary class="NSMutableDictionary" key="unlocalizedProperties"/>
+                       <nil key="activeLocalization"/>
+                       <dictionary class="NSMutableDictionary" key="localizations"/>
+                       <nil key="sourceID"/>
+                       <int key="maxID">902</int>
+               </object>
+               <object class="IBClassDescriber" key="IBDocument.Classes">
+                       <array class="NSMutableArray" key="referencedPartialClassDescriptions">
+                               <object class="IBPartialClassDescription">
+                                       <string key="className">EnjoyableApplicationDelegate</string>
+                                       <string key="superclassName">NSObject</string>
+                                       <dictionary class="NSMutableDictionary" key="outlets">
+                                               <string key="dockMenuBase">NSMenu</string>
+                                               <string key="inputController">NJDeviceController</string>
+                                               <string key="mappingsController">NJMappingsController</string>
+                                               <string key="window">NSWindow</string>
+                                       </dictionary>
+                                       <dictionary class="NSMutableDictionary" key="toOneOutletInfosByName">
+                                               <object class="IBToOneOutletInfo" key="dockMenuBase">
+                                                       <string key="name">dockMenuBase</string>
+                                                       <string key="candidateClassName">NSMenu</string>
+                                               </object>
+                                               <object class="IBToOneOutletInfo" key="inputController">
+                                                       <string key="name">inputController</string>
+                                                       <string key="candidateClassName">NJDeviceController</string>
+                                               </object>
+                                               <object class="IBToOneOutletInfo" key="mappingsController">
+                                                       <string key="name">mappingsController</string>
+                                                       <string key="candidateClassName">NJMappingsController</string>
+                                               </object>
+                                               <object class="IBToOneOutletInfo" key="window">
+                                                       <string key="name">window</string>
+                                                       <string key="candidateClassName">NSWindow</string>
+                                               </object>
+                                       </dictionary>
+                                       <object class="IBClassDescriptionSource" key="sourceIdentifier">
+                                               <string key="majorKey">IBProjectSource</string>
+                                               <string key="minorKey">./Classes/EnjoyableApplicationDelegate.h</string>
+                                       </object>
+                               </object>
+                               <object class="IBPartialClassDescription">
+                                       <string key="className">NJDeviceController</string>
+                                       <string key="superclassName">NSObject</string>
+                                       <object class="NSMutableDictionary" key="actions">
+                                               <string key="NS.key.0">translatingEventsChanged:</string>
+                                               <string key="NS.object.0">id</string>
+                                       </object>
+                                       <object class="NSMutableDictionary" key="actionInfosByName">
+                                               <string key="NS.key.0">translatingEventsChanged:</string>
+                                               <object class="IBActionInfo" key="NS.object.0">
+                                                       <string key="name">translatingEventsChanged:</string>
+                                                       <string key="candidateClassName">id</string>
+                                               </object>
+                                       </object>
+                                       <dictionary class="NSMutableDictionary" key="outlets">
+                                               <string key="mappingsController">NJMappingsController</string>
+                                               <string key="outlineView">NSOutlineView</string>
+                                               <string key="outputController">NJOutputController</string>
+                                               <string key="translatingEventsButton">NSButton</string>
+                                               <string key="translatingEventsMenu">NSMenuItem</string>
+                                       </dictionary>
+                                       <dictionary class="NSMutableDictionary" key="toOneOutletInfosByName">
+                                               <object class="IBToOneOutletInfo" key="mappingsController">
+                                                       <string key="name">mappingsController</string>
+                                                       <string key="candidateClassName">NJMappingsController</string>
+                                               </object>
+                                               <object class="IBToOneOutletInfo" key="outlineView">
+                                                       <string key="name">outlineView</string>
+                                                       <string key="candidateClassName">NSOutlineView</string>
+                                               </object>
+                                               <object class="IBToOneOutletInfo" key="outputController">
+                                                       <string key="name">outputController</string>
+                                                       <string key="candidateClassName">NJOutputController</string>
+                                               </object>
+                                               <object class="IBToOneOutletInfo" key="translatingEventsButton">
+                                                       <string key="name">translatingEventsButton</string>
+                                                       <string key="candidateClassName">NSButton</string>
+                                               </object>
+                                               <object class="IBToOneOutletInfo" key="translatingEventsMenu">
+                                                       <string key="name">translatingEventsMenu</string>
+                                                       <string key="candidateClassName">NSMenuItem</string>
+                                               </object>
+                                       </dictionary>
+                                       <object class="IBClassDescriptionSource" key="sourceIdentifier">
+                                               <string key="majorKey">IBProjectSource</string>
+                                               <string key="minorKey">./Classes/NJDeviceController.h</string>
+                                       </object>
+                               </object>
+                               <object class="IBPartialClassDescription">
+                                       <string key="className">NJKeyInputField</string>
+                                       <string key="superclassName">NSTextField</string>
+                                       <object class="NSMutableDictionary" key="outlets">
+                                               <string key="NS.key.0">keyDelegate</string>
+                                               <string key="NS.object.0">id</string>
+                                       </object>
+                                       <object class="NSMutableDictionary" key="toOneOutletInfosByName">
+                                               <string key="NS.key.0">keyDelegate</string>
+                                               <object class="IBToOneOutletInfo" key="NS.object.0">
+                                                       <string key="name">keyDelegate</string>
+                                                       <string key="candidateClassName">id</string>
+                                               </object>
+                                       </object>
+                                       <object class="IBClassDescriptionSource" key="sourceIdentifier">
+                                               <string key="majorKey">IBProjectSource</string>
+                                               <string key="minorKey">./Classes/NJKeyInputField.h</string>
+                                       </object>
+                               </object>
+                               <object class="IBPartialClassDescription">
+                                       <string key="className">NJMappingsController</string>
+                                       <string key="superclassName">NSObject</string>
+                                       <dictionary class="NSMutableDictionary" key="actions">
+                                               <string key="addPressed:">id</string>
+                                               <string key="exportPressed:">id</string>
+                                               <string key="importPressed:">id</string>
+                                               <string key="mappingPressed:">id</string>
+                                               <string key="moveDownPressed:">id</string>
+                                               <string key="moveUpPressed:">id</string>
+                                               <string key="removePressed:">id</string>
+                                       </dictionary>
+                                       <dictionary class="NSMutableDictionary" key="actionInfosByName">
+                                               <object class="IBActionInfo" key="addPressed:">
+                                                       <string key="name">addPressed:</string>
+                                                       <string key="candidateClassName">id</string>
+                                               </object>
+                                               <object class="IBActionInfo" key="exportPressed:">
+                                                       <string key="name">exportPressed:</string>
+                                                       <string key="candidateClassName">id</string>
+                                               </object>
+                                               <object class="IBActionInfo" key="importPressed:">
+                                                       <string key="name">importPressed:</string>
+                                                       <string key="candidateClassName">id</string>
+                                               </object>
+                                               <object class="IBActionInfo" key="mappingPressed:">
+                                                       <string key="name">mappingPressed:</string>
+                                                       <string key="candidateClassName">id</string>
+                                               </object>
+                                               <object class="IBActionInfo" key="moveDownPressed:">
+                                                       <string key="name">moveDownPressed:</string>
+                                                       <string key="candidateClassName">id</string>
+                                               </object>
+                                               <object class="IBActionInfo" key="moveUpPressed:">
+                                                       <string key="name">moveUpPressed:</string>
+                                                       <string key="candidateClassName">id</string>
+                                               </object>
+                                               <object class="IBActionInfo" key="removePressed:">
+                                                       <string key="name">removePressed:</string>
+                                                       <string key="candidateClassName">id</string>
+                                               </object>
+                                       </dictionary>
+                                       <dictionary class="NSMutableDictionary" key="outlets">
+                                               <string key="moveDown">NSButton</string>
+                                               <string key="moveUp">NSButton</string>
+                                               <string key="outputController">NJOutputController</string>
+                                               <string key="popover">NSPopover</string>
+                                               <string key="popoverActivate">NSButton</string>
+                                               <string key="removeButton">NSButton</string>
+                                               <string key="tableView">NSTableView</string>
+                                       </dictionary>
+                                       <dictionary class="NSMutableDictionary" key="toOneOutletInfosByName">
+                                               <object class="IBToOneOutletInfo" key="moveDown">
+                                                       <string key="name">moveDown</string>
+                                                       <string key="candidateClassName">NSButton</string>
+                                               </object>
+                                               <object class="IBToOneOutletInfo" key="moveUp">
+                                                       <string key="name">moveUp</string>
+                                                       <string key="candidateClassName">NSButton</string>
+                                               </object>
+                                               <object class="IBToOneOutletInfo" key="outputController">
+                                                       <string key="name">outputController</string>
+                                                       <string key="candidateClassName">NJOutputController</string>
+                                               </object>
+                                               <object class="IBToOneOutletInfo" key="popover">
+                                                       <string key="name">popover</string>
+                                                       <string key="candidateClassName">NSPopover</string>
+                                               </object>
+                                               <object class="IBToOneOutletInfo" key="popoverActivate">
+                                                       <string key="name">popoverActivate</string>
+                                                       <string key="candidateClassName">NSButton</string>
+                                               </object>
+                                               <object class="IBToOneOutletInfo" key="removeButton">
+                                                       <string key="name">removeButton</string>
+                                                       <string key="candidateClassName">NSButton</string>
+                                               </object>
+                                               <object class="IBToOneOutletInfo" key="tableView">
+                                                       <string key="name">tableView</string>
+                                                       <string key="candidateClassName">NSTableView</string>
+                                               </object>
+                                       </dictionary>
+                                       <object class="IBClassDescriptionSource" key="sourceIdentifier">
+                                               <string key="majorKey">IBProjectSource</string>
+                                               <string key="minorKey">./Classes/NJMappingsController.h</string>
+                                       </object>
+                               </object>
+                               <object class="IBPartialClassDescription">
+                                       <string key="className">NJOutputController</string>
+                                       <string key="superclassName">NSObject</string>
+                                       <dictionary class="NSMutableDictionary" key="actions">
+                                               <string key="mbtnChanged:">id</string>
+                                               <string key="mdirChanged:">id</string>
+                                               <string key="mouseSpeedChanged:">id</string>
+                                               <string key="radioChanged:">id</string>
+                                               <string key="scrollSpeedChanged:">id</string>
+                                               <string key="sdirChanged:">id</string>
+                                       </dictionary>
+                                       <dictionary class="NSMutableDictionary" key="actionInfosByName">
+                                               <object class="IBActionInfo" key="mbtnChanged:">
+                                                       <string key="name">mbtnChanged:</string>
+                                                       <string key="candidateClassName">id</string>
+                                               </object>
+                                               <object class="IBActionInfo" key="mdirChanged:">
+                                                       <string key="name">mdirChanged:</string>
+                                                       <string key="candidateClassName">id</string>
+                                               </object>
+                                               <object class="IBActionInfo" key="mouseSpeedChanged:">
+                                                       <string key="name">mouseSpeedChanged:</string>
+                                                       <string key="candidateClassName">id</string>
+                                               </object>
+                                               <object class="IBActionInfo" key="radioChanged:">
+                                                       <string key="name">radioChanged:</string>
+                                                       <string key="candidateClassName">id</string>
+                                               </object>
+                                               <object class="IBActionInfo" key="scrollSpeedChanged:">
+                                                       <string key="name">scrollSpeedChanged:</string>
+                                                       <string key="candidateClassName">id</string>
+                                               </object>
+                                               <object class="IBActionInfo" key="sdirChanged:">
+                                                       <string key="name">sdirChanged:</string>
+                                                       <string key="candidateClassName">id</string>
+                                               </object>
+                                       </dictionary>
+                                       <dictionary class="NSMutableDictionary" key="outlets">
+                                               <string key="inputController">NJDeviceController</string>
+                                               <string key="keyInput">NJKeyInputField</string>
+                                               <string key="mappingPopup">NSPopUpButton</string>
+                                               <string key="mappingsController">NJMappingsController</string>
+                                               <string key="mouseBtnSelect">NSSegmentedControl</string>
+                                               <string key="mouseDirSelect">NSSegmentedControl</string>
+                                               <string key="mouseSpeedSlider">NSSlider</string>
+                                               <string key="radioButtons">NSMatrix</string>
+                                               <string key="scrollDirSelect">NSSegmentedControl</string>
+                                               <string key="scrollSpeedSlider">NSSlider</string>
+                                               <string key="title">NSTextField</string>
+                                       </dictionary>
+                                       <dictionary class="NSMutableDictionary" key="toOneOutletInfosByName">
+                                               <object class="IBToOneOutletInfo" key="inputController">
+                                                       <string key="name">inputController</string>
+                                                       <string key="candidateClassName">NJDeviceController</string>
+                                               </object>
+                                               <object class="IBToOneOutletInfo" key="keyInput">
+                                                       <string key="name">keyInput</string>
+                                                       <string key="candidateClassName">NJKeyInputField</string>
+                                               </object>
+                                               <object class="IBToOneOutletInfo" key="mappingPopup">
+                                                       <string key="name">mappingPopup</string>
+                                                       <string key="candidateClassName">NSPopUpButton</string>
+                                               </object>
+                                               <object class="IBToOneOutletInfo" key="mappingsController">
+                                                       <string key="name">mappingsController</string>
+                                                       <string key="candidateClassName">NJMappingsController</string>
+                                               </object>
+                                               <object class="IBToOneOutletInfo" key="mouseBtnSelect">
+                                                       <string key="name">mouseBtnSelect</string>
+                                                       <string key="candidateClassName">NSSegmentedControl</string>
+                                               </object>
+                                               <object class="IBToOneOutletInfo" key="mouseDirSelect">
+                                                       <string key="name">mouseDirSelect</string>
+                                                       <string key="candidateClassName">NSSegmentedControl</string>
+                                               </object>
+                                               <object class="IBToOneOutletInfo" key="mouseSpeedSlider">
+                                                       <string key="name">mouseSpeedSlider</string>
+                                                       <string key="candidateClassName">NSSlider</string>
+                                               </object>
+                                               <object class="IBToOneOutletInfo" key="radioButtons">
+                                                       <string key="name">radioButtons</string>
+                                                       <string key="candidateClassName">NSMatrix</string>
+                                               </object>
+                                               <object class="IBToOneOutletInfo" key="scrollDirSelect">
+                                                       <string key="name">scrollDirSelect</string>
+                                                       <string key="candidateClassName">NSSegmentedControl</string>
+                                               </object>
+                                               <object class="IBToOneOutletInfo" key="scrollSpeedSlider">
+                                                       <string key="name">scrollSpeedSlider</string>
+                                                       <string key="candidateClassName">NSSlider</string>
+                                               </object>
+                                               <object class="IBToOneOutletInfo" key="title">
+                                                       <string key="name">title</string>
+                                                       <string key="candidateClassName">NSTextField</string>
+                                               </object>
+                                       </dictionary>
+                                       <object class="IBClassDescriptionSource" key="sourceIdentifier">
+                                               <string key="majorKey">IBProjectSource</string>
+                                               <string key="minorKey">./Classes/NJOutputController.h</string>
+                                       </object>
+                               </object>
+                       </array>
+               </object>
+               <int key="IBDocument.localizationMode">0</int>
+               <string key="IBDocument.TargetRuntimeIdentifier">IBCocoaFramework</string>
+               <bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
+               <int key="IBDocument.defaultPropertyAccessControl">3</int>
+               <dictionary class="NSMutableDictionary" key="IBDocument.LastKnownImageSizes">
+                       <string key="NSAddTemplate">{8, 8}</string>
+                       <string key="NSListViewTemplate">{11, 10}</string>
+                       <string key="NSMenuCheckmark">{11, 11}</string>
+                       <string key="NSMenuMixedState">{10, 3}</string>
+                       <string key="NSRadioButton">{16, 15}</string>
+                       <string key="NSRemoveTemplate">{8, 8}</string>
+                       <string key="NSRightFacingTriangleTemplate">{9, 9}</string>
+               </dictionary>
+       </data>
+</archive>
diff --git a/Resources/Help/Contents/Info.plist b/Resources/Help/Contents/Info.plist
new file mode 100644 (file)
index 0000000..e62b80f
--- /dev/null
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+       <key>CFBundleIdentifier</key>
+       <string>com.yukkurigames.Enjoyable.help</string>
+       <key>CFBundleDevelopmentRegion</key>
+       <string>en_US</string>
+       <key>CFBundleInfoDictionaryVersion</key>
+       <string>6.0</string>
+       <key>CFBundleName</key>
+       <string>Enjoyable</string>
+       <key>CFBundlePackageType</key>
+       <string>BNDL</string>
+       <key>CFBundleShortVersionString</key>
+       <string>1</string>
+       <key>CFBundleSignature</key>
+       <string>hbwr</string>
+       <key>CFBundleVersion</key>
+       <string>1</string>
+       <key>HPDBookAccessPath</key>
+       <string>index.html</string>
+       <key>HPDBookIconPath</key>
+       <string>gfx/Icon.png</string>
+       <key>HPDBookIndexPath</key>
+       <string>Enjoyable.helpindex</string>
+       <key>HPDBookKBProduct</key>
+       <string>enjoyable1</string>
+       <key>HPDBookTitle</key>
+       <string>Enjoyable Help</string>
+       <key>HPDBookType</key>
+       <string>3</string>
+</dict>
+</plist>
diff --git a/Resources/Help/Contents/Resources/English.lproj/Makefile b/Resources/Help/Contents/Resources/English.lproj/Makefile
new file mode 100644 (file)
index 0000000..51a8466
--- /dev/null
@@ -0,0 +1,8 @@
+#!/usr/bin/make -f
+
+HTML := *.html pgs/*.html
+
+all: Enjoyable.helpindex
+
+Enjoyable.helpindex: $(HTML)
+       hiutil -C -f $@ -g -a -s en .
diff --git a/Resources/Help/Contents/Resources/English.lproj/gfx/Icon.png b/Resources/Help/Contents/Resources/English.lproj/gfx/Icon.png
new file mode 100644 (file)
index 0000000..36c4254
Binary files /dev/null and b/Resources/Help/Contents/Resources/English.lproj/gfx/Icon.png differ
diff --git a/Resources/Help/Contents/Resources/English.lproj/index.html b/Resources/Help/Contents/Resources/English.lproj/index.html
new file mode 100644 (file)
index 0000000..1a52296
--- /dev/null
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <title>Enjoyable Help</title>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+    <meta name="AppleTitle" content="com.yukkurigames.Enjoyable.help" />
+    <meta name="AppleIcon" content="gfx/Icon.png" />
+    <meta name="robots" content="anchors" />
+    <link href="sty/default.css" rel="stylesheet" type="text/css" media="all"/>
+  </head>
+  
+  <body>
+    <a name="home"></a>
+    
+    <div id="navbox">
+      <div id="navrightbox">
+      </div>
+    </div>
+    
+    <div id="headerbox">
+      <div id="iconbox">
+        <img id="iconimg" src="gfx/Icon.png" alt="Enjoyable Icon" height="32" width="32"/>
+      </div>
+      <div id="pagetitlebox">
+        <h1>Enjoyable Help</h1>
+      </div>
+    </div>
+    
+    <p style="margin-bottom: 2em">
+      Enjoyable helps you use a joystick or gamepad to control
+      applications which normally require a keyboard and mouse.
+    </p>
+
+    <div style="display: table-cell; width: 40%; padding-right: 1em">
+      <h3>Quick Start</h3>
+      <ul>
+        <li>Connect a joystick or gamepad.</li>
+        <li>Press a button on it, then the keyboard key you want to use.</li>
+        <li>Press the ▶ button in the upper-right.</li>
+        <li>Start up your game and use your gamepad!</li>
+      </ol>
+    </div>
+
+    <div style="display: table-cell; width: 60%; border-left: solid #666 1px; padding-left: 1em; margin-top: 1em">
+      <p>
+        <a href="help:anchor='keyboard' bookID='com.yukkurigames.Enjoyable.help'">
+          Keyboard Events
+        </a><br />
+        Map buttons to keys on a keyboard.
+      </p>
+      <p>
+        <a href="help:anchor='mouse' bookID='com.yukkurigames.Enjoyable.help'">
+          Mouse Events
+        </a><br />
+        Use axes and buttons to simulate a mouse.
+      </p>
+      <p>
+        <a href="help:anchor='mappings' bookID='com.yukkurigames.Enjoyable.help'">
+          Application Mappings
+        </a><br />
+        Create and share mappings for different applications.
+      </p>
+      <p>
+        <a href="help:anchor='problems' bookID='com.yukkurigames.Enjoyable.help'">
+          Troubleshooting
+        </a><br />
+        Assistance for common problems.
+      </p>
+    </div>
+
+    <p style="border-top: #777 solid 1px; text-align: center; margin-top: 2em">
+      <a class="weblink" href="help:anchor='boring' bookID='com.yukkurigames.Enjoyable.help'">
+        license</a>
+      -
+      <a class="weblink" href="http://yukkurigames.com/enjoyable">
+        website</a>
+    </p>
+
+  </body>
+</html>
diff --git a/Resources/Help/Contents/Resources/English.lproj/pgs/boring.html b/Resources/Help/Contents/Resources/English.lproj/pgs/boring.html
new file mode 100644 (file)
index 0000000..45c6719
--- /dev/null
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <title>License &amp; Copyright</title>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+    <link href="../sty/default.css"
+          rel="stylesheet"
+          type="text/css"
+          media="all"/>
+  </head>
+  
+  <body>
+    <a name="boring"></a>
+    
+    <div id="navbox">
+      <div id="navleftbox">
+        <a class="navlink_left"
+           href="help:anchor='home' bookID='com.yukkurigames.Enjoyable.help'">
+          Home
+        </a>
+      </div>
+    </div>
+    
+    <div id="headerbox">
+      <div id="iconbox">
+        <img id="iconimg"
+             src="../gfx/Icon.png"
+             alt="Icon"
+             height="32" width="32"/>
+      </div>
+      <h1>License &amp; Copyright</h1>
+    </div>
+
+    <h3><a name="copyright"></a>Copyright</h3>
+    <p>
+      2013 Joe Wreschnig<br />
+      2012 Yifeng Huang<br />
+      2009 Sam McCall &amp; the University of Otago
+    </p>
+
+    <h3><a name="license"></a>License</h3>
+    <p>
+      Permission is hereby granted, free of charge, to any person
+      obtaining a copy of this software and associated documentation
+      files (the "Software"), to deal in the Software without
+      restriction, including without limitation the rights to use,
+      copy, modify, merge, publish, distribute, sublicense, and/or
+      sell copies of the Software, and to permit persons to whom the
+      Software is furnished to do so, subject to the following
+      conditions:
+    </p>
+    <p>
+      The above copyright notice and this permission notice shall be
+      included in all copies or substantial portions of the Software.
+    </p>
+    <p>
+      THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+      EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+      OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+      NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+      HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+      WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+      FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+      OTHER DEALINGS IN THE SOFTWARE.
+    </p>
+    <p>
+      The joystick icon is from the Tango icon set and is public
+      domain.
+    </p>
+  </body>
+</html>
diff --git a/Resources/Help/Contents/Resources/English.lproj/pgs/keyboard.html b/Resources/Help/Contents/Resources/English.lproj/pgs/keyboard.html
new file mode 100644 (file)
index 0000000..dca6136
--- /dev/null
@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <title>Keyboard Events</title>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+    <link href="../sty/default.css"
+          rel="stylesheet"
+          type="text/css"
+          media="all"/>
+  </head>
+  
+  <body>
+    <a name="keyboard"></a>
+    
+    <div id="navbox">
+      <div id="navleftbox">
+        <a class="navlink_left"
+           href="help:anchor='home' bookID='com.yukkurigames.Enjoyable.help'">
+          Home
+        </a>
+      </div>
+    </div>
+    
+    <div id="headerbox">
+      <div id="iconbox">
+        <img id="iconimg"
+             src="../gfx/Icon.png"
+             alt="Enjoyable Icon"
+             height="32" width="32"/>
+      </div>
+      <h1>Keyboard Events</h1>
+    </div>
+
+    <p>
+      Enjoyable supports mapping joystick buttons, hat switches, and
+      axis thresholds to simulate keyboard keys. First disable
+      mapping by deactivating the ▶ button in the top left. Then press
+      the button on the joystick you want to map. This will select it
+      on the left-hand side of the screen.
+    </p>
+
+    <p>
+      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 <b>Press a
+      key</b> label or input field, then press the key.
+    </p>
+
+    <p>
+      To change a key without disabling mapping you can choose the
+      input's entry in the sidebar directly.
+    </p>
+
+    <h3><a name="clear_key"></a>Clearing the Selection</h3>
+    <p>
+      To clear a mapped key either select the <b>Do nothing</b>
+      option or press ⌥⌫ when the key input field is selected.
+    </p>
+
+    <h3><a name="cancel_key"></a>Cancelling the Selection</h3>
+    <p>
+      If you select the key input field by mistake you can press ⌥⎋
+      to cancel the selection without changing the current setting.
+    </p>
+  </body>
+</html>
diff --git a/Resources/Help/Contents/Resources/English.lproj/pgs/mappings.html b/Resources/Help/Contents/Resources/English.lproj/pgs/mappings.html
new file mode 100644 (file)
index 0000000..3b181ff
--- /dev/null
@@ -0,0 +1,98 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <title>Application Mappings</title>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+    <link href="../sty/default.css"
+          rel="stylesheet"
+          type="text/css"
+          media="all"/>
+  </head>
+  
+  <body>
+    <a name="mappings"></a>
+    
+    <div id="navbox">
+      <div id="navleftbox">
+        <a class="navlink_left"
+           href="help:anchor='home' bookID='com.yukkurigames.Enjoyable.help'">
+          Home
+        </a>
+      </div>
+    </div>
+    
+    <div id="headerbox">
+      <div id="iconbox">
+        <img id="iconimg"
+             src="../gfx/Icon.png"
+             alt="Icon"
+             height="32" width="32"/>
+      </div>
+      <h1>Application Mappings</h1>
+    </div>
+
+    <p>
+      You can make many different mappings and switch between them
+      easily.  To open the list of mappings click the button at the
+      top-left or press ⌘L.
+    </p>
+
+    <p>
+      Click on a mapping to switch to it. Create a new mapping with
+      the + button or pressing ⌘N. Delete the current mapping with
+      the - button or ⌘⌫. Rename a mapping by double-clicking on it or
+      pressing Return while it's selected.
+    </p>
+
+    <p>
+      You can also switch mappings with the <b>Mappings</b> menu, with
+      Enjoyable's dock menu, or by pressing ⌘1 through ⌘9.
+    </p>
+
+    <p>
+      Switching mappings can also be mapped to an input. Select the
+      input you wish to use and then choose a mapping from
+      the <b>Switch to mapping</b> option. For example, you could have
+      one mapping for a game's menu and another for its main screen
+      and switch between them in-game without returning to Enjoyable.
+    </p>
+
+    <h3><a name="automatic"></a>Automatic Switching</h3>
+    <p>
+      If you name a mapping after an application it will be
+      automatically chosen when you switch to that application. The
+      name of an application is usually shown on the dock when you
+      hover your mouse over it. If you don't know the name of the
+      application you want to create a mapping for, create a mapping
+      with the name <kbd>@Application</kbd> (note the <kbd>@</kbd> at
+      the start). The mapping will automatically be renamed for the
+      next application you switch to while it's enabled.
+    </p>
+
+    <h3><a name="sharing"></a>Import and Export</h3>
+    <p>
+      Mappings can be exported and shared with other people. To export
+      your current mapping choose <b>Mappings > Export…</b> and pick a
+      location to save the file. This file can be shared with anyone;
+      it doesn't contain any personal information other than the
+      product IDs of the input devices you used and what you mapped
+      them to.
+    </p>
+    <p>
+      To import a mapping choose <b>Mappings > Import…</b> and select
+      the file you want to import. Mapping files end
+      with <kbd>.enjoyable</kbd> (the default), <kbd>.json</kbd>,
+      or <kbd>.txt</kbd>. If the imported mapping conflicts with one
+      you already made, you can choose to merge the two mappings or
+      create a new one with the same name.
+    </p>
+    <p>
+      You can also import mappings by opening them in Finder or
+      dragging the files onto the mapping list. Similarly, you can
+      export mappings by dragging them from the mapping list to
+      Finder.
+    </p>
+    </body>
+</html>
diff --git a/Resources/Help/Contents/Resources/English.lproj/pgs/mouse.html b/Resources/Help/Contents/Resources/English.lproj/pgs/mouse.html
new file mode 100644 (file)
index 0000000..0293fd0
--- /dev/null
@@ -0,0 +1,102 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <title>Mouse Events</title>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+    <link href="../sty/default.css"
+          rel="stylesheet"
+          type="text/css"
+          media="all"/>
+  </head>
+  
+  <body>
+    <a name="mouse"></a>
+    
+    <div id="navbox">
+      <div id="navleftbox">
+        <a class="navlink_left"
+           href="help:anchor='home' bookID='com.yukkurigames.Enjoyable.help'">
+          Home
+        </a>
+      </div>
+    </div>
+    
+    <div id="headerbox">
+      <div id="iconbox">
+        <img id="iconimg"
+             src="../gfx/Icon.png"
+             alt="Icon"
+             height="32" width="32"/>
+      </div>
+      <h1>Mouse Events</h1>
+    </div>
+
+    <p>
+      You can use Enjoyable to map input to mouse buttons, moving, and
+      scrolling.
+    </p>
+
+    <h3>Movement</h3>
+    <p>
+      Select the direction you'd like the input to move the
+      mouse. Adjust the movement speed using the slider underneath.  If
+      you are mapping an analog input then this is the maximum speed;
+      for a button it's a constant speed.
+    </p>
+    <p>
+      The speed is set independently for each input. You can have
+      faster horizontal movement than vertical movement, or map one
+      set of inputs to a fast speed and another set to a slow
+      speed.
+    </p>
+
+    <h3>Buttons</h3>
+    <p>
+      Select the mouse button you'd like the input to simulate.
+    </p>
+
+    <h3><a name="scrolling"></a>Scrolling</h3>
+    <p>
+      Simulated scrolling can be continuous like the scrolling
+      gestures on a trackpad, or discrete like a mouse wheel that
+      clicks as you spin it.
+    </p>
+    <p>
+      To use <em>continuous scrolling</em> choose ↑ or ↓. Use the
+      slider underneath them to adjust the scrolling speed. If you are
+      mapping an analog input then this is the maximum speed; for a
+      button it's a constant speed.
+    <p>
+      To use <em>discrete scrolling</em> choose ⤒ or ⤓. The input
+      will trigger scrolling up or down by exactly one line and stop,
+      regardless of how long you hold the button down or how far
+      you move an analog input.
+    </p>
+    <p>
+      The arrows indicate the direction you would spin a mouse wheel
+      or move your fingers. Depending on settings this may mean you
+      need to choose a down arrow to scroll up and vice versa. You can
+      also change this globally in <b> > System Preferences… >
+      Mouse</b> and <b> > System Preferences… > Trackpad</b>.
+    </p>
+    
+    <h3><a name="mouseissues"></a>Known Issues</h3>
+    <p>
+      Mouse events are more fragile than keyboard ones. While Enjoyble
+      will work fine for most games, regular OS X (Cocoa) applications
+      require specially formatted mouse events. Features such as
+      click-and-drag or double-clicking will not work correctly, so
+      many applications will behave incorrectly if driven by an
+      Enjoyable simulated mouse.
+    </p>
+    <p>
+      If you find a non-Cocoa application that has problems with
+      Enjoyable's mouse
+      support <a href="https://github.com/joewreschnig/enjoyable/issues">please
+      file a ticket in the issue tracker</a>.
+    </p>
+    
+  </body>
+</html>
diff --git a/Resources/Help/Contents/Resources/English.lproj/pgs/problems.html b/Resources/Help/Contents/Resources/English.lproj/pgs/problems.html
new file mode 100644 (file)
index 0000000..8f3aa68
--- /dev/null
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <title>Troubleshooting</title>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+    <link href="../sty/default.css"
+          rel="stylesheet"
+          type="text/css"
+          media="all"/>
+  </head>
+  
+  <body>
+    <a name="problems"></a>
+    
+    <div id="navbox">
+      <div id="navleftbox">
+        <a class="navlink_left"
+           href="help:anchor='home' bookID='com.yukkurigames.Enjoyable.help'">
+          Home
+        </a>
+      </div>
+    </div>
+    
+    <div id="headerbox">
+      <div id="iconbox">
+        <img id="iconimg"
+             src="../gfx/Icon.png"
+             alt="Icon"
+             height="32" width="32"/>
+      </div>
+      <h1>Troubleshooting</h1>
+    </div>
+
+    <h3>
+      <a name="unavailable"></a>
+      When I start Enjoyable, it says "Input devices are unavailable"
+    </h3>
+    <p>
+      This happens if Enjoyable is refused access to your input
+      devices by Mac OS X. This usually happens if another application
+      has requested exclusive access to them. Try quitting any other
+      applications using your input devices. If that doesn't work, try
+      disconnecting and reconnecting the device, then restarting
+      Enjoyable. If it still doesn't work you may need to reboot.
+    </p>
+
+    <h3>
+      <a name="noswitch"></a>
+      Enjoyable never switches to my application mapping
+    </h3>
+    <p>
+      Make sure it matches the name of the application exactly. If you
+      still have trouble, name the mapping <kbd>@Application</kbd> and
+      switch back to have Enjoyable try to deduce the correct name
+      automatically.
+    </p>
+
+    <h3>
+      Mouse clicks and drags don't work
+      <a name="brokenmouse"></a>
+    </h3>
+    <p>
+      This is a known issue with Cocoa applications, as they require
+      more specially-crafted mouse events. We hope to fix it in a
+      future version.
+    </p>
+  </body>
+</html>
diff --git a/Resources/Help/Contents/Resources/English.lproj/sty/default.css b/Resources/Help/Contents/Resources/English.lproj/sty/default.css
new file mode 100644 (file)
index 0000000..58b7747
--- /dev/null
@@ -0,0 +1 @@
+body {\r    font-size: 8pt;\r    font-family: "Lucida Grande", Arial, sans-serif;\r    line-height: 12pt;\r    text-decoration: none;\r    margin-right: 1em;\r    margin-left: 1em;\r}\r\r#navbox { \r    background-color: #f2f2f2; \r    position: fixed;\r    top: 0; \r    left: 0; \r    width: 100%; \r    height: 1.5em; \r    float: left; \r    border-bottom: 1px solid #bfbfbf\r}\r\r#navleftbox { \r    position: absolute; \r    top: 1px; \r    left: 15px \r}\r\r#navrightbox { \r    background-color: #f2f2f2; \r    padding-right: 25px; \r    float: right; \r    padding-bottom: 1px; \r    border-left: 1px solid #bfbfbf\r}\r\r#navbox a {\r    font-size: 8pt;\r    color: #666;\r    font-weight: normal;\r    margin: -9px 0 -6px;\r}\r\r#headerbox {\r    margin-top: 36px;\r    padding-right: 6px;\r    margin-bottom: 2em;\r}\r\r#iconbox {\r    float: left;\r}\r\rh1 {\r    margin-left: 40px;\r    width: 88%;\r    font-size: 15pt;\r    line-height: 15pt;\r    font-weight: bold;\r    padding-top: 6px;\r    margin-bottom: 0;\r}\r\rh2 {\r    font-size: 11pt;\r    line-height: 12pt;\r    font-weight: bold;\r    color: black;\r    margin-top: 0;\r    margin-bottom: 11px;\r}\r\rh3 {\r    font-size: 8pt;\r    font-weight: bold;\r    letter-spacing: 0.1em;\r    line-height: 8pt;\r    color: #666;\r    margin-top: 1em;\r    margin-bottom: 0px;\r    padding-bottom: 0.5em;\r}\r\rp {\r    margin-left: 0px;\r    margin-top: 0px;\r    margin-bottom: 0.5em;\r}\r\rul {\r    margin-left: 2em;\r    margin-top: 6px;\r    margin-bottom: 0px;\r    padding-left: 0px;\r}\r\rli {\r    margin-left: 0px;\r}\r\ra {\r    color: #778fbd;\r    font-size: 9pt;\r    font-weight: bold;\r    text-decoration: none;\r}\r\ra:hover {\r    text-decoration: underline;\r}\r\r.weblink {\r    color: #666;\r    font-weight: normal;\r}\r
\ No newline at end of file
diff --git a/Resources/Icon.icns b/Resources/Icon.icns
new file mode 100644 (file)
index 0000000..c7e3f36
Binary files /dev/null and b/Resources/Icon.icns differ
diff --git a/Resources/com.yukkurigames.Enjoyable.mapping.icns b/Resources/com.yukkurigames.Enjoyable.mapping.icns
new file mode 100644 (file)
index 0000000..027b5e2
Binary files /dev/null and b/Resources/com.yukkurigames.Enjoyable.mapping.icns differ
diff --git a/com.yukkurigames.Enjoyable.mapping.icns b/com.yukkurigames.Enjoyable.mapping.icns
deleted file mode 100644 (file)
index 027b5e2..0000000
Binary files a/com.yukkurigames.Enjoyable.mapping.icns and /dev/null differ
diff --git a/icon.icns b/icon.icns
deleted file mode 100644 (file)
index c7e3f36..0000000
Binary files a/icon.icns and /dev/null differ
diff --git a/main.m b/main.m
deleted file mode 100644 (file)
index 9fbf37b..0000000
--- a/main.m
+++ /dev/null
@@ -1,13 +0,0 @@
-//
-//  main.m
-//  Enjoy
-//
-//  Created by Sam McCall on 4/05/09.
-//
-
-#import <Cocoa/Cocoa.h>
-
-int main(int argc, char *argv[])
-{
-    return NSApplicationMain(argc,  (const char **) argv);
-}