• 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: keyEvent characters
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: keyEvent characters


  • Subject: Re: keyEvent characters
  • From: "John C. Randolph" <email@hidden>
  • Date: Mon, 8 Oct 2001 02:14:47 -0700

On Monday, October 8, 2001, at 02:02 AM, Angela Brett wrote:

Hi,

I have a question about key events. It says in the documentation:

- (NSString *)characters
Returns the characters associated with the receiving key-up or key-down event. These characters
are derived from a keyboard mapping that associates various key combinations with Unicode
characters. Raises an NSInternalInconsistencyException if sent to any other kind of event.

My question is, when would there be more than one character? I guess somehow several keys could be pressed or released at exactly the same time, but even then I would think they would generate separate events. Is it safe to always assume that there's only one character?

If the API allows for multiple characters, then it's not safe to assume that you'll only get one. While you might not ever see multiple characters per keystroke in English, I would be careful to avoid relying on that.

-jcr


"I fear all we have done is to awaken a sleeping giant and fill him with a terrible resolve." -Admiral Isoroku Yamamoto, Dec 7, 1941.


References: 
 >keyEvent characters (From: Angela Brett <email@hidden>)

  • Prev by Date: Bug in 10.1 IB / Linker with NSMovieView
  • Next by Date: Build error: OmniFoundation: _OBASSERT
  • Previous by thread: keyEvent characters
  • Next by thread: Re: keyEvent characters
  • Index(es):
    • Date
    • Thread