How to create an NSEvent for Option-E?
How to create an NSEvent for Option-E?
- Subject: How to create an NSEvent for Option-E?
- From: Glen Simmons <email@hidden>
- Date: Tue, 29 Aug 2006 16:03:32 -0500
I'd like to create and send an event for Option-E. I tried this code,
using the same values the system-generated event has:
NSEvent* fakeEvent = [NSEvent keyEventWithType:NSKeyDown
location:NSZeroPoint
modifierFlags:0x80120
timestamp:0
windowNumber:[[NSApp
mainWindow] windowNumber]
context:nil
characters:@""
charactersIgnoringModifiers:@"e"
isARepeat:NO
keyCode:14];
[NSApp postEvent:fakeEvent atStart:NO];
This throws an exception: *** -[NSCFString characterAtIndex:]: Range
or index out of bounds
Why? What's wrong with this code? How can I send an event for Option-E?
Thanks,
Glen Simmons
_______________________________________________
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