problem when combining InstallEventHandler with TrackMouseLocationWithOptions
problem when combining InstallEventHandler with TrackMouseLocationWithOptions
- Subject: problem when combining InstallEventHandler with TrackMouseLocationWithOptions
- From: Wolfgang Maehr <email@hidden>
- Date: Wed, 9 Mar 2005 16:25:59 +0100
Hi,
I have a strange behaviour in my ObjC code. I want to track the mouse
location independently which application is active. I found there two
nice ways:
TrackMouseLocationWithOptions
can be used to get the location if my application is active (or also
after the given timeout) and
InstallEventHandler(GetEventMonitorTarget(), myCallBackUPP, ...)
can be used to add my function as a callback function for events when
my application is not active.
This works pretty fine, as long as I do not use any ObjC classes and no
second thread. The strange behaviour begins now, when I move these
things into a ObjC class (that exists in the main thread). Then
"myCallBackMethod" is still required to be registered, but is never
called. Instead, TrackMouseLocationWithOptions gets woken (even if my
app is not active) up and replies the actual event. Actually, this
behaviour is pretty nice and helps me quite a bit, but it bugs me that
I don't know why this happens. Especially, I still must install
myCallBackMethod as an EventHandler, if I don't do so, the
TrackMouseLocationWithOptions does not get woken up anymore when my app
is inactive (just like it should). There it does not make any
difference anymore, what code myCallBackMethod contains.
This puzzles me, is there anybody with a reasonable explanation? Thanks,
_Wolf
_______________________________________________
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