Re: AXUIElementPostKeyboardEvent and Carbon applications
Re: AXUIElementPostKeyboardEvent and Carbon applications
- Subject: Re: AXUIElementPostKeyboardEvent and Carbon applications
- From: Eric Schlegel <email@hidden>
- Date: Tue, 21 Sep 2010 15:46:58 -0700
On Sep 21, 2010, at 2:41 PM, AstroK Software wrote:
> So I am writing a Cocoa application for disabled that must be able to send key presses to background application. For that I am using AXUIElementPostKeyboardEvent which works quite fine, except when I want to send key presses to Carbon apps like Microsoft Word or iTunes when they are in the background. For Cocoa apps there is no absolutely no problem! Have you ever encountered a behavior like this?
>
> This is strange because when Carbon apps are in the foreground it works fine. Do you think it could be related to the fact that my application is written in Cocoa?
It's more likely that it's because the target apps are Carbon-based. I'm sure you'd see the same behavior regardless of whether your app is Carbon or Cocoa.
The exact behavior may be dependent on the specific app, but it's likely that when the application moves to the background, its key window loses focus, and when the keyboard event arrives, the app doesn't know where to send it (because no window is key) and therefore ignores it.
-eric
_______________________________________________
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