When does -[NSWindow sendEvent:] beep?
When does -[NSWindow sendEvent:] beep?
- Subject: When does -[NSWindow sendEvent:] beep?
- From: David Catmull <email@hidden>
- Date: Tue, 20 Feb 2007 12:45:41 -0800
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:
This email sent to email@hidden