• 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
AXUIElementPostKeyboardEvent and Carbon applications
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

AXUIElementPostKeyboardEvent and Carbon applications


  • Subject: AXUIElementPostKeyboardEvent and Carbon applications
  • From: AstroK Software <email@hidden>
  • Date: Tue, 21 Sep 2010 23:41:52 +0200
  • Mailscanner-null-check: 1285710227.00731@kQIeDaH5cmKpfa2cflhl9g

Hi,

sorry if it's not exactly a Cocoa question, but my application is written in Cocoa and it uses Carbon calls to accessibility functions.

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?

I am using the following code:

if (type == kCGEventKeyDown)
{
	keyDown = true;
	err = AXUIElementPostKeyboardEvent(backgroundApp, (CGCharCode)0, (CGKeyCode)keyCode, keyDown);
}
else if (type == kCGEventKeyUp)
{
	keyDown = false;
	err = AXUIElementPostKeyboardEvent(backgroundApp, (CGCharCode)0, (CGKeyCode)keyCode, keyDown);
}

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?

Thanks in advance,

 -- Arthur;

--
Arthur VIGAN
AstroK Software
email@hidden




_______________________________________________

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: AXUIElementPostKeyboardEvent and Carbon applications
      • From: Eric Schlegel <email@hidden>
  • Prev by Date: Re: Toolbar Item -Menu Form Representation - Key Equivalent
  • Next by Date: Re: Access object from another view
  • Previous by thread: Re: Access object from another view
  • Next by thread: Re: AXUIElementPostKeyboardEvent and Carbon applications
  • Index(es):
    • Date
    • Thread