• 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: Return and Enter keys in NSTextView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Return and Enter keys in NSTextView


  • Subject: RE: Return and Enter keys in NSTextView
  • From: Christian Mike <email@hidden>
  • Date: Thu, 30 Aug 2001 07:59:15 -0500

From my experience, if you try to catch these keys at a low level, you have
to be careful. The Return key comes in as a 0x0D, but the keypad Enter key
comes in as a 0x03. You then have to check the modifier flags for the
NSNumericPadKeyMask bit.

uiModifierFlags = [theEvent modifierFlags];
eventCharacters = [theEvent characters];
iLength = [eventCharacters length];
for(iIndex=0; iIndex<iLength; ++iIndex)
{
unicodeChar = [eventCharacters characterAtIndex:iIndex];
if(unicodeChar == 0x0D ||
(unicodeChar == 0x03 && (uiModifierFlags &
NSNumericPadKeyMask) == 0))
{
... process key...

Michael Christian
Thomson multimedia Inc.


  • Prev by Date: Re: PPC Assembly in Frameworks
  • Next by Date: RE: Return and Enter keys in NSTextView
  • Previous by thread: RE: Return and Enter keys in NSTextView
  • Next by thread: RE: Return and Enter keys in NSTextView
  • Index(es):
    • Date
    • Thread