From: Daniel A. S. <st...@ic...> - 2006-01-03 05:18:12
|
On 03/01/2006, at 15:58, Bryan Oakley wrote: > Daniel A. Steffen wrote: >> you may want to look into GetEventMonitorTarget() in >> CarbonEvents.h (c.f. below), it should be possible to use this to >> get mouse down notification when your app is not active. > > Wow. Daniel, I think I owe you a beer. ;-) no worries! > GetEventMonitorTarget() indeed works. Now I just need to figure out > how to convert the arguments in my callback into an x/y coordinate. > I suspect it has to do with me calling GetEventParameter. Time to > dust off my "Learning Carbon" O'Reilly book... might be easiest to just imitate what the tk code does in TkMacOSXProcessMouseEvent() in tkMacOSXMouseEvent.c. Or you might even be able to call XQueryPointer in the xlib stubs table via the new ffidl::stubsymbol I added for Ffidl 0.6. A while ago I revised XQueryPointer to retrieve mouse loc from the current event if available (so it is no longer expensive to call it), but I'm not certain this will work with the funkyness that GetEventMonitorTarget () introduces (XQueryPointer checks if GetCurrentEvent returns an event, otherwise falls back on GetGlobalMouse which re-retrieves the mouse position from the window server), it's worth a try though. > ffidl is pretty darn nifty. indeed! I find most everything I used to need critcl for I do with Ffidl nowadays... Cheers, Daniel -- ** Daniel A. Steffen ** "And now for something completely ** Dept. of Mathematics ** different" Monty Python ** Macquarie University ** <mailto:st...@ma...> ** NSW 2109 Australia ** <http://www.maths.mq.edu.au/~steffen/> |