Generating a "left-arrow key" event
Generating a "left-arrow key" event
- Subject: Generating a "left-arrow key" event
- From: Dave MacLachlan <email@hidden>
- Date: Wed, 19 Apr 2006 09:00:03 -0700
Hey all...
I'm looking to generate a "left-arrow key" event. I tried using
NSWindow *window = [self window];
NSEvent *keyEvent = [NSEvent keyEventWithType:NSKeyDown
location:NSZeroPoint
modifierFlags:NSFunctionKeyMask
timestamp:[event time]
windowNumber:[window
windowNumber]
context:[NSGraphicsContext
graphicsContextWithWindow:window]
characters:[NSString
stringWithCharacters:&nsFuncKey length:1]
charactersIgnoringModifiers:@""
isARepeat:NO
keyCode:keyCode];
[NSApp sendEvent:keyEvent];
Where keyCode was a Mac virtual keyCode, and nsFuncKey was
NSLeftArrowFunctionKey, but when I sent that, my edit text box got a
very funky glyph. I don't want to call [NSResponder moveLeft:]
directly for a variety of complex reasons. Any ideas?
Cheers,
Dave
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden