| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
From: Jerry LeVan <email@hidden>_______________________________________________
Date: March 3, 2004 9:15:10 AM EST
To: email@hidden
Subject: Thanks for the TableView hint.
Hi Eric,
I am working on a Postgresql Browser and read your reply to a questions
about detecting key events in a table view.
Your solution allowed me to replace:
if( !( ( [[NSApp currentEvent] keyCode] == ENTER_KEY_CODE) ||
([[NSApp currentEvent] keyCode] == RETURN_KEY_CODE) &&
([[NSApp currentEvent] modifierFlags] & NSShiftKeyMask )
)
) return NO;
with
NSString *characters = [[NSApp currentEvent] characters];
unichar ch = [characters characterAtIndex:0];
if( !( (ch == NSEnterCharacter) ||
(ch == NSCarriageReturnCharacter) &&
([[NSApp currentEvent] modifierFlags] & NSShiftKeyMask)
)
) return NO ;
I had felt uncomfortable with using keycodes. I had to write a
small program to get the return and enter keycodes...
( I intercept the enter key or shift return in the sql window to send the
current selection (or the line containing the cursor) to the postgres backend)
Jerry
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.