Re: Problem in simulating the events
Re: Problem in simulating the events
- Subject: Re: Problem in simulating the events
- From: Mike Paquette <email@hidden>
- Date: Mon, 19 Jun 2006 10:19:57 -0700
If I'm reading this correctly, you have an application running on the
local computer that gets hardware events, sends these to FCS on a
different computer, which then sends the events back to the local
computer where your program eventually posts them using
CGPostMouseEvent() and CGPostKeyboardEvent().
If that is the case then you should be aware of an interesting
interaction between posting events via CGPostMouseEvent() or
CGPostKeyboardEvent() and the local hardware event path.
By default, when you post events from a CGPostMouseEvent() or
CGPostKeyboardEvent(), local hardware events are disabled for 0.25
seconds. In addition, when a left mouse down is posted via
CGPostMouseEvent(), by default local hardware mouse events are
disabled until you post a left mouse up. The local hardware events
are disabled so as to prevent contention between a remote control
application such as Apple Remote Desktop and an overeager local
user. (Consider a classroom, where a teacher is remotely operating a
system with an eight year old child sitting at the mouse and
keyboard. Without this behavior, the child could make the teacher's
task more difficult.)
In your case, you may want to turn off the disabling side effects of
CGPostMouseEvent() and CGPostKeyboardEvent(). Additional API is
provided to alter how your app's event posting interacts with the
system. To switch off the disabling of local events:
#include <ApplicationServices/ApplicationServices.h>
...
CGSetLocalEventsSuppressionInterval(0.0);
CGSetLocalEventsFilterDuringSuppressionState
(kCGEventFilterMaskPermitAllEvents,
kCGEventSuppressionStateSuppressionInterval);
CGSetLocalEventsFilterDuringSuppressionState
(kCGEventFilterMaskPermitAllEvents,
kCGEventSuppressionStateRemoteMouseDrag);
This directs the system to block local events for 0.0 seconds after
you post them, and directs the system to permit all local events
immediately after you post events, and to permit all events while you
have posted events to enter a drag state, that is, after that left
mouse down event.
On Jun 19, 2006, at 8:50 AM, Gurmit Teotia wrote:
Flash(Cocoa) application gets the events from FCS (Flash Communication
Server) running on different computer. This FCS server get the
events the
from other flash application which is actualy displaying the screen
of my
laptop. Some like that:
Main Flash Application---->FCS--->Client Flash Application---->My
Event
simulating application.
Here one might suggest that we should bypass the FCS or Client Flash
Application, but we cann't do that. Two reasons:-
1. It's already released. I'm just porting client application to MAC.
2. Main Flash application can connect with other n number of Main
Flash
Applications... and all the Main Flash application will the show
image of
loptop where client application is running and it can be controlled
from any
of them.
Regards,
Gurmit
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden