Re: Distinguishing displayable vs. functional keys in an event?
Re: Distinguishing displayable vs. functional keys in an event?
- Subject: Re: Distinguishing displayable vs. functional keys in an event?
- From: Charles Jolley <email@hidden>
- Date: Tue, 18 Jun 2002 21:48:53 -0500
Hi Dan:
Depending on your situation, it might just be easier to override the
actual Responder methods that get invoked based on the key pressed. If
you are overriding a text view, for example, (about the only Cocoa
control that does much text handling) all keys that contribute to the
text itself will be sent to the insertText: method. Others will invoke
various sundry methods such as moveLeft:, moveRight: and so on. See
NSResponder for more info on these.
If you are simply wanting to tell which keystrokes will contribute to
the character stream and which ones won't, well, it's not as simple as
looking at a set of characters. It all depends on the active input
manager and other such things. Again, see Cocoa docs on Input Managers.
-C
On Tuesday, June 18, 2002, at 09:40 PM, Dan Wood wrote:
I'm trying to intercept keydowns events and distinguish the
"displayable" keystroke characterss (the ones that actually add
to a string as they are typed) from the "functional" keystroke
characters (the other ones like up/down arrows, function keys,
etc.) so that I'll know how to process the event -- whether to
use the keystrokes or let the view's superclass process the
event.
I really don't want to hard-wire any string constants into my
code, unless there is some accepted way to do this. Are there
any methods or techniques for determining whether a
string/character is displayable or not?
Dan
--
Dan Wood
Karelia Software, LLC
email@hidden
http://www.karelia.com/
Watson for Mac OS X: http://www.karelia.com/watson/
_______________________________________________
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.
_______________________________________________
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.