• 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: Send Key Event to Focused Window
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Send Key Event to Focused Window


  • Subject: Re: Send Key Event to Focused Window
  • From: Daniel <email@hidden>
  • Date: Thu, 19 Jun 2008 09:46:06 +0200

hi!

I've dig a little bit in Quartz Events services and I got some poorly results.

CGEventRef event = CGEventCreateKeyboardEvent(NULL, (CGKeyCode) 40, true);
CGEventPost(kCGHIDEventTap, event);

This for example works, in Xcode a "k" is inserted, but there are a
lot of other key codes that do not work.

Has someone experience with these kind of Quartz Events?

The final goal should be to have a basic screen keyboard, where a
person can click a button and a keyboard stroke is simulated.

Thank you for your answers :-)

Daniel

On Wed, Jun 18, 2008 at 4:39 PM, j o a r <email@hidden> wrote:
>
> Cocoa is not a "cross-process" API, for the most part, so that would be
> expected.
>
> In the code you posted you used a reference to "NSApp". This is a reference
> to your own application, it's not a reference to some other application. The
> OS prevents you from interacting directly with the internals of other
> applications for stability and security reasons.
>
> You should be able to do what you want using Quartz Event Services.
>
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please 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

  • Follow-Ups:
    • Re: Send Key Event to Focused Window
      • From: Bill Cheeseman <email@hidden>
References: 
 >Send Key Event to Focused Window (From: Daniel <email@hidden>)
 >Re: Send Key Event to Focused Window (From: j o a r <email@hidden>)
 >Re: Send Key Event to Focused Window (From: Daniel <email@hidden>)
 >Re: Send Key Event to Focused Window (From: j o a r <email@hidden>)

  • Prev by Date: Re: Tab-based ("document"-based?) application
  • Next by Date: Re: Problem with NSWindow setFrame
  • Previous by thread: Re: Send Key Event to Focused Window
  • Next by thread: Re: Send Key Event to Focused Window
  • Index(es):
    • Date
    • Thread