• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Distinguishing displayable vs. functional keys in an event?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Distinguishing displayable vs. functional keys in an event?


  • Subject: Re: Distinguishing displayable vs. functional keys in an event?
  • From: "John C. Randolph" <email@hidden>
  • Date: Tue, 18 Jun 2002 20:05:00 -0700

On Tuesday, June 18, 2002, at 07: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?

See NSCharacterSet. Testing the characters in the event's string for membership in [NSCharacterSet controlCharacterSet] or [NSCharacterSet whiteSpaceAndNewLineCharacterSet] should get you what you want.

-jcr


John C. Randolph <email@hidden> (408) 974-8819
Sr. Cocoa Software Engineer,
Apple Worldwide Developer Relations
http://developer.apple.com/cocoa/index.html
_______________________________________________
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.

References: 
 >Distinguishing displayable vs. functional keys in an event? (From: Dan Wood <email@hidden>)

  • Prev by Date: Re: initialFirstResponder and subclass of NSTextView
  • Next by Date: Re: initialFirstResponder and subclass of NSTextView
  • Previous by thread: Re: Distinguishing displayable vs. functional keys in an event?
  • Next by thread: initialFirstResponder and subclass of NSTextView
  • Index(es):
    • Date
    • Thread