From d4ffd217288cfc0d2798b3df67ab20bc867a7f7e Mon Sep 17 00:00:00 2001 From: Dominik Pich Date: Sun, 17 Mar 2013 13:33:20 +0100 Subject: DDHIDLib 1.1.1 --- device_test/AppleMikeyPaneController.h | 62 + device_test/AppleMikeyPaneController.m | 160 + device_test/AppleRemote.tiff | Bin 0 -> 90050 bytes device_test/AppleRemotePaneController.h | 51 + device_test/AppleRemotePaneController.m | 145 + device_test/BoolFormatter.h | 35 + device_test/BoolFormatter.m | 82 + device_test/ButtonState.h | 38 + device_test/ButtonState.m | 77 + device_test/DeviceTestController.h | 35 + device_test/DeviceTestController.m | 49 + device_test/English.lproj/InfoPlist.strings | Bin 0 -> 190 bytes .../English.lproj/MainMenu.nib/designable.nib | 5311 ++++++++++++++++++++ .../English.lproj/MainMenu.nib/keyedobjects.nib | Bin 0 -> 46512 bytes device_test/Info.plist | 26 + device_test/JoystickPaneController.h | 72 + device_test/JoystickPaneController.m | 174 + device_test/KeyboardPaneController.h | 64 + device_test/KeyboardPaneController.m | 179 + device_test/MousePaneController.h | 68 + device_test/MousePaneController.m | 211 + device_test/RemoteFeedbackView.h | 42 + device_test/RemoteFeedbackView.m | 162 + device_test/main.m | 30 + 24 files changed, 7073 insertions(+) create mode 100644 device_test/AppleMikeyPaneController.h create mode 100644 device_test/AppleMikeyPaneController.m create mode 100644 device_test/AppleRemote.tiff create mode 100644 device_test/AppleRemotePaneController.h create mode 100644 device_test/AppleRemotePaneController.m create mode 100644 device_test/BoolFormatter.h create mode 100644 device_test/BoolFormatter.m create mode 100644 device_test/ButtonState.h create mode 100644 device_test/ButtonState.m create mode 100644 device_test/DeviceTestController.h create mode 100644 device_test/DeviceTestController.m create mode 100644 device_test/English.lproj/InfoPlist.strings create mode 100644 device_test/English.lproj/MainMenu.nib/designable.nib create mode 100644 device_test/English.lproj/MainMenu.nib/keyedobjects.nib create mode 100644 device_test/Info.plist create mode 100644 device_test/JoystickPaneController.h create mode 100644 device_test/JoystickPaneController.m create mode 100644 device_test/KeyboardPaneController.h create mode 100644 device_test/KeyboardPaneController.m create mode 100644 device_test/MousePaneController.h create mode 100644 device_test/MousePaneController.m create mode 100644 device_test/RemoteFeedbackView.h create mode 100644 device_test/RemoteFeedbackView.m create mode 100644 device_test/main.m (limited to 'device_test') diff --git a/device_test/AppleMikeyPaneController.h b/device_test/AppleMikeyPaneController.h new file mode 100644 index 0000000..28f6fc1 --- /dev/null +++ b/device_test/AppleMikeyPaneController.h @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2007 Dave Dribin + * + * 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: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * 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. + */ + +#import + + +@class DDHidAppleMikey; + +@interface AppleMikeyPaneController : NSObject +{ + IBOutlet NSArrayController * mMikeysController; + IBOutlet NSArrayController * mMikeysEventsController; + + NSArray * mMikeys; + unsigned mMikeyIndex; + NSMutableArray * mEvents; + + // Don't retain these + DDHidAppleMikey * mCurrentMikey; +} + +- (NSArray *) mMikeys; +- (void) setMikeys: (NSArray *) theMikeys; + +- (unsigned) mikeyIndex; +- (void) setMikeyIndex: (unsigned) theMikeyIndex; + +- (NSMutableArray *) events; +- (void) setEvents: (NSMutableArray *) theEvents; +- (void) addEvent: (id)theEvent; +- (void) removeEvent: (id)theEvent; + +@end + +@interface AppleMikeyPaneController (DDHidAppleMikeyDelegate) + +- (void) ddhidAppleMikey: (DDHidAppleMikey *) mikey + press: (unsigned) usageId + upOrDown:(BOOL)upOrDown; + +@end diff --git a/device_test/AppleMikeyPaneController.m b/device_test/AppleMikeyPaneController.m new file mode 100644 index 0000000..0760688 --- /dev/null +++ b/device_test/AppleMikeyPaneController.m @@ -0,0 +1,160 @@ +/* + * Copyright (c) 2007 Dave Dribin + * + * 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: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * 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. + */ + +#import "AppleMikeyPaneController.h" +#import "DDHidLib.h" +#include + +@implementation AppleMikeyPaneController + +- (id) init; +{ + self = [super init]; + if (self == nil) + return nil; + + mEvents = [[NSMutableArray alloc] init]; + + return self; +} + +- (void) awakeFromNib; +{ + NSArray * mikeys = [DDHidAppleMikey allMikeys]; + + [mikeys makeObjectsPerformSelector: @selector(setDelegate:) + withObject: self]; + [self setMikeys: mikeys]; + + if ([mikeys count] > 0) + [self setMikeyIndex: 0]; + else + [self setMikeyIndex: NSNotFound]; +} + +//=========================================================== +// dealloc +//=========================================================== +- (void) dealloc +{ + [mMikeys release]; + [mEvents release]; + + mMikeys = nil; + mEvents = nil; + [super dealloc]; +} + +//=========================================================== +// mikeys +//=========================================================== +- (NSArray *) mikeys +{ + return mMikeys; +} + +- (void) setMikeys: (NSArray *) theMikeys +{ + if (mMikeys != theMikeys) + { + [mMikeys release]; + mMikeys = [theMikeys retain]; + } +} +//=========================================================== +// mikeyIndex +//=========================================================== +- (unsigned) mikeyIndex +{ + return mMikeyIndex; +} + +- (void) setMikeyIndex: (unsigned) theMikeyIndex +{ + if (mCurrentMikey != nil) + { + [mCurrentMikey stopListening]; + mCurrentMikey = nil; + } + mMikeyIndex = theMikeyIndex; + [mMikeysController setSelectionIndex: mMikeyIndex]; + [self willChangeValueForKey: @"events"]; + [mEvents removeAllObjects]; + [self didChangeValueForKey: @"events"]; + if (mMikeyIndex != NSNotFound) + { + mCurrentMikey = [mMikeys objectAtIndex: mMikeyIndex]; + [mCurrentMikey startListening]; + } +} + +//=========================================================== +// events +//=========================================================== +- (NSMutableArray *) events +{ + return mEvents; +} + +- (void) setEvents: (NSMutableArray *) theEvents +{ + if (mEvents != theEvents) + { + [mEvents release]; + mEvents = [theEvents retain]; + } +} +- (void) addEvent: (id)theEvent +{ + [[self events] addObject: theEvent]; +} +- (void) removeEvent: (id)theEvent +{ + [[self events] removeObject: theEvent]; +} + +@end + +@implementation AppleMikeyPaneController (DDHidAppleMikeyDelegate) + +- (void) ddhidAppleMikey:(DDHidAppleMikey *)mikey press:(unsigned int)usageId upOrDown:(BOOL)upOrDown +{ + NSString *usage = nil; + if(usageId==kHIDUsage_GD_SystemMenuDown) { + usage = @"MenuDown"; + } + else if(usageId == kHIDUsage_GD_SystemMenuUp) { + usage = @"MenuUp"; + } + + if(!usage) + return; + + NSMutableDictionary * row = [mMikeysEventsController newObject]; + [row setObject: upOrDown ? @"Down" : @"Up" forKey: @"event"]; + [row setObject:usage forKey: @"description"]; + [mMikeysEventsController addObject: row]; +} + +@end diff --git a/device_test/AppleRemote.tiff b/device_test/AppleRemote.tiff new file mode 100644 index 0000000..7e002ca Binary files /dev/null and b/device_test/AppleRemote.tiff differ diff --git a/device_test/AppleRemotePaneController.h b/device_test/AppleRemotePaneController.h new file mode 100644 index 0000000..ca4a9e9 --- /dev/null +++ b/device_test/AppleRemotePaneController.h @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2007 Dave Dribin + * + * 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: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * 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. + */ + +#import +#import "DDHidLib.h" + +@class DDHidAppleRemote; +@class RemoteFeedbackView; + +@interface AppleRemotePaneController : NSObject +{ + IBOutlet NSButton * mStartStopButton; + IBOutlet RemoteFeedbackView * mFeedbackView; + IBOutlet NSTextField * mFeedbackText; + + DDHidAppleRemote * mRemote; + BOOL mOpenInExclusiveMode; +} + +- (DDHidAppleRemote *) remote; + +- (IBAction) toggleListening: (id) sender; + +- (BOOL) openInExclusiveMode; +- (void) setOpenInExclusiveMode: (BOOL) flag; + +- (void) ddhidAppleRemoteButton: (DDHidAppleRemoteEventIdentifier) buttonIdentifier + pressedDown: (BOOL) pressedDown; + +@end diff --git a/device_test/AppleRemotePaneController.m b/device_test/AppleRemotePaneController.m new file mode 100644 index 0000000..7cbaf52 --- /dev/null +++ b/device_test/AppleRemotePaneController.m @@ -0,0 +1,145 @@ +/* + * Copyright (c) 2007 Dave Dribin + * + * 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: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * 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. + */ + +#import "AppleRemotePaneController.h" +#import "RemoteFeedbackView.h" + +@implementation AppleRemotePaneController + +- (void) awakeFromNib; +{ + [self willChangeValueForKey: @"remote"]; + mRemote = [[DDHidAppleRemote firstRemote] retain]; + [self didChangeValueForKey: @"remote"]; + + [mRemote setDelegate: self]; + [self setOpenInExclusiveMode: YES]; +} + +//=========================================================== +// dealloc +//=========================================================== +- (void) dealloc +{ + [mRemote release]; + + mRemote = nil; + [super dealloc]; +} + +- (DDHidAppleRemote *) remote; +{ + return mRemote; +} + +- (IBAction) toggleListening: (id) sender; +{ + NSAssert(mRemote != nil, @"Remote is nil"); + + if ([mRemote isListening]) + { + [mRemote stopListening]; + [mStartStopButton setTitle: @"Start Listening"]; + } + else + { + [mRemote setListenInExclusiveMode: mOpenInExclusiveMode]; + [mRemote startListening]; + [mStartStopButton setTitle: @"Stop Listening"]; + } +} + +//=========================================================== +// openInExclusiveMode +//=========================================================== +- (BOOL) openInExclusiveMode +{ + return mOpenInExclusiveMode; +} + +- (void) setOpenInExclusiveMode: (BOOL) flag +{ + mOpenInExclusiveMode = flag; +} + +- (void) ddhidAppleRemoteButton: (DDHidAppleRemoteEventIdentifier) buttonIdentifier + pressedDown: (BOOL) pressedDown; +{ + NSString * buttonName= nil; + NSString * pressed = @""; + + switch(buttonIdentifier) + { + case kDDHidRemoteButtonVolume_Plus: + buttonName = @"Volume up"; + if (pressedDown) pressed = @"(down)"; else pressed = @"(up)"; + break; + case kDDHidRemoteButtonVolume_Minus: + buttonName = @"Volume down"; + if (pressedDown) pressed = @"(down)"; else pressed = @"(up)"; + break; + case kDDHidRemoteButtonMenu: + buttonName = @"Menu"; + break; + case kDDHidRemoteButtonPlay: + buttonName = @"Play"; + break; + case kDDHidRemoteButtonRight: + buttonName = @"Right"; + break; + case kDDHidRemoteButtonLeft: + buttonName = @"Left"; + break; + case kDDHidRemoteButtonRight_Hold: + buttonName = @"Right holding"; + if (pressedDown) pressed = @"(down)"; else pressed = @"(up)"; + break; + case kDDHidRemoteButtonLeft_Hold: + buttonName = @"Left holding"; + if (pressedDown) pressed = @"(down)"; else pressed = @"(up)"; + break; + case kDDHidRemoteButtonPlay_Sleep: + buttonName = @"Play (sleep mode)"; + break; + case kDDHidRemoteButtonMenu_Hold: + buttonName = @"Menu (long)"; + break; + case kDDHidRemoteControl_Switched: + buttonName = @"Remote Control Switched"; + break; + case kDDHidRemoteControl_Paired: + buttonName = @"Remote Control Paired"; + break; + default: + NSLog(@"Unmapped event for button %d", buttonIdentifier); + break; + } + [mFeedbackText setStringValue:[NSString stringWithFormat:@"%@ %@", + buttonName, pressed]]; + + [mFeedbackView ddhidAppleRemoteButton: buttonIdentifier + pressedDown: pressedDown]; +} + +@end diff --git a/device_test/BoolFormatter.h b/device_test/BoolFormatter.h new file mode 100644 index 0000000..79661cb --- /dev/null +++ b/device_test/BoolFormatter.h @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2007 Dave Dribin + * + * 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: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * 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. + */ + +#import + + +@interface BoolFormatter : NSFormatter +{ + id labels; +} + +- (id)initWithLables:(id)_l; + +@end diff --git a/device_test/BoolFormatter.m b/device_test/BoolFormatter.m new file mode 100644 index 0000000..7f302f9 --- /dev/null +++ b/device_test/BoolFormatter.m @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2007 Dave Dribin + * + * 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: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * 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. + */ + +#import "BoolFormatter.h" + + +@implementation BoolFormatter + +- (id)initWithLables:(id)_l { + if ((self = [super init]) != nil) { + self->labels = [_l retain]; + } + return self; +} + +- (void)dealloc { + [self->labels release]; + [super dealloc]; +} + +- (BOOL) boolForObjectValue: (id) object +{ + BOOL result; + if ([object respondsToSelector: @selector(boolValue)]) + result = [object boolValue] ? YES : NO; + else + result = NO; + return result; +} + +- (NSString *)stringForObjectValue:(id)_obj +{ + NSString *str; + + if ([self boolForObjectValue: _obj]) + str = @"Yes"; + else + str = @"No"; + + return (self->labels != nil) + ? (NSString *)[self->labels valueForKey:str] : str; +} + +- (NSAttributedString *)attributedStringForObjectValue:(id)anObject + withDefaultAttributes:(NSDictionary *)defaultAttributes +{ + NSDictionary * yesAttributes = [NSDictionary dictionaryWithObjectsAndKeys: + [NSColor redColor], NSBackgroundColorAttributeName, + nil]; + NSDictionary * attributes = defaultAttributes; + if ([self boolForObjectValue: anObject]) + attributes = yesAttributes; + + NSAttributedString * string = + [[NSAttributedString alloc] initWithString: [self stringForObjectValue: anObject] + attributes: attributes]; + [string autorelease]; + return string; +} + +@end diff --git a/device_test/ButtonState.h b/device_test/ButtonState.h new file mode 100644 index 0000000..63bde74 --- /dev/null +++ b/device_test/ButtonState.h @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2007 Dave Dribin + * + * 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: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * 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. + */ + +#import + +@interface ButtonState : NSObject +{ + NSString * mName; + BOOL mPressed; +} + +- (NSString *) name; + +- (BOOL) pressed; +- (void) setPressed: (BOOL) flag; + +@end diff --git a/device_test/ButtonState.m b/device_test/ButtonState.m new file mode 100644 index 0000000..d093b52 --- /dev/null +++ b/device_test/ButtonState.m @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2007 Dave Dribin + * + * 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: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * 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. + */ + +#import "ButtonState.h" + +@implementation ButtonState + +- (id) initWithName: (NSString *) name +{ + self = [super init]; + if (self == nil) + return nil; + + mName = [name retain]; + mPressed = NO; + + return self; +} + +//=========================================================== +// dealloc +//=========================================================== +- (void) dealloc +{ + [mName release]; + + mName = nil; + [super dealloc]; +} + +//=========================================================== +// - name +//=========================================================== +- (NSString *) name +{ + return mName; +} + +//=========================================================== +// - pressed +//=========================================================== +- (BOOL) pressed +{ + return mPressed; +} + +//=========================================================== +// - setPressed: +//=========================================================== +- (void) setPressed: (BOOL) flag +{ + mPressed = flag; +} + +@end + diff --git a/device_test/DeviceTestController.h b/device_test/DeviceTestController.h new file mode 100644 index 0000000..bb03cf1 --- /dev/null +++ b/device_test/DeviceTestController.h @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2007 Dave Dribin + * + * 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: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * 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. + */ + +#import + +@class MousePaneController; + +@interface DeviceTestController : NSObject +{ + IBOutlet NSWindow * mWindow; + IBOutlet MousePaneController * mMousePaneController; +} + +@end diff --git a/device_test/DeviceTestController.m b/device_test/DeviceTestController.m new file mode 100644 index 0000000..58d0f91 --- /dev/null +++ b/device_test/DeviceTestController.m @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2007 Dave Dribin + * + * 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: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * 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. + */ + +#import "DeviceTestController.h" + +static BOOL sSleepAtExit = NO; + +static void exit_sleeper() +{ + while (sSleepAtExit) sleep(60); +} + +@implementation DeviceTestController + +- (void) awakeFromNib +{ + sSleepAtExit = [[NSUserDefaults standardUserDefaults] boolForKey: @"SleepAtExit"]; + atexit(exit_sleeper); + + [mWindow center]; + [mWindow makeKeyAndOrderFront: self]; +} + +- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)theApplication +{ + return YES; +} +@end diff --git a/device_test/English.lproj/InfoPlist.strings b/device_test/English.lproj/InfoPlist.strings new file mode 100644 index 0000000..30cfd96 Binary files /dev/null and b/device_test/English.lproj/InfoPlist.strings differ diff --git a/device_test/English.lproj/MainMenu.nib/designable.nib b/device_test/English.lproj/MainMenu.nib/designable.nib new file mode 100644 index 0000000..fbb8f5a --- /dev/null +++ b/device_test/English.lproj/MainMenu.nib/designable.nib @@ -0,0 +1,5311 @@ + + + + 1070 + 11G63 + 3084 + 1138.51 + 569.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 3084 + + + NSArrayController + NSBox + NSButton + NSButtonCell + NSCustomObject + NSCustomView + NSLevelIndicator + NSLevelIndicatorCell + NSMenu + NSMenuItem + NSPopUpButton + NSPopUpButtonCell + NSScrollView + NSScroller + NSTabView + NSTabViewItem + NSTableColumn + NSTableHeaderView + NSTableView + NSTextField + NSTextFieldCell + NSView + NSWindowTemplate + + + com.apple.InterfaceBuilder.CocoaPlugin + + + PluginDependencyRecalculationVersion + + + + + + NSApplication + + + + FirstResponder + + + NSApplication + + + 15 + 2 + {{183, 341}, {529, 499}} + 1881669632 + HID Device Test + NSWindow + + View + + + {213, 107} + + + 256 + + + + 274 + {{13, 10}, {503, 483}} + + + + + + + 1 + + + + 256 + + + + 268 + {{17, 399}, {50, 17}} + + + YES + + 67239424 + 272629760 + Mouse: + + LucidaGrande + 13 + 1044 + + + + 6 + System + controlColor + + 3 + MC42NjY2NjY2NjY3AA + + + + 6 + System + controlTextColor + + 3 + MAA + + + + + + + 266 + {{69, 393}, {397, 26}} + + + YES + + -2076049856 + 2048 + + + 109199615 + 1 + + LucidaGrande + 13 + 16 + + + + + + 400 + 75 + + + Item1 + + 1048576 + 2147483647 + 1 + + NSImage + NSMenuCheckmark + + + NSImage + NSMenuMixedState + + _popUpItemAction: + + + YES + + + OtherViews + + + + + + Item2 + + 1048576 + 2147483647 + + + _popUpItemAction: + + + + + Item3 + + 1048576 + 2147483647 + + + _popUpItemAction: + + + + + 3 + YES + YES + 1 + + + + + 268 + {{17, 372}, {93, 17}} + + + YES + + 67239424 + 272629760 + Manufacturer: + + + + + + + + + 266 + {{112, 372}, {354, 17}} + + + YES + + 67239424 + 272629760 + System Font Text + + + + + + + + + 268 + {{48, 338}, {62, 17}} + + + YES + + 67239424 + 272629760 + Mouse X: + + + + + + + + + 266 + {{12, 361}, {459, 5}} + + + {0, 0} + + 67239424 + 0 + Box + + + 6 + System + textBackgroundColor + + 3 + MQA + + + + 3 + MCAwLjgwMDAwMDAxAA + + + 3 + 2 + 0 + NO + + + + 268 + {{46, 312}, {62, 17}} + + + YES + + 67239424 + 272629760 + Mouse Y: + + + + + + + + + 268 + {{17, 286}, {91, 17}} + + + YES + + 67239424 + 272629760 + Mouse Wheel: + + + + + + + + + 266 + {{113, 338}, {350, 16}} + + + YES + + 130560 + 0 + + 5000 + 1 + + + + + 266 + {{113, 312}, {350, 16}} + + + YES + + 130560 + 0 + + 5000 + 1 + + + + + 266 + {{113, 286}, {350, 16}} + + + YES + + 130560 + 0 + + 5 + 1 + + + + + 272 + + + + 2304 + + + + 256 + {157, 240} + + + YES + + + 256 + {157, 17} + + + + + + + 256 + {{158, 0}, {16, 17}} + + + + + + 65 + 40 + 1000 + + 75628096 + 2048 + Button + + LucidaGrande + 11 + 3100 + + + 3 + MC4zMzMzMzI5OQA + + + 6 + System + headerTextColor + + + + + 337772096 + 2048 + + + + 6 + System + controlBackgroundColor + + + + + 3 + YES + YES + + + + 85.97607421875 + 48.97607421875 + 1000 + + 75628096 + 2048 + Pressed + + + + + + 337772032 + 0 + + LucidaGrande + 12 + 16 + + + + + + 3 + YES + YES + + + + 3 + 2 + + + 6 + System + gridColor + + 3 + MC41AA + + + 17 + -700448768 + + + 5 + 15 + 0 + YES + 0 + 1 + + + {{1, 17}, {157, 240}} + + + + + 4 + + + + 256 + {{158, 17}, {15, 240}} + + + + _doScroller: + 0.89473682641983032 + + + + -2147483392 + {{-100, -100}, {131, 15}} + + + 1 + + _doScroller: + 0.99047619104385376 + + + + 2304 + + + + {{1, 0}, {157, 17}} + + + + + 4 + + + + {{113, 20}, {174, 258}} + + + 133138 + + + + + + QSAAAEEgAABBmAAAQZgAAA + + + {{10, 33}, {483, 437}} + + + Mice + + + + + + 2 + + + + 256 + + + + 268 + {{17, 399}, {57, 17}} + + YES + + 67239424 + 272629760 + Joystick: + + + + + + + + + 266 + {{76, 393}, {390, 26}} + + YES + + -2076049856 + 2048 + + + 109199615 + 1 + + + + + + 400 + 75 + + + Item1 + + 1048576 + 2147483647 + 1 + + + _popUpItemAction: + + + YES + + + OtherViews + + + + + + Item2 + + 1048576 + 2147483647 + + + _popUpItemAction: + + + + + Item3 + + 1048576 + 2147483647 + + + _popUpItemAction: + + + + + 3 + YES + YES + 1 + + + + + 268 + {{17, 372}, {93, 17}} + + YES + + 67239424 + 272629760 + Manufacturer: + + + + + + + + + 266 + {{112, 372}, {354, 17}} + + YES + + 69336577 + 272629760 + System Font Text + + + + + + + + + 276 + + + + 2304 + + + + 256 + {177, 267} + + YES + + + 256 + {177, 17} + + + + + + 256 + {{178, 0}, {16, 17}} + + + + + 80 + 40 + 1000 + + 75628096 + 2048 + Button + + + 3 + MC4zMzMzMzI5OQA + + + + + 337772096 + 2048 + + + + + + 3 + YES + + + + 90.97607421875 + 48.97607421875 + 1000 + + 75628096 + 2048 + Pressed + + + + + + 337772032 + 0 + + + + + + 3 + YES + + + + 3 + 2 + + + 17 + -700448768 + + + 5 + 15 + 0 + YES + 0 + 1 + + + {{1, 17}, {177, 267}} + + + + + 4 + + + + 256 + {{178, 17}, {15, 267}} + + + _doScroller: + 0.95789474248886108 + + + + 256 + {{-100, -100}, {177, 15}} + + 1 + + _doScroller: + 0.99047619104385376 + + + + 2304 + + + + {{1, 0}, {177, 17}} + + + + + 4 + + + + {{74, 20}, {194, 285}} + + + 133138 + + + + + QSAAAEEgAABBmAAAQZgAAA + + + + 266 + {{12, 361}, {459, 5}} + + {0, 0} + + 67239424 + 0 + Box + + + + 3 + MCAwLjgwMDAwMDAxAA + + + 3 + 2 + 0 + NO + + + + 266 + {{74, 337}, {389, 16}} + + YES + + 130560 + 0 + + -32768 + 32768 + 1 + + + + + 266 + {{74, 313}, {389, 16}} + + YES + + 130560 + 0 + + -32768 + 32768 + 1 + + + + + 268 + {{17, 337}, {52, 17}} + + YES + + 67239424 + 272629760 + X-Axis: + + + + + + + + + 268 + {{17, 313}, {52, 17}} + + YES + + 67239424 + 272629760 + Y-Axis: + + + + + + + + {{10, 33}, {483, 437}} + + Joysticks + + + + + + + 256 + + + + 266 + {{87, 393}, {379, 26}} + + + YES + + -2076049856 + 2048 + + + 109199615 + 1 + + + + + + 400 + 75 + + + Item1 + + 1048576 + 2147483647 + 1 + + + _popUpItemAction: + + + YES + + + OtherViews + + + + + + Item2 + + 1048576 + 2147483647 + + + _popUpItemAction: + + + + + Item3 + + 1048576 + 2147483647 + + + _popUpItemAction: + + + + + 3 + YES + YES + 1 + + + + + 264 + {{17, 399}, {68, 17}} + + + YES + + 67239424 + 272629760 + Keyboard: + + + + + + + + + 266 + {{112, 372}, {354, 17}} + + + YES + + 67239424 + 272629760 + System Font Text + + + + + + + + + 264 + {{17, 372}, {93, 17}} + + + YES + + 67239424 + 272629760 + Manufacturer: + + + + + + + + + 256 + {{12, 361}, {459, 5}} + + + {0, 0} + + 67239424 + 0 + Box + + + + 3 + MCAwLjgwMDAwMDAxAA + + + 3 + 2 + 0 + NO + + + + 256 + + + + 2304 + + + + 256 + {426, 333} + + + YES + + + 256 + {{427, 0}, {16, 17}} + + + + 94 + 40 + 1000 + + 75628096 + 2048 + + + + 3 + MC4zMzMzMzI5OQA + + + + + 337772096 + 2048 + + + + + + 3 + YES + YES + + + + 326 + 40 + 1000 + + 75628096 + 2048 + + + + + + + 337772096 + 2048 + + + + + + 3 + YES + YES + + + + 3 + 2 + + + 17 + 306184192 + + + 4 + 15 + 0 + YES + 0 + 1 + + + {{1, 1}, {426, 333}} + + + + + 4 + + + + 256 + {{427, 1}, {15, 333}} + + + + _doScroller: + 0.96315789222717285 + + + + -2147483392 + {{-100, -100}, {426, 15}} + + + 1 + + _doScroller: + 0.99047619104385376 + + + {{20, 20}, {443, 335}} + + + 133138 + + + + QSAAAEEgAABBmAAAQZgAAA + + + {{10, 33}, {483, 437}} + + + Keyboards + + + + + + + 256 + + + + 256 + {{188, 137}, {107, 280}} + + + RemoteFeedbackView + NSView + + + + 256 + {{176, 67}, {131, 32}} + + + YES + + 67239424 + 134217728 + Start Listening + + + -2038284033 + 1 + + + + + + 200 + 25 + + + + + 256 + {{165, 39}, {151, 18}} + + YES + + 67239424 + 131072 + Open in exclusive mode + + + 1211912703 + 2 + + NSSwitch + + + + 200 + 25 + + + + + 256 + {{165, 115}, {152, 14}} + + + YES + + 67239424 + 138543104 + - + + + + + + + + + 256 + {{194, 423}, {63, 14}} + + + YES + + 67239424 + 272629760 + Remote ID: + + + + + + + + + 256 + {{259, 423}, {32, 14}} + + + YES + + 67239424 + 272629760 + 9999 + + + + + + + + {{10, 33}, {483, 437}} + + + Remote + + + + + + + 256 + + + + 266 + {{87, 393}, {379, 26}} + + + + YES + + -2076049856 + 2048 + + + 109199615 + 1 + + + + + + 400 + 75 + + + Item1 + + 1048576 + 2147483647 + 1 + + + _popUpItemAction: + + + YES + + + OtherViews + + + + + + Item2 + + 1048576 + 2147483647 + + + _popUpItemAction: + + + + + Item3 + + 1048576 + 2147483647 + + + _popUpItemAction: + + + + + 3 + YES + YES + 1 + + + + + 264 + {{17, 399}, {41, 17}} + + + + YES + + 67239424 + 272629760 + Mikey + + + + + + + + + 266 + {{112, 372}, {354, 17}} + + + + YES + + 67239424 + 272629760 + System Font Text + + + + + + + + + 264 + {{17, 372}, {93, 17}} + + + + YES + + 67239424 + 272629760 + Manufacturer: + + + + + + + + + 256 + {{12, 361}, {459, 5}} + + + + {0, 0} + + 67239424 + 0 + Box + + + + 3 + MCAwLjgwMDAwMDAxAA + + + 3 + 2 + 0 + NO + + + + 256 + + + + 2304 + + + + 256 + {426, 333} + + + + YES + + + 256 + {{427, 0}, {16, 17}} + + + + 94 + 40 + 1000 + + 75628096 + 2048 + + + + 3 + MC4zMzMzMzI5OQA + + + + + 337772096 + 2048 + + + + + + 3 + YES + YES + + + + 326 + 40 + 1000 + + 75628096 + 2048 + + + + + + + 337772096 + 2048 + + + + + + 3 + YES + YES + + + + 3 + 2 + + + 17 + 306184192 + + + 4 + 15 + 0 + YES + 0 + 1 + + + {{1, 1}, {426, 333}} + + + + + + 4 + + + + 256 + {{427, 1}, {15, 333}} + + + + + _doScroller: + 0.96315789222717285 + + + + -2147483392 + {{-100, -100}, {426, 15}} + + + + 1 + + _doScroller: + 0.99047619104385376 + + + {{20, 20}, {443, 335}} + + + + 133138 + + + + QSAAAEEgAABBmAAAQZgAAA + + + {{10, 33}, {483, 437}} + + + + + Mikeys + + + + + + + 0 + YES + YES + + + + + + {529, 499} + + + + + {{0, 0}, {1920, 1178}} + {213, 129} + {10000000000000, 10000000000000} + YES + + + MainMenu + + + + HIDDeviceTest + + 1048576 + 2147483647 + + + submenuAction: + + HIDDeviceTest + + + + About HIDDeviceTest + + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Preferences… + , + 1048576 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Services + + 1048576 + 2147483647 + + + submenuAction: + + + Services + + + _NSServicesMenu + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Hide HIDDeviceTest + h + 1048576 + 2147483647 + + + + + + Hide Others + h + 1572864 + 2147483647 + + + + + + Show All + + 1048576 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Quit HIDDeviceTest + q + 1048576 + 2147483647 + + + + + _NSAppleMenu + + + + + File + + 1048576 + 2147483647 + + + submenuAction: + + + File + + + + + New + n + 1048576 + 2147483647 + + + + + + Open… + o + 1048576 + 2147483647 + + + + + + Open Recent + + 1048576 + 2147483647 + + + submenuAction: + + + Open Recent + + + + + Clear Menu + + 1048576 + 2147483647 + + + + + _NSRecentDocumentsMenu + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Close + w + 1048576 + 2147483647 + + + + + + Save + s + 1048576 + 2147483647 + + + + + + Save As… + S + 1048576 + 2147483647 + + + + + + Revert + + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Page Setup… + P + 1048576 + 2147483647 + + + + + + Print… + p + 1048576 + 2147483647 + + + + + + + + + Edit + + 1048576 + 2147483647 + + + submenuAction: + + + Edit + + + + + Undo + z + 1048576 + 2147483647 + + + + + + Redo + Z + 1048576 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Cut + x + 1048576 + 2147483647 + + + + + + Copy + c + 1048576 + 2147483647 + + + + + + Paste + v + 1048576 + 2147483647 + + + + + + Paste and Match Style + V + 1572864 + 2147483647 + + + + + + Delete + + 1048576 + 2147483647 + + + + + + Select All + a + 1048576 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Find + + 1048576 + 2147483647 + + + submenuAction: + + + Find + + + + + Find… + f + 1048576 + 2147483647 + + + 1 + + + + Find Next + g + 1048576 + 2147483647 + + + 2 + + + + Find Previous + G + 1048576 + 2147483647 + + + 3 + + + + Use Selection for Find + e + 1048576 + 2147483647 + + + 7 + + + + Jump to Selection + j + 1048576 + 2147483647 + + + + + + + + + Spelling + + 1048576 + 2147483647 + + + submenuAction: + + Spelling + + + + Spelling… + : + 1048576 + 2147483647 + + + + + + Check Spelling + ; + 1048576 + 2147483647 + + + + + + Check Spelling as You Type + + 1048576 + 2147483647 + + + + + + + + + Speech + + 1048576 + 2147483647 + + + submenuAction: + + Speech + + + + Start Speaking + + 1048576 + 2147483647 + + + + + + Stop Speaking + + 1048576 + 2147483647 + + + + + + + + + + + + Window + + 1048576 + 2147483647 + + + submenuAction: + + + Window + + + + + Minimize + m + 1048576 + 2147483647 + + + + + + Zoom + + 1048576 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Bring All to Front + + 1048576 + 2147483647 + + + + + _NSWindowsMenu + + + + + Help + + 1048576 + 2147483647 + + + submenuAction: + + + Help + + + + + NewApplication Help + ? + 1048576 + 2147483647 + + + + + + + + _NSMainMenu + + + DeviceTestController + + + + productName + manufacturer + + + YES + YES + YES + YES + YES + + + + name + pressed + + + YES + YES + YES + YES + YES + + + BoolFormatter + + + MousePaneController + + + JoystickPaneController + + + + productName + manufacturer + + + YES + YES + YES + YES + YES + + + + name + pressed + + + YES + YES + YES + YES + YES + + + AppleRemotePaneController + + + KeyboardPaneController + + + + productName + manufacturer + + YES + + YES + YES + YES + YES + YES + + + + event + description + + YES + + YES + YES + YES + YES + YES + + + AppleMikeyPaneController + + + + productName + manufacturer + + YES + + YES + YES + YES + YES + YES + + + + event + description + + YES + + YES + YES + YES + YES + YES + + + + 256 + {125, 1} + + + + + + + 256 + {125, 1} + + + + + + + 256 + {125, 1} + + + + + + + + + + terminate: + + + + 139 + + + + orderFrontStandardAboutPanel: + + + + 142 + + + + hideOtherApplications: + + + + 146 + + + + hide: + + + + 152 + + + + unhideAllApplications: + + + + 153 + + + + delegate + + + + 396 + + + + performMiniaturize: + + + + 37 + + + + arrangeInFront: + + + + 39 + + + + print: + + + + 86 + + + + runPageLayout: + + + + 87 + + + + showHelp: + + + + 122 + + + + clearRecentDocuments: + + + + 127 + + + + performClose: + + + + 193 + + + + toggleContinuousSpellChecking: + + + + 222 + + + + undo: + + + + 223 + + + + copy: + + + + 224 + + + + checkSpelling: + + + + 225 + + + + paste: + + + + 226 + + + + stopSpeaking: + + + + 227 + + + + cut: + + + + 228 + + + + showGuessPanel: + + + + 230 + + + + redo: + + + + 231 + + + + selectAll: + + + + 232 + + + + startSpeaking: + + + + 233 + + + + delete: + + + + 235 + + + + performZoom: + + + + 240 + + + + performFindPanelAction: + + + + 241 + + + + performFindPanelAction: + + + + 242 + + + + performFindPanelAction: + + + + 243 + + + + performFindPanelAction: + + + + 244 + + + + centerSelectionInVisibleArea: + + + + 245 + + + + pasteAsPlainText: + + + + 247 + + + + content: arrangedObjects.productName + + + + + + content: arrangedObjects.productName + content + arrangedObjects.productName + + Foo + Bar + No Mice + + 2 + + + 342 + + + + selectedIndex: mouseIndex + + + + + + selectedIndex: mouseIndex + selectedIndex + mouseIndex + + 2 + + + 355 + + + + mMousePaneController + + + + 346 + + + + mWindow + + + + 397 + + + + contentArray: mice + + + + + + contentArray: mice + contentArray + mice + + NSConditionallySetsEditable + + + 2 + + + 354 + + + + value: selection.manufacturer + + + + + + value: selection.manufacturer + value + selection.manufacturer + 2 + + + 267 + + + + maxValue: maxValue + + + + + + maxValue: maxValue + maxValue + maxValue + 2 + + + 347 + + + + value: mouseX + + + + + + value: mouseX + value + mouseX + + 2 + + + 356 + + + + maxValue: maxValue + + + + + + maxValue: maxValue + maxValue + maxValue + 2 + + + 349 + + + + value: mouseY + + + + + + value: mouseY + value + mouseY + + 2 + + + 357 + + + + maxValue: maxValue + + + + + + maxValue: maxValue + maxValue + maxValue + 2 + + + 351 + + + + value: mouseWheel + + + + + + value: mouseWheel + value + mouseWheel + + 2 + + + 358 + + + + value: arrangedObjects.name + + + + + + value: arrangedObjects.name + value + arrangedObjects.name + 2 + + + 316 + + + + value: arrangedObjects.pressed + + + + + + value: arrangedObjects.pressed + value + arrangedObjects.pressed + 2 + + + 317 + + + + contentArray: mouseButtons + + + + + + contentArray: mouseButtons + contentArray + mouseButtons + + NSConditionallySetsEditable + + + 2 + + + 353 + + + + formatter + + + + 323 + + + + mMiceController + + + + 345 + + + + mJoysticksController + + + + 374 + + + + content: arrangedObjects.productName + + + + + + content: arrangedObjects.productName + content + arrangedObjects.productName + + NSNullPlaceholder + No Joysticks + + 2 + + + 394 + + + + selectedIndex: joystickIndex + + + + + + selectedIndex: joystickIndex + selectedIndex + joystickIndex + + 2 + + + 395 + + + + value: selection.manufacturer + + + + + + value: selection.manufacturer + value + selection.manufacturer + + NSNoSelectionPlaceholder + IA + + 2 + + + 393 + + + + contentArray: joysticks + + + + + + contentArray: joysticks + contentArray + joysticks + 2 + + + 369 + + + + value: arrangedObjects.pressed + + + + + + value: arrangedObjects.pressed + value + arrangedObjects.pressed + + NSConditionallySetsEditable + + + 2 + + + 401 + + + + value: arrangedObjects.name + + + + + + value: arrangedObjects.name + value + arrangedObjects.name + 2 + + + 385 + + + + contentArray: joystickButtons + + + + + + contentArray: joystickButtons + contentArray + joystickButtons + 2 + + + 383 + + + + formatter + + + + 388 + + + + value: xAxis + + + + + + value: xAxis + value + xAxis + 2 + + + 404 + + + + value: yAxis + + + + + + value: yAxis + value + yAxis + 2 + + + 405 + + + + toggleListening: + + + + 412 + + + + mStartStopButton + + + + 414 + + + + mFeedbackView + + + + 415 + + + + mFeedbackText + + + + 419 + + + + value: openInExclusiveMode + + + + + + value: openInExclusiveMode + value + openInExclusiveMode + 2 + + + 413 + + + + value: remote.remoteId + + + + + + value: remote.remoteId + value + remote.remoteId + 2 + + + 422 + + + + mKeyboardsController + + + + 454 + + + + mKeyboardEventsController + + + + 457 + + + + content: arrangedObjects.productName + + + + + + content: arrangedObjects.productName + content + arrangedObjects.productName + + NSNullPlaceholder + No Joysticks + + 2 + + + 440 + + + + selectedIndex: keyboardIndex + + + + + + selectedIndex: keyboardIndex + selectedIndex + keyboardIndex + + 2 + + + 441 + + + + value: selection.manufacturer + + + + + + value: selection.manufacturer + value + selection.manufacturer + 2 + + + 439 + + + + contentArray: keyboards + + + + + + contentArray: keyboards + contentArray + keyboards + 2 + + + 433 + + + + value: arrangedObjects.event + + + + + + value: arrangedObjects.event + value + arrangedObjects.event + 2 + + + 459 + + + + value: arrangedObjects.description + + + + + + value: arrangedObjects.description + value + arrangedObjects.description + 2 + + + 460 + + + + contentArray: events + + + + + + contentArray: events + contentArray + events + 2 + + + 456 + + + + mMikeysController + + + + 504 + + + + mMikeysEventsController + + + + 505 + + + + contentArray: mikeys + + + + + + contentArray: mikeys + contentArray + mikeys + 2 + + + 538 + + + + contentArray: events + + + + + + contentArray: events + contentArray + events + 2 + + + 540 + + + + value: selection.manufacturer + + + + + + value: selection.manufacturer + value + selection.manufacturer + 2 + + + 544 + + + + content: arrangedObjects.productName + + + + + + content: arrangedObjects.productName + content + arrangedObjects.productName + + NSNullPlaceholder + No Mikeys + + 2 + + + 541 + + + + selectedIndex: mikeyIndex + + + + + + selectedIndex: mikeyIndex + selectedIndex + mikeyIndex + + 2 + + + 542 + + + + value: arrangedObjects.description + + + + + + value: arrangedObjects.description + value + arrangedObjects.description + 2 + + + 536 + + + + value: arrangedObjects.event + + + + + + value: arrangedObjects.event + value + arrangedObjects.event + 2 + + + 535 + + + + + + 0 + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + 21 + + + + + + Window + + + 2 + + + + + + + + 248 + + + + + + + + + + + + 249 + + + + + + + + 250 + + + + + + + + + + + + + + + + + 360 + + + + + + + + 361 + + + + + + + + 366 + + + + + + + + 367 + + + + + + + + 376 + + + + + + + + + + + 377 + + + + + + + + + 378 + + + + + + + + 387 + + + + + 379 + + + + + + + + 380 + + + + + + 398 + + + + + + + + 399 + + + + + + + + 402 + + + + + + + + 403 + + + + + + + + 251 + + + + + + + + 252 + + + + + + + + + + + + + + + + + + + 255 + + + + + + + + 256 + + + + + + + + 265 + + + + + + + + 266 + + + + + + + + 270 + + + + + + + + 271 + + + + + + 273 + + + + + + + + 274 + + + + + + + + 281 + + + + + + + + 288 + + + + + + + + 294 + + + + + + + + 310 + + + + + + + + + + + 311 + + + + + + + + + 312 + + + + + + + + 313 + + + + + + + + 321 + + + + + 253 + + + + + + + + 254 + + + + + + + + + + + + + 424 + + + + + + + + 429 + + + + + + + + 430 + + + + + + + + 431 + + + + + + + + 448 + + + + + + 450 + + + + + + + + + + 451 + + + + + + + + + 452 + + + + + + + + 453 + + + + + + + + 407 + + + + + + + + 408 + + + + + + + + + + + + + 409 + + + + + 410 + + + + + + + + 411 + + + + + + + + 416 + + + + + + + + 420 + + + + + + + + 421 + + + + + + + + 29 + + + + + + + + + + MainMenu + + + 19 + + + + + + + + 24 + + + + + + + + + + + 5 + + + + + 23 + + + + + 92 + + + + + 239 + + + + + 56 + + + + + + + + 57 + + + + + + + + + + + + + + + + + + 58 + + + + + 129 + + + + + 131 + + + + + + + + 130 + + + + + 134 + + + + + 136 + + + + + 143 + + + + + 144 + + + + + 145 + + + + + 149 + + + + + 150 + + + + + 236 + + + + + 83 + + + + + + + + 81 + + + + + + + + + + + + + + + + + + 72 + + + + + 73 + + + + + 74 + + + + + 75 + + + + + 77 + + + + + 78 + + + + + 79 + + + + + 80 + + + + + 82 + + + + + 112 + + + + + 124 + + + + + + + + 125 + + + + + + + + 126 + + + + + 103 + + + + + + + + 106 + + + + + + + + 111 + + + + + 217 + + + + + + + + 205 + + + + + + + + + + + + + + + + + + + + 197 + + + + + 198 + + + + + 199 + + + + + 202 + + + + + 203 + + + + + 206 + + + + + 207 + + + + + 211 + + + + + + + + 212 + + + + + + + + + 195 + + + + + 196 + + + + + 214 + + + + + 215 + + + + + 216 + + + + + + + + 200 + + + + + + + + + + 201 + + + + + 204 + + + + + 219 + + + + + 218 + + + + + + + + 220 + + + + + + + + + + + + 208 + + + + + 209 + + + + + 210 + + + + + 213 + + + + + 221 + + + + + 246 + + + + + 261 + + + DeviceTestController + + + 262 + + + Mice + + + 314 + + + MouseButtons + + + 322 + + + BoolFormatter + + + 344 + + + MousePaneController + + + 359 + + + JoystickPaneController + + + 368 + + + Joysticks + + + 382 + + + JoystickButtons + + + 406 + + + AppleRemotePaneController + + + 423 + + + KeyboardPaneController + + + 432 + + + Keyboards + + + 455 + + + KeyboardEvents + + + 462 + + + + + 463 + + + + + + + + 464 + + + + + 465 + + + + + 466 + + + + + 467 + + + + + 468 + + + + + 469 + + + + + 470 + + + + + 471 + + + + + + + + 472 + + + + + 473 + + + + + 474 + + + + + 475 + + + + + 476 + + + + + 477 + + + + + 478 + + + + + 479 + + + + + 480 + + + + + + + + 481 + + + + + 482 + + + + + 483 + + + + + 484 + + + + + 485 + + + + + 486 + + + + + 487 + + + + + 488 + + + + + 489 + + + + + 490 + + + + + 491 + + + + + 492 + + + + + 362 + + + + + + + + + + 365 + + + + + 364 + + + + + 363 + + + + + 257 + + + + + + + + + + 260 + + + + + 259 + + + + + 258 + + + + + 425 + + + + + + + + + + 428 + + + + + 427 + + + + + 426 + + + + + 493 + + + + + 494 + + + + + 495 + + + + + 496 + + + + + 497 + + + + + 498 + + + + + 499 + + + + + 500 + + + + + -3 + + + Application + + + 381 + + + + + 272 + + + + + 449 + + + + + 501 + + + AppleMikeyPaneController + + + 502 + + + mikeys + + + 503 + + + mikeyEvents + + + 506 + + + + + + + + 507 + + + + + + + + + + + + + 513 + + + + + + + + 512 + + + + + + + + 509 + + + + + 508 + + + + + + + + + + 524 + + + + + + + + + 523 + + + + + 522 + + + + + 526 + + + + + + + + 525 + + + + + + + + 528 + + + + + 527 + + + + + 519 + + + + + 514 + + + + + + + + 515 + + + + + + + + + + 518 + + + + + 517 + + + + + 516 + + + + + 510 + + + + + + + + 521 + + + + + 511 + + + + + + + + 520 + + + + + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + + + + + 544 + + + + + AppleMikeyPaneController + NSObject + + NSArrayController + NSArrayController + + + + mMikeysController + NSArrayController + + + mMikeysEventsController + NSArrayController + + + + IBProjectSource + ./Classes/AppleMikeyPaneController.h + + + + AppleRemotePaneController + NSObject + + toggleListening: + id + + + toggleListening: + + toggleListening: + id + + + + NSTextField + RemoteFeedbackView + NSButton + + + + mFeedbackText + NSTextField + + + mFeedbackView + RemoteFeedbackView + + + mStartStopButton + NSButton + + + + IBProjectSource + ./Classes/AppleRemotePaneController.h + + + + BoolFormatter + NSFormatter + + IBProjectSource + ./Classes/BoolFormatter.h + + + + DeviceTestController + NSObject + + MousePaneController + NSWindow + + + + mMousePaneController + MousePaneController + + + mWindow + NSWindow + + + + IBProjectSource + ./Classes/DeviceTestController.h + + + + JoystickPaneController + NSObject + + mJoysticksController + NSArrayController + + + mJoysticksController + + mJoysticksController + NSArrayController + + + + IBProjectSource + ./Classes/JoystickPaneController.h + + + + KeyboardPaneController + NSObject + + NSArrayController + NSArrayController + + + + mKeyboardEventsController + NSArrayController + + + mKeyboardsController + NSArrayController + + + + IBProjectSource + ./Classes/KeyboardPaneController.h + + + + MousePaneController + NSObject + + mMiceController + NSArrayController + + + mMiceController + + mMiceController + NSArrayController + + + + IBProjectSource + ./Classes/MousePaneController.h + + + + RemoteFeedbackView + NSView + + IBProjectSource + ./Classes/RemoteFeedbackView.h + + + + + 0 + IBCocoaFramework + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + YES + 3 + + {11, 11} + {10, 3} + + + diff --git a/device_test/English.lproj/MainMenu.nib/keyedobjects.nib b/device_test/English.lproj/MainMenu.nib/keyedobjects.nib new file mode 100644 index 0000000..8158386 Binary files /dev/null and b/device_test/English.lproj/MainMenu.nib/keyedobjects.nib differ diff --git a/device_test/Info.plist b/device_test/Info.plist new file mode 100644 index 0000000..db90f92 --- /dev/null +++ b/device_test/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + org.dribin.dave.ddhidlib.HIDDeviceTest + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + APPL + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + CFBundleShortVersionString + ${CURRENT_MARKETING_VERSION} + NSMainNibFile + MainMenu + NSPrincipalClass + NSApplication + + diff --git a/device_test/JoystickPaneController.h b/device_test/JoystickPaneController.h new file mode 100644 index 0000000..38015d0 --- /dev/null +++ b/device_test/JoystickPaneController.h @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2007 Dave Dribin + * + * 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: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * 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. + */ + +#import +#import "DDHidLib.h" + + +@interface JoystickPaneController : NSObject +{ + IBOutlet NSArrayController * mJoysticksController; + + NSArray * mJoysticks; + NSMutableArray * mJoystickButtons; + int mXAxis; + int mYAxis; + unsigned mJoystickIndex; + + // Don't retain these + DDHidJoystick * mCurrentJoystick; +} + +- (NSArray *) joysticks; + +- (NSArray *) joystickButtons; + +- (unsigned) joystickIndex; +- (void) setJoystickIndex: (unsigned) theJoystickIndex; + +- (int) xAxis; +- (int) yAxis; + +- (void) ddhidJoystick: (DDHidJoystick *) joystick + stick: (unsigned) stick + xChanged: (int) value; + +- (void) ddhidJoystick: (DDHidJoystick *) joystick + stick: (unsigned) stick + yChanged: (int) value; + +- (void) ddhidJoystick: (DDHidJoystick *) joystick + stick: (unsigned) stick + otherAxis: (unsigned) otherAxis + valueChanged: (int) value; + +- (void) ddhidJoystick: (DDHidJoystick *) joystick + buttonDown: (unsigned) buttonNumber; + +- (void) ddhidJoystick: (DDHidJoystick *) joystick + buttonUp: (unsigned) buttonNumber; + +@end diff --git a/device_test/JoystickPaneController.m b/device_test/JoystickPaneController.m new file mode 100644 index 0000000..52dd949 --- /dev/null +++ b/device_test/JoystickPaneController.m @@ -0,0 +1,174 @@ +/* + * Copyright (c) 2007 Dave Dribin + * + * 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: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * 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. + */ + +#import "JoystickPaneController.h" +#import "DDHidJoystick.h" +#import "ButtonState.h" + +@interface JoystickPaneController (Private) + +- (void) setJoysticks: (NSArray *) theJoysticks; + +@end + +@implementation JoystickPaneController + +- (void) awakeFromNib; +{ + NSArray * joysticks = [DDHidJoystick allJoysticks]; + + mJoystickButtons = [[NSMutableArray alloc] init]; + [joysticks makeObjectsPerformSelector: @selector(setDelegate:) + withObject: self]; + [self setJoysticks: joysticks]; + if ([mJoysticks count] > 0) + [self setJoystickIndex: 0]; + else + [self setJoystickIndex: NSNotFound]; +} + +//=========================================================== +// joysticks +//=========================================================== +- (NSArray *) joysticks +{ + return mJoysticks; +} + +- (NSArray *) joystickButtons; +{ + return mJoystickButtons; +} + +//=========================================================== +// joystickIndex +//=========================================================== +- (unsigned) joystickIndex +{ + return mJoystickIndex; +} + +- (void) setJoystickIndex: (unsigned) theJoystickIndex +{ + if (mCurrentJoystick != nil) + { + [mCurrentJoystick stopListening]; + mCurrentJoystick = nil; + } + mJoystickIndex = theJoystickIndex; + [mJoysticksController setSelectionIndex: mJoystickIndex]; + if (mJoystickIndex != NSNotFound) + { + mCurrentJoystick = [mJoysticks objectAtIndex: mJoystickIndex]; + [mCurrentJoystick startListening]; + + [self willChangeValueForKey: @"joystickButtons"]; + [mJoystickButtons removeAllObjects]; + NSArray * buttons = [mCurrentJoystick buttonElements]; + NSEnumerator * e = [buttons objectEnumerator]; + DDHidElement * element; + while (element = [e nextObject]) + { + ButtonState * state = [[ButtonState alloc] initWithName: [[element usage] usageName]]; + [state autorelease]; + [mJoystickButtons addObject: state]; + } + [self didChangeValueForKey: @"joystickButtons"]; + } +} + +- (int) xAxis; +{ + return mXAxis; +} + +- (int) yAxis; +{ + return mYAxis; +} + +- (void) ddhidJoystick: (DDHidJoystick *) joystick + stick: (unsigned) stick + xChanged: (int) value; +{ + [self willChangeValueForKey: @"xAxis"]; + mXAxis = value; + [self didChangeValueForKey: @"xAxis"]; +} + +- (void) ddhidJoystick: (DDHidJoystick *) joystick + stick: (unsigned) stick + yChanged: (int) value; +{ + [self willChangeValueForKey: @"yAxis"]; + mYAxis = value; + [self didChangeValueForKey: @"yAxis"]; +} + +- (void) ddhidJoystick: (DDHidJoystick *) joystick + stick: (unsigned) stick + otherAxis: (unsigned) otherAxis + valueChanged: (int) value; +{ + // Somehow display values here + NSLog(@"Stick: %d, other axis: %d, changed: %d", stick, otherAxis, value); +} + +- (void) ddhidJoystick: (DDHidJoystick *) joystick + stick: (unsigned) stick + povNumber: (unsigned) povNumber + valueChanged: (int) value; +{ + // Somehow display values here + NSLog(@"Stick: %d, POV number: %d, changed: %d", stick, povNumber, value); +} + +- (void) ddhidJoystick: (DDHidJoystick *) joystick + buttonDown: (unsigned) buttonNumber; +{ + ButtonState * state = [mJoystickButtons objectAtIndex: buttonNumber]; + [state setPressed: YES]; +} + +- (void) ddhidJoystick: (DDHidJoystick *) joystick + buttonUp: (unsigned) buttonNumber; +{ + ButtonState * state = [mJoystickButtons objectAtIndex: buttonNumber]; + [state setPressed: NO]; +} + +@end + +@implementation JoystickPaneController (Private) + +- (void) setJoysticks: (NSArray *) theJoysticks +{ + if (mJoysticks != theJoysticks) + { + [mJoysticks release]; + mJoysticks = [theJoysticks retain]; + } +} + +@end diff --git a/device_test/KeyboardPaneController.h b/device_test/KeyboardPaneController.h new file mode 100644 index 0000000..b42db30 --- /dev/null +++ b/device_test/KeyboardPaneController.h @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2007 Dave Dribin + * + * 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: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * 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. + */ + +#import + + +@class DDHidKeyboard; + +@interface KeyboardPaneController : NSObject +{ + IBOutlet NSArrayController * mKeyboardsController; + IBOutlet NSArrayController * mKeyboardEventsController; + + NSArray * mKeyboards; + unsigned mKeyboardIndex; + NSMutableArray * mEvents; + + // Don't retain these + DDHidKeyboard * mCurrentKeyboard; +} + +- (NSArray *) keyboards; +- (void) setKeyboards: (NSArray *) theKeyboards; + +- (unsigned) keyboardIndex; +- (void) setKeyboardIndex: (unsigned) theKeyboardIndex; + +- (NSMutableArray *) events; +- (void) setEvents: (NSMutableArray *) theEvents; +- (void) addEvent: (id)theEvent; +- (void) removeEvent: (id)theEvent; + +@end + +@interface KeyboardPaneController (DDHidKeyboardDelegate) + +- (void) ddhidKeyboard: (DDHidKeyboard *) keyboard + keyDown: (unsigned) usageId; + +- (void) ddhidKeyboard: (DDHidKeyboard *) keyboard + keyUp: (unsigned) usageId; + +@end diff --git a/device_test/KeyboardPaneController.m b/device_test/KeyboardPaneController.m new file mode 100644 index 0000000..1f8730e --- /dev/null +++ b/device_test/KeyboardPaneController.m @@ -0,0 +1,179 @@ +/* + * Copyright (c) 2007 Dave Dribin + * + * 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: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * 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. + */ + +#import "KeyboardPaneController.h" +#import "DDHidLib.h" +#include + +@interface KeyboardPaneController (Private) + +- (void) addEvent: (NSString *) event usageId: (unsigned) usageId; + +@end + +@implementation KeyboardPaneController + +- (id) init; +{ + self = [super init]; + if (self == nil) + return nil; + + mEvents = [[NSMutableArray alloc] init]; + + return self; +} + +- (void) awakeFromNib; +{ + NSArray * keyboards = [DDHidKeyboard allKeyboards]; + + [keyboards makeObjectsPerformSelector: @selector(setDelegate:) + withObject: self]; + [self setKeyboards: keyboards]; + + if ([keyboards count] > 0) + [self setKeyboardIndex: 0]; + else + [self setKeyboardIndex: NSNotFound]; +} + +//=========================================================== +// dealloc +//=========================================================== +- (void) dealloc +{ + [mKeyboards release]; + [mEvents release]; + + mKeyboards = nil; + mEvents = nil; + [super dealloc]; +} + +//=========================================================== +// keyboards +//=========================================================== +- (NSArray *) keyboards +{ + return mKeyboards; +} + +- (void) setKeyboards: (NSArray *) theKeyboards +{ + if (mKeyboards != theKeyboards) + { + [mKeyboards release]; + mKeyboards = [theKeyboards retain]; + } +} +//=========================================================== +// keyboardIndex +//=========================================================== +- (unsigned) keyboardIndex +{ + return mKeyboardIndex; +} + +- (void) setKeyboardIndex: (unsigned) theKeyboardIndex +{ + if (mCurrentKeyboard != nil) + { + [mCurrentKeyboard stopListening]; + mCurrentKeyboard = nil; + } + mKeyboardIndex = theKeyboardIndex; + [mKeyboardsController setSelectionIndex: mKeyboardIndex]; + [self willChangeValueForKey: @"events"]; + [mEvents removeAllObjects]; + [self didChangeValueForKey: @"events"]; + if (mKeyboardIndex != NSNotFound) + { + mCurrentKeyboard = [mKeyboards objectAtIndex: mKeyboardIndex]; + [mCurrentKeyboard startListening]; + } +} + +//=========================================================== +// events +//=========================================================== +- (NSMutableArray *) events +{ + return mEvents; +} + +- (void) setEvents: (NSMutableArray *) theEvents +{ + if (mEvents != theEvents) + { + [mEvents release]; + mEvents = [theEvents retain]; + } +} +- (void) addEvent: (id)theEvent +{ + [[self events] addObject: theEvent]; +} +- (void) removeEvent: (id)theEvent +{ + [[self events] removeObject: theEvent]; +} + + +@end + +@implementation KeyboardPaneController (DDHidKeyboardDelegate) + +- (void) ddhidKeyboard: (DDHidKeyboard *) keyboard + keyDown: (unsigned) usageId; +{ + [self addEvent: @"Key Down" usageId: usageId]; +} + +- (void) ddhidKeyboard: (DDHidKeyboard *) keyboard + keyUp: (unsigned) usageId; +{ + [self addEvent: @"Key Up" usageId: usageId]; +} + +@end + +@implementation KeyboardPaneController (Private) + +- (void) addEvent: (NSString *) event usageId: (unsigned) usageId; +{ + DDHidUsageTables * usageTables = [DDHidUsageTables standardUsageTables]; + NSString * description = [NSString stringWithFormat: @"%@ (0x%04X)", + [usageTables descriptionForUsagePage: kHIDPage_KeyboardOrKeypad + usage: usageId], + usageId]; + + NSMutableDictionary * row = [mKeyboardEventsController newObject]; + [row setObject: event forKey: @"event"]; + [row setObject: description forKey: @"description"]; + [mKeyboardEventsController addObject: row]; +} + +@end + diff --git a/device_test/MousePaneController.h b/device_test/MousePaneController.h new file mode 100644 index 0000000..031aae1 --- /dev/null +++ b/device_test/MousePaneController.h @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2007 Dave Dribin + * + * 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: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * 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. + */ + +#import + +@class DDHidQueue; +@class DDHidMouse; + +@interface MousePaneController : NSObject +{ + IBOutlet NSArrayController * mMiceController; + NSArray * mMice; + DDHidMouse * mCurrentMouse; + + unsigned mMouseIndex; + int mMouseX; + int mMouseY; + int mMouseWheel; + NSMutableArray * mMouseButtons; +} + +- (BOOL) no; + +- (NSArray *) mice; +- (void) setMice: (NSArray *) newMice; + +- (NSArray *) mouseButtons; + +- (unsigned) mouseIndex; +- (void) setMouseIndex: (unsigned) theMouseIndex; + +- (int) maxValue; + +- (int) mouseX; + +- (int) mouseY; + +- (int) mouseWheel; + +- (void) ddhidMouse: (DDHidMouse *) mouse xChanged: (SInt32) deltaX; +- (void) ddhidMouse: (DDHidMouse *) mouse yChanged: (SInt32) deltaY; +- (void) ddhidMouse: (DDHidMouse *) mouse wheelChanged: (SInt32) deltaWheel; + +- (void) ddhidMouse: (DDHidMouse *) mouse buttonDown: (unsigned) buttonNumber; +- (void) ddhidMouse: (DDHidMouse *) mouse buttonUp: (unsigned) buttonNumber; + +@end diff --git a/device_test/MousePaneController.m b/device_test/MousePaneController.m new file mode 100644 index 0000000..74f1590 --- /dev/null +++ b/device_test/MousePaneController.m @@ -0,0 +1,211 @@ +/* + * Copyright (c) 2007 Dave Dribin + * + * 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: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * 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. + */ + +#import "MousePaneController.h" +#import "DDHidLib.h" +#import "ButtonState.h" + + +@interface MousePaneController (Private) + +- (void) setMouseX: (int) mouseX; +- (void) setMouseY: (int) mouseY; +- (void) setMouseWheel: (int) mouseWheel; + +@end + +@implementation MousePaneController + +static int sMaxValue = 2500; + +static int applyDelta(int current, int delta) +{ + int newValue = (current + delta) % sMaxValue; + if (newValue < 0) + newValue = sMaxValue + newValue; + return newValue; +} + +- (void) awakeFromNib; +{ + mCurrentMouse = 0; + mMouseButtons = [[NSMutableArray alloc] init]; + + NSArray * mice = [DDHidMouse allMice]; + [mice makeObjectsPerformSelector: @selector(setDelegate:) + withObject: self]; + [self setMice: mice]; + [self setMouseIndex: 0]; +} + +//=========================================================== +// mice +//=========================================================== +- (NSArray *) mice +{ + return mMice; +} + +- (void) setMice: (NSArray *) theMice +{ + if (mMice != theMice) + { + [mMice release]; + mMice = [theMice retain]; + } +} + +- (NSArray *) mouseButtons; +{ + return mMouseButtons; +} + +- (BOOL) no; +{ + return NO; +} + +//=========================================================== +// - mouseIndex +//=========================================================== +- (unsigned) mouseIndex +{ + return mMouseIndex; +} + +//=========================================================== +// - setMouseIndex: +//=========================================================== +- (void) setMouseIndex: (unsigned) theMouseIndex +{ + if (mCurrentMouse != nil) + { + [mCurrentMouse stopListening]; + mCurrentMouse = nil; + } + mMouseIndex = theMouseIndex; + [mMiceController setSelectionIndex: mMouseIndex]; + if (mMouseIndex != NSNotFound) + { + mCurrentMouse = [mMice objectAtIndex: mMouseIndex]; + [mCurrentMouse startListening]; + [self setMouseX: sMaxValue/2]; + [self setMouseY: sMaxValue/2]; + [self setMouseWheel: sMaxValue/2]; + + [self willChangeValueForKey: @"mouseButtons"]; + [mMouseButtons removeAllObjects]; + NSArray * buttons = [mCurrentMouse buttonElements]; + NSEnumerator * e = [buttons objectEnumerator]; + DDHidElement * element; + while (element = [e nextObject]) + { + ButtonState * state = [[ButtonState alloc] initWithName: [[element usage] usageName]]; + [state autorelease]; + [mMouseButtons addObject: state]; + } + [self didChangeValueForKey: @"mouseButtons"]; + } +} + +- (int) maxValue; +{ + return sMaxValue; +} + +//=========================================================== +// - mouseX +//=========================================================== +- (int) mouseX +{ + return mMouseX; +} + +//=========================================================== +// - mouseY +//=========================================================== +- (int) mouseY +{ + return mMouseY; +} + +//=========================================================== +// - mouseWheel +//=========================================================== +- (int) mouseWheel +{ + return mMouseWheel; +} + +- (void) ddhidMouse: (DDHidMouse *) mouse xChanged: (SInt32) deltaX; +{ + [self setMouseX: applyDelta(mMouseX, deltaX)]; +} + +- (void) ddhidMouse: (DDHidMouse *) mouse yChanged: (SInt32) deltaY; +{ + [self setMouseY: applyDelta(mMouseY, deltaY)]; +} + +- (void) ddhidMouse: (DDHidMouse *) mouse wheelChanged: (SInt32) deltaWheel; +{ + // Some wheels only output -1 or +1, some output a more analog value. + // Normalize wheel to -1%/+1% movement. + deltaWheel = (deltaWheel/abs(deltaWheel))*(sMaxValue/100); + [self setMouseWheel: applyDelta(mMouseWheel, deltaWheel)]; +} + +- (void) ddhidMouse: (DDHidMouse *) mouse buttonDown: (unsigned) buttonNumber; +{ + ButtonState * state = [mMouseButtons objectAtIndex: buttonNumber]; + [state setPressed: YES]; +} + +- (void) ddhidMouse: (DDHidMouse *) mouse buttonUp: (unsigned) buttonNumber; +{ + ButtonState * state = [mMouseButtons objectAtIndex: buttonNumber]; + [state setPressed: NO]; +} + +@end + +@implementation MousePaneController (Private) + +- (void) setMouseX: (int) mouseX; +{ + mMouseX = mouseX; +} + +- (void) setMouseY: (int) mouseY; +{ + mMouseY = mouseY; +} + +- (void) setMouseWheel: (int) mouseWheel; +{ + mMouseWheel = mouseWheel; +} + +@end + diff --git a/device_test/RemoteFeedbackView.h b/device_test/RemoteFeedbackView.h new file mode 100644 index 0000000..767e5d6 --- /dev/null +++ b/device_test/RemoteFeedbackView.h @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2007 Dave Dribin + * + * 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: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * 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. + */ + +// Based on Martin Kahr's Apple Remote wrapper +// http://www.martinkahr.com/source-code/ + +#import +#import "DDHidAppleRemote.h" + +@interface RemoteFeedbackView : NSView +{ + NSImage* remoteImage; + DDHidAppleRemoteEventIdentifier lastButtonIdentifier; + BOOL drawn; + BOOL clearAfterDraw; +} + +- (void) ddhidAppleRemoteButton: (DDHidAppleRemoteEventIdentifier)buttonIdentifier + pressedDown: (BOOL) pressedDown; + +@end diff --git a/device_test/RemoteFeedbackView.m b/device_test/RemoteFeedbackView.m new file mode 100644 index 0000000..acfdf3c --- /dev/null +++ b/device_test/RemoteFeedbackView.m @@ -0,0 +1,162 @@ +/* + * Copyright (c) 2007 Dave Dribin + * + * 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: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * 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. + */ + +// Based on Martin Kahr's Apple Remote wrapper +// http://www.martinkahr.com/source-code/ + +#import "RemoteFeedbackView.h" + +@implementation RemoteFeedbackView + +- (id)initWithFrame:(NSRect)frameRect +{ + if ((self = [super initWithFrame:frameRect]) != nil) { + remoteImage = [[NSImage imageNamed:@"AppleRemote"] retain]; + lastButtonIdentifier = -1; + } + return self; +} + +- (void) dealloc { + + [remoteImage release]; + [super dealloc]; +} + +- (void) clearAfterRedraw: (id) sender +{ + clearAfterDraw = NO; + [self ddhidAppleRemoteButton: lastButtonIdentifier pressedDown: NO]; +} + +- (void) ddhidAppleRemoteButton: (DDHidAppleRemoteEventIdentifier)buttonIdentifier + pressedDown: (BOOL) pressedDown; +{ + + clearAfterDraw = NO; + + if (pressedDown) { + lastButtonIdentifier = buttonIdentifier; + } else { + if (drawn) + lastButtonIdentifier = -1; + else { + lastButtonIdentifier = buttonIdentifier; + clearAfterDraw = YES; + } + } + + drawn = NO; + [self setNeedsDisplay:YES]; +} + +- (void)drawRect:(NSRect)rect +{ + drawn = YES; + NSRect imageRect; + NSRect drawingRect; + imageRect.origin = NSZeroPoint; + imageRect.size = [remoteImage size]; + + int x = ([self bounds].size.width - [remoteImage size].width)/2; + int y = ([self bounds].size.height - [remoteImage size].height)/2; + + drawingRect.origin = NSMakePoint(x, y); + drawingRect.size = imageRect.size; + + [remoteImage drawInRect: drawingRect + fromRect: imageRect + operation: NSCompositeSourceOver + fraction: 1.0]; + + + if (lastButtonIdentifier == -1) { + return; + } + + DDHidAppleRemoteEventIdentifier buttonToSelect = lastButtonIdentifier; + + NSPoint buttonPos; + float opacity = 0.5; + + switch(buttonToSelect) { + case kDDHidRemoteButtonVolume_Plus: + buttonPos.x = 53; + buttonPos.y = 240; + break; + case kDDHidRemoteButtonVolume_Minus: + buttonPos.x = 53; + buttonPos.y = 180; + break; + case kDDHidRemoteButtonMenu_Hold: + opacity = 0.8; + case kDDHidRemoteButtonMenu: + buttonPos.x = 53; + buttonPos.y = 137; + clearAfterDraw = YES; + break; + case kDDHidRemoteButtonPlay_Sleep: + opacity = 0.8; + case kDDHidRemoteButtonPlay: + buttonPos.x = 53; + buttonPos.y = 210; + clearAfterDraw = YES; + break; + case kDDHidRemoteButtonRight_Hold: + opacity = 0.8; + buttonPos.x = 83; + buttonPos.y = 210; + break; + case kDDHidRemoteButtonRight: + buttonPos.x = 83; + buttonPos.y = 210; + clearAfterDraw = YES; + break; + case kDDHidRemoteButtonLeft_Hold: + opacity = 0.8; + buttonPos.x = 23; + buttonPos.y = 210; + break; + case kDDHidRemoteButtonLeft: + buttonPos.x = 23; + buttonPos.y = 210; + clearAfterDraw = YES; + break; + default: + break; + } + + float width = 20.0; + float height= 20.0; + NSRect r = NSMakeRect(buttonPos.x + x - (width/2), buttonPos.y + y - (height/2), width, height); + NSBezierPath* bp = [NSBezierPath bezierPathWithOvalInRect:r]; + + [[NSColor colorWithCalibratedRed:1.0 green:0.0 blue:0.0 alpha:opacity] set]; + [bp fill]; + if (clearAfterDraw) { + [self performSelector:@selector(clearAfterRedraw:) withObject:self afterDelay:0.1]; + } +} + +@end diff --git a/device_test/main.m b/device_test/main.m new file mode 100644 index 0000000..f05b99f --- /dev/null +++ b/device_test/main.m @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2007 Dave Dribin + * + * 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: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * 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. + */ + +#import + +int main(int argc, char *argv[]) +{ + return NSApplicationMain(argc, (const char **) argv); +} -- cgit v1.2.3