Ignore:
Timestamp:
07/20/09 06:03:42 (15 years ago)
Author:
Nicholas Riley
Message:

Support tabbing in preferences panel.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Cocoa/Pester/Source/NJRHotKeyField.m

    r355 r572  
    111111}
    112112
     113- (void)textDidEndEditing:(NSNotification *)notification;
     114{
     115    [self showKeyEquivalentAttributedStringFinalized: YES];
     116    [super textDidEndEditing: notification];
     117}
     118
    113119#pragma mark event handling
    114120
     
    125131        id delegate = [self delegate];
    126132        NSString *message = nil;
    127         if (delegate != nil && ![delegate hotKeyField: self shouldAcceptCharacter: [characters characterAtIndex: 0] modifierFlags: modifierFlags rejectionMessage: &message]) {
     133        unichar character = [characters characterAtIndex: 0];
     134        if (character == NSTabCharacter || character == NSBackTabCharacter)
     135            return;
     136        if (delegate != nil && ![delegate hotKeyField: self shouldAcceptCharacter: character modifierFlags: modifierFlags rejectionMessage: &message]) {
    128137            [self showStatus: message != nil ? message : @"key is unavailable for use"];
    129138        } else {
     
    137146- (BOOL)performKeyEquivalent:(NSEvent *)theEvent;
    138147{
    139     [self keyUp: theEvent];
     148    if ([[self window] firstResponder] == self)
     149        [self keyUp: theEvent];
    140150    return [super performKeyEquivalent: theEvent];
    141151}
Note: See TracChangeset for help on using the changeset viewer.