Re: Possible to monitor event queue of target app?
Re: Possible to monitor event queue of target app?
- Subject: Re: Possible to monitor event queue of target app?
- From: John Louch <email@hidden>
- Date: Sat, 12 Apr 2003 07:57:57 -0700
There is no way to look at another apps event queue.
You have to be very careful if you use this routine, the best thing to do is
limit the number of keystrokes per second. The AXUIElementPostKeyboardEvent
routine can easily flood the carbon/appkit event queues.
I.e. (pseudo code)
while (sending_events)
{
time = getCurrentTime ();
AXUIElementPostKeyboardEvent (...)
time = getCurrentTime() - time;
if (time < 1/50th of a second)
{
block (1/50th of a second - time);
}
}
So pick some number of keyboard events per second you want to send and make
sure you never go over that.
Thanks,
jl
>
Is there some means (via the Accessibility API or otherwise) of monitoring
>
how many events are already in the queue of the target of a
>
AXUIElementPostKeyboardEvent() call? I'm using this function to feed events
>
to another application, but I can send them faster than it processes them
>
and as a result some are lost (presumably when the event queue overflows).
>
I'm currently working around this by injecting delays every few keystrokes,
>
but this is suboptimal in terms of speed and reliability (and is highly
>
dependent on the speed of the system, load, state of the other app, etc.).
>
What I'd like to be able to do is query the target app's event queue and
>
only send new events when it has drained. Any pointers on how to do this,
>
or recommendations for alternative approaches would be appreciated.
>
>
Thanks,
>
--Ken
>
>
Ken Woodruff
>
email@hidden
>
_______________________________________________
>
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.
---------------------------------------------
John Louch Internet #: email@hidden
(805) 546 0216
_______________________________________________
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.