diff options
author | gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3> | 2009-06-24 17:45:38 +0000 |
---|---|---|
committer | gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3> | 2009-06-24 17:45:38 +0000 |
commit | b1934693eaebb17e111ae48882a285eb034ae027 (patch) | |
tree | 02191e8dbc478d2fab9234915caade108950600b /AppKit | |
parent | aedf95a5c89d5dc94884fca0917e3aa60dbccf5d (diff) |
[Author: dmaclach]
Fix up GTMHotKeyTextField so that it handles f-keys.
DELTA=372 (322 added, 8 deleted, 42 changed)
R=mrossetti
Diffstat (limited to 'AppKit')
19 files changed, 362 insertions, 45 deletions
diff --git a/AppKit/GTMHotKeyTextField.m b/AppKit/GTMHotKeyTextField.m index caa8152..864ba54 100644 --- a/AppKit/GTMHotKeyTextField.m +++ b/AppKit/GTMHotKeyTextField.m @@ -36,6 +36,7 @@ static CFStringRef kGTM_TISPropertyUnicodeKeyLayoutData = NULL; - (void)updateDisplayedPrettyString; + (BOOL)isValidHotKey:(NSDictionary *)hotKey; + (NSString *)displayStringForHotKey:(NSDictionary *)hotKey; ++ (BOOL)doesKeyCodeRequireModifier:(UInt16)keycode; @end @interface GTMHotKeyFieldEditor (PrivateMethods) @@ -321,19 +322,26 @@ static CFStringRef kGTM_TISPropertyUnicodeKeyLayoutData = NULL; // Modifiers unsigned int flags = [[hotKeyDict objectForKey:kGTMHotKeyModifierFlagsKey] unsignedIntValue]; - NSString *mods = [GTMHotKeyTextField stringForModifierFlags:flags]; - if (!mods || ![mods length]) return nil; + NSString *mods = [[self class] stringForModifierFlags:flags]; + if (flags && ![mods length]) return nil; // Handle double modifier case if ([[hotKeyDict objectForKey:kGTMHotKeyDoubledModifierKey] boolValue]) { return [NSString stringWithFormat:@"%@ + %@", mods, mods]; } // Keycode + NSNumber *keyCodeNumber = [hotKeyDict objectForKey:kGTMHotKeyKeyCodeKey]; + if (!keyCodeNumber) return nil; unsigned int keycode - = [[hotKeyDict objectForKey:kGTMHotKeyKeyCodeKey] unsignedIntValue]; - NSString *keystroke = [GTMHotKeyTextField stringForKeycode:keycode - useGlyph:NO - resourceBundle:bundle]; + = [keyCodeNumber unsignedIntValue]; + NSString *keystroke = [[self class] stringForKeycode:keycode + useGlyph:NO + resourceBundle:bundle]; if (!keystroke || ![keystroke length]) return nil; + if ([[self class] doesKeyCodeRequireModifier:keycode] + && ![mods length]) { + return nil; + } + return [NSString stringWithFormat:@"%@%@", mods, keystroke]; } @@ -425,6 +433,36 @@ static CFStringRef kGTM_TISPropertyUnicodeKeyLayoutData = NULL; #pragma mark Useful String Class Methods ++ (BOOL)doesKeyCodeRequireModifier:(UInt16)keycode { + BOOL doesRequire = YES; + switch(keycode) { + // These are the keycodes that map to the + //unichars in the associated comment. + case 122: // NSF1FunctionKey + case 120: // NSF2FunctionKey + case 99: // NSF3FunctionKey + case 118: // NSF4FunctionKey + case 96: // NSF5FunctionKey + case 97: // NSF6FunctionKey + case 98: // NSF7FunctionKey + case 100: // NSF8FunctionKey + case 101: // NSF9FunctionKey + case 109: // NSF10FunctionKey + case 103: // NSF11FunctionKey + case 111: // NSF12FunctionKey + case 105: // NSF13FunctionKey + case 107: // NSF14FunctionKey + case 113: // NSF15FunctionKey + case 106: // NSF16FunctionKey + doesRequire = NO; + break; + default: + doesRequire = YES; + break; + } + return doesRequire; +} + // These are not in a category on NSString because this class could be used // within multiple preference panes at the same time. If we put it in a category // it would require setting up some magic so that the categories didn't conflict @@ -440,7 +478,7 @@ static CFStringRef kGTM_TISPropertyUnicodeKeyLayoutData = NULL; if (flags & NSAlternateKeyMask) modChars[charCount++] = kOptionUnicode; if (flags & NSShiftKeyMask) modChars[charCount++] = kShiftUnicode; if (flags & NSCommandKeyMask) modChars[charCount++] = kCommandUnicode; - if (charCount == 0) return nil; + if (charCount == 0) return @""; return [NSString stringWithCharacters:modChars length:charCount]; } @@ -462,22 +500,22 @@ static CFStringRef kGTM_TISPropertyUnicodeKeyLayoutData = NULL; case 124: key = NSRightArrowFunctionKey; break; case 125: key = NSDownArrowFunctionKey; break; case 126: key = NSUpArrowFunctionKey; break; - case 122: key = NSF1FunctionKey; break; - case 120: key = NSF2FunctionKey; break; - case 99: key = NSF3FunctionKey; break; - case 118: key = NSF4FunctionKey; break; - case 96: key = NSF5FunctionKey; break; - case 97: key = NSF6FunctionKey; break; - case 98: key = NSF7FunctionKey; break; - case 100: key = NSF8FunctionKey; break; - case 101: key = NSF9FunctionKey; break; - case 109: key = NSF10FunctionKey; break; - case 103: key = NSF11FunctionKey; break; - case 111: key = NSF12FunctionKey; break; - case 105: key = NSF13FunctionKey; break; - case 107: key = NSF14FunctionKey; break; - case 113: key = NSF15FunctionKey; break; - case 106: key = NSF16FunctionKey; break; + case 122: key = NSF1FunctionKey; localizedKey = @"F1"; break; + case 120: key = NSF2FunctionKey; localizedKey = @"F2"; break; + case 99: key = NSF3FunctionKey; localizedKey = @"F3"; break; + case 118: key = NSF4FunctionKey; localizedKey = @"F4"; break; + case 96: key = NSF5FunctionKey; localizedKey = @"F5"; break; + case 97: key = NSF6FunctionKey; localizedKey = @"F6"; break; + case 98: key = NSF7FunctionKey; localizedKey = @"F7"; break; + case 100: key = NSF8FunctionKey; localizedKey = @"F8"; break; + case 101: key = NSF9FunctionKey; localizedKey = @"F9"; break; + case 109: key = NSF10FunctionKey; localizedKey = @"F10"; break; + case 103: key = NSF11FunctionKey; localizedKey = @"F11"; break; + case 111: key = NSF12FunctionKey; localizedKey = @"F12"; break; + case 105: key = NSF13FunctionKey; localizedKey = @"F13"; break; + case 107: key = NSF14FunctionKey; localizedKey = @"F14"; break; + case 113: key = NSF15FunctionKey; localizedKey = @"F15"; break; + case 106: key = NSF16FunctionKey; localizedKey = @"F16"; break; // Forward delete is a terrible name so we'll use the glyph Apple puts on // their current keyboards case 117: key = 0x2326; break; @@ -793,34 +831,29 @@ GTMOBJECT_SINGLETON_BOILERPLATE(GTMHotKeyFieldEditor, sharedHotKeyFieldEditor) // Private do method that tell us to ignore certain events - (BOOL)shouldBypassEvent:(NSEvent *)theEvent { + BOOL bypass = NO; UInt16 keyCode = [theEvent keyCode]; NSUInteger modifierFlags = [theEvent modifierFlags] & NSDeviceIndependentModifierFlagsMask; - // Ignore all events containing tabs. They have special meaning to fields - // and some (Cmd Tab variants) are always consumed by the Dock, so users - // just shouldn't be able to use them. if (keyCode == 48) { // Tab + // Ignore all events that the dock cares about // Just to be extra clear if the user is trying to use Dock hotkeys beep // at them if ((modifierFlags == NSCommandKeyMask) || (modifierFlags == (NSCommandKeyMask | NSShiftKeyMask))) { NSBeep(); + bypass = YES; } - return YES; + } else if ((keyCode == 12) && (modifierFlags == NSCommandKeyMask)) { + // Don't eat Cmd-Q. Users could have it as a hotkey, but its more likely + // they're trying to quit + bypass = YES; + } else if ((keyCode == 13) && (modifierFlags == NSCommandKeyMask)) { + // Same for Cmd-W, user is probably trying to close the window + bypass = YES; } - - // Don't eat Cmd-Q. Users could have it as a hotkey, but its more likely - // they're trying to quit - if ((keyCode == 12) && (modifierFlags == NSCommandKeyMask)) { - return YES; - } - // Same for Cmd-W, user is probably trying to close the window - if ((keyCode == 13) && (modifierFlags == NSCommandKeyMask)) { - return YES; - } - - return NO; + return bypass; } // Private method that turns events into strings and dictionaries for our @@ -892,9 +925,15 @@ GTMOBJECT_SINGLETON_BOILERPLATE(GTMHotKeyFieldEditor, sharedHotKeyFieldEditor) // If the event has no modifiers do nothing NSUInteger allModifiers = (NSCommandKeyMask | NSAlternateKeyMask | NSControlKeyMask | NSShiftKeyMask); - if (!(flags & allModifiers)) return nil; - // If the event has high bits in keycode do nothing - if (keycode & 0xFF00) return nil; + + BOOL requiresModifiers + = [GTMHotKeyTextField doesKeyCodeRequireModifier:keycode]; + if (requiresModifiers) { + // If we aren't a function key, and have no modifiers do nothing. + if (!(flags & allModifiers)) return nil; + // If the event has high bits in keycode do nothing + if (keycode & 0xFF00) return nil; + } // Clean the flags to only contain things we care about UInt32 cleanFlags = 0; diff --git a/AppKit/GTMHotKeyTextFieldLocalizations/da.lproj/GTMHotKeyTextField.strings b/AppKit/GTMHotKeyTextFieldLocalizations/da.lproj/GTMHotKeyTextField.strings index cf7cbf5..66be1af 100644 --- a/AppKit/GTMHotKeyTextFieldLocalizations/da.lproj/GTMHotKeyTextField.strings +++ b/AppKit/GTMHotKeyTextFieldLocalizations/da.lproj/GTMHotKeyTextField.strings @@ -47,3 +47,19 @@ "Keypad 9" = "Keypad 9"; "Keypad 0" = "Keypad 0"; +"F1" = "F1"; +"F2" = "F2"; +"F3" = "F3"; +"F4" = "F4"; +"F5" = "F5"; +"F6" = "F6"; +"F7" = "F7"; +"F8" = "F8"; +"F9" = "F9"; +"F10" = "F10"; +"F11" = "F11"; +"F12" = "F12"; +"F13" = "F13"; +"F14" = "F14"; +"F15" = "F15"; +"F16" = "F16"; diff --git a/AppKit/GTMHotKeyTextFieldLocalizations/de.lproj/GTMHotKeyTextField.strings b/AppKit/GTMHotKeyTextFieldLocalizations/de.lproj/GTMHotKeyTextField.strings index afc9184..d80f699 100644 --- a/AppKit/GTMHotKeyTextFieldLocalizations/de.lproj/GTMHotKeyTextField.strings +++ b/AppKit/GTMHotKeyTextFieldLocalizations/de.lproj/GTMHotKeyTextField.strings @@ -47,4 +47,19 @@ "Keypad 9" = "Tastenfeld 9"; "Keypad 0" = "Tastenfeld 0"; - +"F1" = "F1"; +"F2" = "F2"; +"F3" = "F3"; +"F4" = "F4"; +"F5" = "F5"; +"F6" = "F6"; +"F7" = "F7"; +"F8" = "F8"; +"F9" = "F9"; +"F10" = "F10"; +"F11" = "F11"; +"F12" = "F12"; +"F13" = "F13"; +"F14" = "F14"; +"F15" = "F15"; +"F16" = "F16"; diff --git a/AppKit/GTMHotKeyTextFieldLocalizations/en.lproj/GTMHotKeyTextField.strings b/AppKit/GTMHotKeyTextFieldLocalizations/en.lproj/GTMHotKeyTextField.strings index 0f300f1..d5c102c 100644 --- a/AppKit/GTMHotKeyTextFieldLocalizations/en.lproj/GTMHotKeyTextField.strings +++ b/AppKit/GTMHotKeyTextFieldLocalizations/en.lproj/GTMHotKeyTextField.strings @@ -46,3 +46,20 @@ "Keypad 8" = "Keypad 8"; "Keypad 9" = "Keypad 9"; "Keypad 0" = "Keypad 0"; + +"F1" = "F1"; +"F2" = "F2"; +"F3" = "F3"; +"F4" = "F4"; +"F5" = "F5"; +"F6" = "F6"; +"F7" = "F7"; +"F8" = "F8"; +"F9" = "F9"; +"F10" = "F10"; +"F11" = "F11"; +"F12" = "F12"; +"F13" = "F13"; +"F14" = "F14"; +"F15" = "F15"; +"F16" = "F16"; diff --git a/AppKit/GTMHotKeyTextFieldLocalizations/es.lproj/GTMHotKeyTextField.strings b/AppKit/GTMHotKeyTextFieldLocalizations/es.lproj/GTMHotKeyTextField.strings index f3ce786..fa26173 100644 --- a/AppKit/GTMHotKeyTextFieldLocalizations/es.lproj/GTMHotKeyTextField.strings +++ b/AppKit/GTMHotKeyTextFieldLocalizations/es.lproj/GTMHotKeyTextField.strings @@ -47,3 +47,19 @@ "Keypad 9" = "Teclado 9"; "Keypad 0" = "Teclado 0"; +"F1" = "F1"; +"F2" = "F2"; +"F3" = "F3"; +"F4" = "F4"; +"F5" = "F5"; +"F6" = "F6"; +"F7" = "F7"; +"F8" = "F8"; +"F9" = "F9"; +"F10" = "F10"; +"F11" = "F11"; +"F12" = "F12"; +"F13" = "F13"; +"F14" = "F14"; +"F15" = "F15"; +"F16" = "F16"; diff --git a/AppKit/GTMHotKeyTextFieldLocalizations/fi.lproj/GTMHotKeyTextField.strings b/AppKit/GTMHotKeyTextFieldLocalizations/fi.lproj/GTMHotKeyTextField.strings index 1c19124..be5d106 100644 --- a/AppKit/GTMHotKeyTextFieldLocalizations/fi.lproj/GTMHotKeyTextField.strings +++ b/AppKit/GTMHotKeyTextFieldLocalizations/fi.lproj/GTMHotKeyTextField.strings @@ -46,3 +46,20 @@ "Keypad 8" = "Näppäimet 8"; "Keypad 9" = "Näppäimet 9"; "Keypad 0" = "Näppäimet 0"; + +"F1" = "F1"; +"F2" = "F2"; +"F3" = "F3"; +"F4" = "F4"; +"F5" = "F5"; +"F6" = "F6"; +"F7" = "F7"; +"F8" = "F8"; +"F9" = "F9"; +"F10" = "F10"; +"F11" = "F11"; +"F12" = "F12"; +"F13" = "F13"; +"F14" = "F14"; +"F15" = "F15"; +"F16" = "F16"; diff --git a/AppKit/GTMHotKeyTextFieldLocalizations/fr.lproj/GTMHotKeyTextField.strings b/AppKit/GTMHotKeyTextFieldLocalizations/fr.lproj/GTMHotKeyTextField.strings index 2641ba2..38a0b81 100644 --- a/AppKit/GTMHotKeyTextFieldLocalizations/fr.lproj/GTMHotKeyTextField.strings +++ b/AppKit/GTMHotKeyTextFieldLocalizations/fr.lproj/GTMHotKeyTextField.strings @@ -46,3 +46,20 @@ "Keypad 8" = "Clavier 8"; "Keypad 9" = "Clavier 9"; "Keypad 0" = "Clavier 0"; + +"F1" = "F1"; +"F2" = "F2"; +"F3" = "F3"; +"F4" = "F4"; +"F5" = "F5"; +"F6" = "F6"; +"F7" = "F7"; +"F8" = "F8"; +"F9" = "F9"; +"F10" = "F10"; +"F11" = "F11"; +"F12" = "F12"; +"F13" = "F13"; +"F14" = "F14"; +"F15" = "F15"; +"F16" = "F16"; diff --git a/AppKit/GTMHotKeyTextFieldLocalizations/it.lproj/GTMHotKeyTextField.strings b/AppKit/GTMHotKeyTextFieldLocalizations/it.lproj/GTMHotKeyTextField.strings index 81f45d1..1239fe6 100644 --- a/AppKit/GTMHotKeyTextFieldLocalizations/it.lproj/GTMHotKeyTextField.strings +++ b/AppKit/GTMHotKeyTextFieldLocalizations/it.lproj/GTMHotKeyTextField.strings @@ -47,3 +47,19 @@ "Keypad 9" = "Tastiera 9"; "Keypad 0" = "Tastiera 0"; +"F1" = "F1"; +"F2" = "F2"; +"F3" = "F3"; +"F4" = "F4"; +"F5" = "F5"; +"F6" = "F6"; +"F7" = "F7"; +"F8" = "F8"; +"F9" = "F9"; +"F10" = "F10"; +"F11" = "F11"; +"F12" = "F12"; +"F13" = "F13"; +"F14" = "F14"; +"F15" = "F15"; +"F16" = "F16"; diff --git a/AppKit/GTMHotKeyTextFieldLocalizations/ja.lproj/GTMHotKeyTextField.strings b/AppKit/GTMHotKeyTextFieldLocalizations/ja.lproj/GTMHotKeyTextField.strings index 0f38a35..f66a5b0 100644 --- a/AppKit/GTMHotKeyTextFieldLocalizations/ja.lproj/GTMHotKeyTextField.strings +++ b/AppKit/GTMHotKeyTextFieldLocalizations/ja.lproj/GTMHotKeyTextField.strings @@ -46,3 +46,20 @@ "Keypad 8" = "キーパッド 8"; "Keypad 9" = "キーパッド 9"; "Keypad 0" = "キーパッド 0"; + +"F1" = "F1"; +"F2" = "F2"; +"F3" = "F3"; +"F4" = "F4"; +"F5" = "F5"; +"F6" = "F6"; +"F7" = "F7"; +"F8" = "F8"; +"F9" = "F9"; +"F10" = "F10"; +"F11" = "F11"; +"F12" = "F12"; +"F13" = "F13"; +"F14" = "F14"; +"F15" = "F15"; +"F16" = "F16"; diff --git a/AppKit/GTMHotKeyTextFieldLocalizations/ko.lproj/GTMHotKeyTextField.strings b/AppKit/GTMHotKeyTextFieldLocalizations/ko.lproj/GTMHotKeyTextField.strings index e22c692..c404ca4 100644 --- a/AppKit/GTMHotKeyTextFieldLocalizations/ko.lproj/GTMHotKeyTextField.strings +++ b/AppKit/GTMHotKeyTextFieldLocalizations/ko.lproj/GTMHotKeyTextField.strings @@ -47,3 +47,19 @@ "Keypad 9" = "키패드 9"; "Keypad 0" = "키패드 0"; +"F1" = "F1"; +"F2" = "F2"; +"F3" = "F3"; +"F4" = "F4"; +"F5" = "F5"; +"F6" = "F6"; +"F7" = "F7"; +"F8" = "F8"; +"F9" = "F9"; +"F10" = "F10"; +"F11" = "F11"; +"F12" = "F12"; +"F13" = "F13"; +"F14" = "F14"; +"F15" = "F15"; +"F16" = "F16"; diff --git a/AppKit/GTMHotKeyTextFieldLocalizations/nl.lproj/GTMHotKeyTextField.strings b/AppKit/GTMHotKeyTextFieldLocalizations/nl.lproj/GTMHotKeyTextField.strings index 958783e..79f642b 100644 --- a/AppKit/GTMHotKeyTextFieldLocalizations/nl.lproj/GTMHotKeyTextField.strings +++ b/AppKit/GTMHotKeyTextFieldLocalizations/nl.lproj/GTMHotKeyTextField.strings @@ -46,3 +46,20 @@ "Keypad 8" = "Toetsen 8"; "Keypad 9" = "Toetsen 9"; "Keypad 0" = "Toetsen 0"; + +"F1" = "F1"; +"F2" = "F2"; +"F3" = "F3"; +"F4" = "F4"; +"F5" = "F5"; +"F6" = "F6"; +"F7" = "F7"; +"F8" = "F8"; +"F9" = "F9"; +"F10" = "F10"; +"F11" = "F11"; +"F12" = "F12"; +"F13" = "F13"; +"F14" = "F14"; +"F15" = "F15"; +"F16" = "F16"; diff --git a/AppKit/GTMHotKeyTextFieldLocalizations/no.lproj/GTMHotKeyTextField.strings b/AppKit/GTMHotKeyTextFieldLocalizations/no.lproj/GTMHotKeyTextField.strings index a9d0052..c564b23 100644 --- a/AppKit/GTMHotKeyTextFieldLocalizations/no.lproj/GTMHotKeyTextField.strings +++ b/AppKit/GTMHotKeyTextFieldLocalizations/no.lproj/GTMHotKeyTextField.strings @@ -46,3 +46,20 @@ "Keypad 8" = "Tastatur 8"; "Keypad 9" = "Tastatur 9"; "Keypad 0" = "Tastatur 0"; + +"F1" = "F1"; +"F2" = "F2"; +"F3" = "F3"; +"F4" = "F4"; +"F5" = "F5"; +"F6" = "F6"; +"F7" = "F7"; +"F8" = "F8"; +"F9" = "F9"; +"F10" = "F10"; +"F11" = "F11"; +"F12" = "F12"; +"F13" = "F13"; +"F14" = "F14"; +"F15" = "F15"; +"F16" = "F16"; diff --git a/AppKit/GTMHotKeyTextFieldLocalizations/pl.lproj/GTMHotKeyTextField.strings b/AppKit/GTMHotKeyTextFieldLocalizations/pl.lproj/GTMHotKeyTextField.strings index 01e7257..a55c59e 100644 --- a/AppKit/GTMHotKeyTextFieldLocalizations/pl.lproj/GTMHotKeyTextField.strings +++ b/AppKit/GTMHotKeyTextFieldLocalizations/pl.lproj/GTMHotKeyTextField.strings @@ -47,3 +47,19 @@ "Keypad 9" = "Klawiatura 9"; "Keypad 0" = "Klawiatura 0"; +"F1" = "F1"; +"F2" = "F2"; +"F3" = "F3"; +"F4" = "F4"; +"F5" = "F5"; +"F6" = "F6"; +"F7" = "F7"; +"F8" = "F8"; +"F9" = "F9"; +"F10" = "F10"; +"F11" = "F11"; +"F12" = "F12"; +"F13" = "F13"; +"F14" = "F14"; +"F15" = "F15"; +"F16" = "F16"; diff --git a/AppKit/GTMHotKeyTextFieldLocalizations/pt.lproj/GTMHotKeyTextField.strings b/AppKit/GTMHotKeyTextFieldLocalizations/pt.lproj/GTMHotKeyTextField.strings index 928a4a5..e80fd87 100644 --- a/AppKit/GTMHotKeyTextFieldLocalizations/pt.lproj/GTMHotKeyTextField.strings +++ b/AppKit/GTMHotKeyTextFieldLocalizations/pt.lproj/GTMHotKeyTextField.strings @@ -47,3 +47,19 @@ "Keypad 9" = "Teclado 9"; "Keypad 0" = "Teclado 0"; +"F1" = "F1"; +"F2" = "F2"; +"F3" = "F3"; +"F4" = "F4"; +"F5" = "F5"; +"F6" = "F6"; +"F7" = "F7"; +"F8" = "F8"; +"F9" = "F9"; +"F10" = "F10"; +"F11" = "F11"; +"F12" = "F12"; +"F13" = "F13"; +"F14" = "F14"; +"F15" = "F15"; +"F16" = "F16"; diff --git a/AppKit/GTMHotKeyTextFieldLocalizations/ru.lproj/GTMHotKeyTextField.strings b/AppKit/GTMHotKeyTextFieldLocalizations/ru.lproj/GTMHotKeyTextField.strings index 06ee91a..3bb1059 100644 --- a/AppKit/GTMHotKeyTextFieldLocalizations/ru.lproj/GTMHotKeyTextField.strings +++ b/AppKit/GTMHotKeyTextFieldLocalizations/ru.lproj/GTMHotKeyTextField.strings @@ -47,3 +47,19 @@ "Keypad 9" = "Клавиатура 9"; "Keypad 0" = "Клавиатура 0"; +"F1" = "F1"; +"F2" = "F2"; +"F3" = "F3"; +"F4" = "F4"; +"F5" = "F5"; +"F6" = "F6"; +"F7" = "F7"; +"F8" = "F8"; +"F9" = "F9"; +"F10" = "F10"; +"F11" = "F11"; +"F12" = "F12"; +"F13" = "F13"; +"F14" = "F14"; +"F15" = "F15"; +"F16" = "F16"; diff --git a/AppKit/GTMHotKeyTextFieldLocalizations/sv.lproj/GTMHotKeyTextField.strings b/AppKit/GTMHotKeyTextFieldLocalizations/sv.lproj/GTMHotKeyTextField.strings index e61651a..eb97468 100644 --- a/AppKit/GTMHotKeyTextFieldLocalizations/sv.lproj/GTMHotKeyTextField.strings +++ b/AppKit/GTMHotKeyTextFieldLocalizations/sv.lproj/GTMHotKeyTextField.strings @@ -47,3 +47,19 @@ "Keypad 9" = "Knappsatsen 9"; "Keypad 0" = "Knappsatsen 0"; +"F1" = "F1"; +"F2" = "F2"; +"F3" = "F3"; +"F4" = "F4"; +"F5" = "F5"; +"F6" = "F6"; +"F7" = "F7"; +"F8" = "F8"; +"F9" = "F9"; +"F10" = "F10"; +"F11" = "F11"; +"F12" = "F12"; +"F13" = "F13"; +"F14" = "F14"; +"F15" = "F15"; +"F16" = "F16"; diff --git a/AppKit/GTMHotKeyTextFieldLocalizations/zh_CN.lproj/GTMHotKeyTextField.strings b/AppKit/GTMHotKeyTextFieldLocalizations/zh_CN.lproj/GTMHotKeyTextField.strings index c575556..73f541c 100644 --- a/AppKit/GTMHotKeyTextFieldLocalizations/zh_CN.lproj/GTMHotKeyTextField.strings +++ b/AppKit/GTMHotKeyTextFieldLocalizations/zh_CN.lproj/GTMHotKeyTextField.strings @@ -46,3 +46,20 @@ "Keypad 8" = "键盘 8"; "Keypad 9" = "键盘 9"; "Keypad 0" = "键盘 0"; + +"F1" = "F1"; +"F2" = "F2"; +"F3" = "F3"; +"F4" = "F4"; +"F5" = "F5"; +"F6" = "F6"; +"F7" = "F7"; +"F8" = "F8"; +"F9" = "F9"; +"F10" = "F10"; +"F11" = "F11"; +"F12" = "F12"; +"F13" = "F13"; +"F14" = "F14"; +"F15" = "F15"; +"F16" = "F16"; diff --git a/AppKit/GTMHotKeyTextFieldLocalizations/zh_TW.lproj/GTMHotKeyTextField.strings b/AppKit/GTMHotKeyTextFieldLocalizations/zh_TW.lproj/GTMHotKeyTextField.strings index 5a0e8f4..b5565bf 100644 --- a/AppKit/GTMHotKeyTextFieldLocalizations/zh_TW.lproj/GTMHotKeyTextField.strings +++ b/AppKit/GTMHotKeyTextFieldLocalizations/zh_TW.lproj/GTMHotKeyTextField.strings @@ -47,3 +47,19 @@ "Keypad 9" = "鍵盤 9"; "Keypad 0" = "鍵盤 0"; +"F1" = "F1"; +"F2" = "F2"; +"F3" = "F3"; +"F4" = "F4"; +"F5" = "F5"; +"F6" = "F6"; +"F7" = "F7"; +"F8" = "F8"; +"F9" = "F9"; +"F10" = "F10"; +"F11" = "F11"; +"F12" = "F12"; +"F13" = "F13"; +"F14" = "F14"; +"F15" = "F15"; +"F16" = "F16"; diff --git a/AppKit/GTMHotKeyTextFieldTest.m b/AppKit/GTMHotKeyTextFieldTest.m index 2036968..21d1b5a 100644 --- a/AppKit/GTMHotKeyTextFieldTest.m +++ b/AppKit/GTMHotKeyTextFieldTest.m @@ -153,12 +153,12 @@ kGTMHotKeyModifierFlagsKey, nil]; STAssertNotNil(hkDict, nil); - STAssertNotNil([GTMHotKeyTextField displayStringForHotKey:hkDict], nil); + STAssertNil([GTMHotKeyTextField displayStringForHotKey:hkDict], nil); hkDict = [NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithBool:NO], kGTMHotKeyDoubledModifierKey, - [NSNumber numberWithUnsignedInt:114], + [NSNumber numberWithUnsignedInt:'A'], kGTMHotKeyKeyCodeKey, nil]; STAssertNotNil(hkDict, nil); |