• 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: generating the event
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: generating the event


  • Subject: Re: generating the event
  • From: "Gurmit Teotia" <email@hidden>
  • Date: Wed, 24 May 2006 10:36:26 +0530

I think your solution only work if the destination of your event is
your application.
If you want to target another application, have a look at
CGPostKeyboardEvent() :
http://developer.apple.com/documentation/Carbon/Reference/
QuartzEventServicesRef/Reference/reference.html
Yes destination of event is my application but still it is not working.

Regards,
Gurmit


On 5/24/06, Damien Bobillot <email@hidden> wrote:

Gurmit Teotia wrote :

> Hi All,
> In my application I want to generate the SHIFT+CONTROL+1 event but
> unable to
> do so. Currently I'm using following approach:
>
> NSEvent *event=[NSEvent keyEventWithType:NSKeyDown
> location:NSMakePoint(0,0), modifierFlags:NSShiftKeyMask|
> NSControlKeyMask
> timestamp:0 windowNumber: [[sender window] windowNumber] context:nil
> characters:@"1" charactersIgnoringModifiers:@"!" isARepeat:NO
> keyCode:18]
>
> [NSApp postEvent:event atStart:YES];

I think your solution only work if the destination of your event is
your application.
If you want to target another application, have a look at
CGPostKeyboardEvent() :
http://developer.apple.com/documentation/Carbon/Reference/
QuartzEventServicesRef/Reference/reference.html

--
Damien Bobillot


_______________________________________________
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: generating the event
      • From: Gregory Cooksey <email@hidden>
References: 
 >generating the event (From: "Gurmit Teotia" <email@hidden>)
 >Re: generating the event (From: Damien Bobillot <email@hidden>)

  • Prev by Date: Re: Core Data Import
  • Next by Date: NSFormatter for hexadecimal numbers
  • Previous by thread: Re: generating the event
  • Next by thread: Re: generating the event
  • Index(es):
    • Date
    • Thread