How do I tell if the mouse button is down, independent of view, etc.?
How do I tell if the mouse button is down, independent of view, etc.?
- Subject: How do I tell if the mouse button is down, independent of view, etc.?
- From: Christopher Kempke <email@hidden>
- Date: Sat, 8 Mar 2008 22:20:03 -0800
I'm working on some code for a client, whose users (handicapped
children, mainly) are using non-standard mousing devices. These are
(often literally) single-switch input devices: there's no notion of
position with them at all, basically just a mouse button sans actual
mouse. (On-screen position is obtained by a variety of complicated
mechanisms, including simple scanning, where the user pushes/blinks/
speaks/blows into a tube/whatever at the appropriate time, the exact
input being dependent on their capabilities. Pretty much all of
these devices just turn the "input," whatever it is, into a mouse
click or keypress).
A fairly common problem that comes up is simply knowing if the mouse
button is down or not. I'm looking for the Cocoa equivalent of the
deprecated QuickDraw "Button()" function -- just tell me whether (a
particular or even just any) mouse button is currently pressed or not.
Mousedown handlers don't seem to be doing it for me, because I don't
know what to put them on: I need to know whether the mouse is down
regardless of modality, what window's in front, where the cursor is,
and even whether or not the mouse is in one of my app's windows at
all. I could live with keeping track of every mouse down and up, so
long as there's a way to do it globally (even while in the background).
I'm guessing this has come up before, but searching for "Button()"
isn't helping. Any hints? I'll eventually need the same thing
for keystrokes (the equivalent of deprecated GetKeys()), too, so I'd
take hints there, as well.
--Chris
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden