Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Fwd: Thanks for the TableView hint.



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.




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.