Re: Getting Mouse Moved Events
Re: Getting Mouse Moved Events
- Subject: Re: Getting Mouse Moved Events
- From: Bruce Veazie <email@hidden>
- Date: Sun, 29 Dec 2002 13:10:47 -0500
Nice solution, Michael.
FYI - I filed a bug report as I think there's a discrepancy in the
documentation - NSResponder's "acceptsFirstResponder" method states
objects can still receive mouse events even if they're not first
responders. It does not take exception to mouseMoved events (which
would seem to fall under the definition of "mouse event"). But the view
must accept firstResponder status to receive mouseMoved events as well
as setting [window setAcceptsMouseMovedEvents:YES].
Bruce
On Sunday, December 29, 2002, at 12:17 PM, Michael Latta wrote:
Problem solved. I can make it work like the documentation by
subclassing window and doing my own dispatching for mouse entered,
exited, and mouse moved. I can use hitTest to determine the view that
should receive the events, or always direct them to the view I want to
receive them. Since the window only gets the events if the responder
chain of views does not want it, any view can capture the events
keeping the existing behavior intact for existing code.
Michael
On Sunday, December 29, 2002, at 07:22 AM, Matthew wrote:
On Saturday, December 28, 2002, at 11:20 AM, Michael Latta wrote:
This also REALLY REALLY REALLY sucks!! I wanted to track the mouse
even when not the active application to do some highlighting. I
guess I will need to try tracking regions/rectangles.
I agree - and have run into the same problems. If you hit on a
solution please let me know. I dont think tracking rectangles are
the answer. There are things you might want to track that arent
rectangular. Also there was some posts on this list recently that
having large amounts of tracking rectangles (look up "Tooltips - what
a pathetic joke..." on http://cocoa.mamasam.com/) greatly slowed down
scrolling.
Of course you could have a repeating task for each view that gets the
current mouse location and does its own tracking. But that doesnt
seem very friendly.
The problem with using mouseMoved events in this way - is that they
fire even if the mouse movement took place outside the view. So if
you had many views - all receiving mouseMoved events - it could
overwhelm the event queue. Id like a MouseMovedInView event that
only went to the one view the mouse moved in - even if that view isnt
the first responder.
cheers,
M@
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
Bruce J. Veazie
email@hidden
http://veazie.org
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.