• 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: When does -[NSWindow sendEvent:] beep?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: When does -[NSWindow sendEvent:] beep?


  • Subject: Re: When does -[NSWindow sendEvent:] beep?
  • From: Jason Harris <email@hidden>
  • Date: Tue, 20 Feb 2007 14:44:32 -0700

I believe that this happens when nothing in the responder chain can interpretKeyEvent for the key you send.

Jason


On Feb 20, 2007, at 1:45 PM, David Catmull wrote:

For purposes of automated testing, I'm trying to create keyboard events using -[NSEvent keyEventWithType:etc].

const char lower = tolower(inChar);
const char chars[2] = { inChar,0 },unmodChars[2] = { lower,0 };
NSEvent *event = [NSEvent
keyEventWithType:NSKeyDown
location:[NSEvent mouseLocation]
modifierFlags:nsModifiers
timestamp: ::GetCurrentEventTime()
windowNumber:0
context:[NSGraphicsContext currentContext]
characters:[NSString stringWithCString:chars encoding:NSASCIIStringEncoding]
charactersIgnoringModifiers:[NSString stringWithCString:unmodChars encoding:NSASCIIStringEncoding]
isARepeat:NO
keyCode:inVirtualKey];


This works for regular text typing, but for the arrow key it just beeps, whether I use 0x7E as in Carbon or NSUpArrowFunctionKey (with -[NSString stringWithCharacters:length:] instead). Where am I going wrong?

--
David Catmull
email@hidden
http://www.uncommonplace.com/

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
40geekspiff.com


This email sent to email@hidden


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: When does -[NSWindow sendEvent:] beep?
      • From: David Catmull <email@hidden>
References: 
 >When does -[NSWindow sendEvent:] beep? (From: David Catmull <email@hidden>)

  • Prev by Date: Re: alternate file extension
  • Next by Date: Re: class variables
  • Previous by thread: When does -[NSWindow sendEvent:] beep?
  • Next by thread: Re: When does -[NSWindow sendEvent:] beep?
  • Index(es):
    • Date
    • Thread