• 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
How to create an NSEvent for Option-E?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: How to create an NSEvent for Option-E?
      • From: Uli Kusterer <email@hidden>
  • Prev by Date: Getting progress of HTTP POST as it's being UPLOADED
  • Next by Date: Posting commands?
  • Previous by thread: Re: Getting progress of HTTP POST as it's being UPLOADED
  • Next by thread: Re: How to create an NSEvent for Option-E?
  • Index(es):
    • Date
    • Thread