Re: Back-porting a AXUIElementPostKeyboardEvent app to use PPostEvent
Re: Back-porting a AXUIElementPostKeyboardEvent app to use PPostEvent
- Subject: Re: Back-porting a AXUIElementPostKeyboardEvent app to use PPostEvent
- From: Eric Schlegel <email@hidden>
- Date: Thu, 8 May 2003 07:19:13 -0700
On Wednesday, May 7, 2003, at 11:36 PM, Ken Woodruff wrote:
rountines. The problem occurs when I try to get real--PPostEvent()
isn't
defined in CarbonLib, so I've linked in InterfaceLib as well (with
CarbonLib
first in the list, so presumably the only symbol I'm picking up from
InterfaceLib is PPostEvent()). Unfortunately my app now crashes on
launch
(can't even run it in the debugger).
Does it actually crash (do you land in Macsbug?) or does if you run it
from the Finder, do you see the zoom animation indicating launch and
then immediately it closes again?
It's probably the latter, and you're probably running into an
intentional limitation of CarbonLib; it doesn't allow your app to
launch if you also link to InterfaceLib, because there are many APIs in
CarbonLib that override the same code in InterfaceLib, and calling
directly through to CarbonLib would cause problems.
However, you do have another choice which will work: you can use
GetSharedLibrary and FindSymbol to load a function pointer to
PPostEvent in InterfaceLib, and then call through the function pointer.
This will avoid the checks that CarbonLib makes at launch.
There is an important difference between AXUIElementPostKeyboardEvent
and PPostEvent: the latter does not allow you to specify an
application. There is only a single event queue on 9, and the events
always go to the front application. So this approach will only work if
the app that you want to receive the key event is the front application
when you post the event.
-eric
_______________________________________________
accessibility-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/accessibility-dev
Do not post admin requests to the list. They will be ignored.