Global capture of mouse events
Global capture of mouse events
- Subject: Global capture of mouse events
- From: Dave Warker <email@hidden>
- Date: Mon, 24 Nov 2003 11:45:27 -0500
I'm porting an existing Mac OS accessibility app to OS X and I've run
into a problem. It has an option to use the mouse button as a generic
input trigger device and to support it we need to be able to capture
all mouse down/up events (we post our own to the active app as needed.)
The problem is that OS X does not provide a method to globally capture
mouse button events.
My current work-around (from discussions in the Apple developer list
archives) is to use an empty full-desktop overlay window with Carbon
Event handlers for mouse down/up. That is working correctly except for
one annoying side-effect: even though we aren't drawing into that
window the OS still reserves a backing store for it which eats up a
large chunk of video memory which seems to be causing slight delays in
other drawing such as menus. I've double checked and its the mere
existence of the large overlay window that triggers this, even if its
not actually visible. For this application the delays just aren't
acceptable.
OS X is supposed to support a non-retained (no backing store) window
mode but that is officially not supported in Carbon and now appears to
be unsupported or broken in Panther (DTS says the code should work but
I'm still getting Retained windows with a full backing store.) I've
thought about using a small window that stays centered under the mouse
cursor but there are problems with that scheme as well. I also thought
of using the HID calls to grab complete control of the mouse but they
only work while the application is active and would not work from our
background-only app. The new Panther global event monitoring doesn't
help because the events still go through to the app and we have to
support 10.2.x as well anyway.
Has anyone worked out a method to globally capture mouse button events
from a background app without resorting to kernel extensions/HID
drivers? It would be OK and in fact better if we could grab a specific
device rather than every mouse up/down event but at this point I'm just
looking for any acceptable solution.
Thanks,
Dave
-----
Dave Warker <email@hidden>
http://warker.com
_______________________________________________
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.