diff options
| author | SND\weimingzhi_cp <SND\weimingzhi_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2010-07-29 00:34:36 +0000 |
|---|---|---|
| committer | SND\weimingzhi_cp <SND\weimingzhi_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2010-07-29 00:34:36 +0000 |
| commit | 8d4373b70d74ff5903c13780f397bdbaa5ad4991 (patch) | |
| tree | a329eae7b9c41010d23dd41300a3b1317ccbca9f /macosx/plugins/HIDInput/src/PadView.m | |
| parent | df065b4bf4205db561a5fe7d5652352f6046e40f (diff) | |
| download | pcsxr-8d4373b70d74ff5903c13780f397bdbaa5ad4991.tar.gz | |
implemented config dialog for DFInput on OSX, removed HIDInput.
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@55259 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'macosx/plugins/HIDInput/src/PadView.m')
| -rw-r--r-- | macosx/plugins/HIDInput/src/PadView.m | 113 |
1 files changed, 0 insertions, 113 deletions
diff --git a/macosx/plugins/HIDInput/src/PadView.m b/macosx/plugins/HIDInput/src/PadView.m deleted file mode 100644 index 4ab17ce1..00000000 --- a/macosx/plugins/HIDInput/src/PadView.m +++ /dev/null @@ -1,113 +0,0 @@ -/*************************************************************************** - PadView.m - HIDInput - - Created by Gil Pedersen on Thu May 27 2004. - Copyright (c) 2004 Gil Pedersen. - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. See also the license.txt file for * - * additional informations. * - * * - ***************************************************************************/ - -#import "PadView.h" - -@implementation PadView - -- (id)initWithFrame:(NSRect)frameRect -{ - if ((self = [super initWithFrame:frameRect]) != nil) { - // Add initialization code here - //NSLog(@"rect: %f,%f;%f,%f\n", frameRect.origin.x, frameRect.origin.y, frameRect.size.width, frameRect.size.height); - //controller = [[ControllerList alloc] initWithConfig]; - //setCurrentController:0]; - controller = [[[KeyConfig current] controllerList] retain]; - } - return self; -} - -- (void)dealloc -{ - [controller release]; - - [super dealloc]; -} - -- (void)drawRect:(NSRect)rect -{ - //NSLog(@"drawRect: %f,%f;%f,%f\n", rect.origin.x, rect.origin.y, rect.size.width, rect.size.height); -} - -- (IBAction)setType:(id)sender -{ - [[KeyConfig current] setCurrentType:[[controller controllerTypes] objectAtIndex:[sender indexOfSelectedItem]] - player:[controller currentController]]; - //[controller setType:[[controller controllerTypes] objectAtIndex:[sender indexOfSelectedItem]]]; - [tableView reloadData]; -} - -- (void)setController:(int)which -{ - int i; - [controller setCurrentController:which]; - [tableView setDataSource:controller]; - - /* create type popup menu */ - [typeMenu removeAllItems]; - NSArray *typeList = [controller controllerTypes]; - NSString *current = [[KeyConfig current] currentTypeForPlayer:which]; - - for (i=0; i<[typeList count]; i++) { - NSString *name = [typeList objectAtIndex:i]; - if ([name isEqualToString:@"-"]) { - [[typeMenu menu] addItem:[NSMenuItem separatorItem]]; - } else { - [typeMenu addItemWithTitle:NSLocalizedString(name, @"")]; - if ([name isEqualToString:current]) - [typeMenu selectItemAtIndex:i]; - } - if (0==i) - [typeMenu selectItemAtIndex:0]; - } - [self setType:typeMenu]; - - //[tableView reloadData]; -} - - -- (BOOL)control:(NSControl *)control textShouldBeginEditing:(NSText *)fieldEditor -{ - return false; -} - -/* handles key events on the pad list */ -- (void)keyDown:(NSEvent *)theEvent -{ - int key = [theEvent keyCode]; - - if ([[theEvent window] firstResponder] == tableView) { - if (key == 51 || key == 117) { - // delete keys - remove the mappings for the selected item - KeyConfig *config = [KeyConfig current]; - int player = [[config controllerList] currentController]; - NSString *name = [[config controllerList] elementNameAtIndex:[tableView selectedRow] type:[config currentTypeForPlayer:player]]; - [config removeMappingsForElement:name player:player]; - [tableView reloadData]; - return; - } else if (key == 36) { - // return key - configure the selected item - [tableView editColumn:[tableView columnWithIdentifier:@"button"] row:[tableView selectedRow] withEvent:nil select:YES]; - return; - } - } - - [super keyDown:theEvent]; -} - -@end |
