Cocoa Port:

- Fix bug where the default input profile was not being applied when user defaults contained no input mappings.
- Rename keyboard key name "-" to "- (Dash)".
This commit is contained in:
rogerman 2013-04-21 01:42:26 +00:00
parent c7846262c9
commit 5596351d8b
5 changed files with 15 additions and 5 deletions

View File

@ -371,7 +371,7 @@
<array> <array>
<dict> <dict>
<key>deviceInfoSummary</key> <key>deviceInfoSummary</key>
<string>Keyboard: -</string> <string>Keyboard: - (Dash)</string>
<key>deviceCode</key> <key>deviceCode</key>
<string>NSEventKeyboard</string> <string>NSEventKeyboard</string>
<key>deviceName</key> <key>deviceName</key>
@ -379,7 +379,7 @@
<key>elementCode</key> <key>elementCode</key>
<string>27</string> <string>27</string>
<key>elementName</key> <key>elementName</key>
<string>-</string> <string>- (Dash)</string>
<key>inputSettingsSummary</key> <key>inputSettingsSummary</key>
<string>0.50x Speed</string> <string>0.50x Speed</string>
<key>floatValue0</key> <key>floatValue0</key>

View File

@ -115,7 +115,7 @@
<key>50</key> <key>50</key>
<string>` (Accent)</string> <string>` (Accent)</string>
<key>27</key> <key>27</key>
<string>-</string> <string>- (Dash)</string>
<key>24</key> <key>24</key>
<string>=</string> <string>=</string>
<key>51</key> <key>51</key>

View File

@ -973,8 +973,6 @@ static std::tr1::unordered_map<unsigned short, std::string> keyboardNameTable; /
[self addMappingForIBAction:@selector(reset:) commandAttributes:&cmdReset]; [self addMappingForIBAction:@selector(reset:) commandAttributes:&cmdReset];
[self addMappingForIBAction:@selector(toggleGPUState:) commandAttributes:&cmdToggleGPUState]; [self addMappingForIBAction:@selector(toggleGPUState:) commandAttributes:&cmdToggleGPUState];
[self setMappingsWithMappings:[[NSUserDefaults standardUserDefaults] dictionaryForKey:@"Input_ControllerMappings"]];
return self; return self;
} }

View File

@ -545,6 +545,18 @@
// Set the default sound volume per user preferences. // Set the default sound volume per user preferences.
[prefWindowDelegate updateVolumeIcon:nil]; [prefWindowDelegate updateVolumeIcon:nil];
// Set up the user's default input settings.
NSDictionary *userMappings = [[NSUserDefaults standardUserDefaults] dictionaryForKey:@"Input_ControllerMappings"];
if (userMappings == nil)
{
NSDictionary *defaultKeyMappingsDict = [NSDictionary dictionaryWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"DefaultKeyMappings" ofType:@"plist"]];
NSArray *internalDefaultProfilesList = (NSArray *)[defaultKeyMappingsDict valueForKey:@"DefaultInputProfiles"];
userMappings = [(NSDictionary *)[internalDefaultProfilesList objectAtIndex:0] valueForKey:@"Mappings"];
}
[inputManager setMappingsWithMappings:userMappings];
// Set up the rest of the emulation-related user defaults.
[emuControl setupUserDefaults]; [emuControl setupUserDefaults];
} }