mirror of
https://github.com/zydeco/minivmac4ios.git
synced 2024-11-22 03:30:59 +00:00
better matching of default keyboard layout
This commit is contained in:
parent
eeda15e20e
commit
32734a3226
@ -50,17 +50,15 @@ NSString * const MNVMDidEjectDiskNotification = @"MNVMDidEjectDisk";
|
||||
|
||||
- (void)initDefaults {
|
||||
// default settings
|
||||
NSString *defaultKeyboardLayout = @"US.nfkeyboardlayout";
|
||||
NSLocale *locale = [NSLocale currentLocale];
|
||||
if ([[locale objectForKey:NSLocaleCountryCode] isEqualToString:@"GB"]) {
|
||||
defaultKeyboardLayout = @"British.nfkeyboardlayout";
|
||||
} else if ([[locale objectForKey:NSLocaleLanguageCode] isEqualToString:@"es"]) {
|
||||
defaultKeyboardLayout = @"Spanish.nfkeyboardlayout";
|
||||
}
|
||||
NSDictionary *layoutForLanguage = @{@"en": @"British.nfkeyboardlayout",
|
||||
@"es": @"Spanish.nfkeyboardlayout",
|
||||
@"en-US": @"US.nfkeyboardlayout"};
|
||||
NSString *firstLanguage = [NSBundle preferredLocalizationsFromArray:layoutForLanguage.allKeys].firstObject;
|
||||
NSDictionary *defaultValues = @{@"trackpad": @([UIDevice currentDevice].userInterfaceIdiom != UIUserInterfaceIdiomPad),
|
||||
@"frameskip": @(0),
|
||||
@"keyboardLayout": defaultKeyboardLayout
|
||||
@"keyboardLayout": layoutForLanguage[firstLanguage]
|
||||
};
|
||||
|
||||
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
|
||||
[defaults registerDefaults:defaultValues];
|
||||
[defaults setValue:@(WantInitSpeedValue) forKey:@"speedValue"];
|
||||
|
Loading…
Reference in New Issue
Block a user