From b61c01f4d7cf69ba0cac74afd18ec9f05d5526eb Mon Sep 17 00:00:00 2001 From: "gtm.daemon" Date: Thu, 30 Sep 2010 17:06:06 +0000 Subject: [Author: dmaclach] Allow tabbing to move around dialog, and add a description method. R=thomasvl DELTA=11 (10 added, 0 deleted, 1 changed) --- AppKit/GTMHotKeyTextField.m | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'AppKit') diff --git a/AppKit/GTMHotKeyTextField.m b/AppKit/GTMHotKeyTextField.m index 8c8703d..df5853a 100644 --- a/AppKit/GTMHotKeyTextField.m +++ b/AppKit/GTMHotKeyTextField.m @@ -94,6 +94,12 @@ static CFStringRef kGTM_TISPropertyUnicodeKeyLayoutData = NULL; return NSCopyObject(self, 0, zone); } +- (NSString *)description { + return [NSString stringWithFormat:@"<%@ %p> - %@", + [self class], self, + [GTMHotKeyTextFieldCell displayStringForHotKey:self]]; +} + @end @implementation GTMHotKeyTextField @@ -672,7 +678,11 @@ GTMOBJECT_SINGLETON_BOILERPLATE(GTMHotKeyFieldEditor, sharedHotKeyFieldEditor) (modifierFlags == (NSCommandKeyMask | NSShiftKeyMask))) { NSBeep(); bypass = YES; + } else if (modifierFlags == 0 || modifierFlags == NSShiftKeyMask) { + // Probably attempting to tab around the dialog. + bypass = 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 -- cgit v1.2.3