Fwd: Thanks for the TableView hint.
Fwd: Thanks for the TableView hint.
- Subject: Fwd: Thanks for the TableView hint.
- From: Jerry LeVan <email@hidden>
- Date: Wed, 3 Mar 2004 09:25:24 -0500
Eric's Mail server wont let me in ;(
Begin forwarded message:
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
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.