One Quickie


Detecting arrow keys (NSView->General)
- (void) keyDown: (NSEvent *) event
{
    NSString *characters;
    characters = [event characters];

    unichar character;
    character = [characters characterAtIndex: 0];

    if (character == NSRightArrowFunctionKey) {
        [self moveSelectedBlockBy: 1];

    } else if (character == NSLeftArrowFunctionKey) {
        [self moveSelectedBlockBy: -1];

    }  ... and look at whatever other keys you want
}



borkware home | products | miniblog | rants | quickies | cocoaheads
Advanced Mac OS X Programming book

webmonster@borkware.com