Hi there,
Thanks for the response. I am specifically looking for a way to capture
strictly mouse movement events, with no buttons being pressed. I have
other things going on in the window (occasionally animation,
occasionally mouse clicks, and other things going on), so I can't call
any routines that block. From my reading of the TrackMouseXXX() calls,
it appears that these would block until a mouse event occurs. I will
have to try them to be sure my reading is correct.
So I came across the PPx::MouseMovedDoer mixin class, that should
capture the carbon mouse event(s) {kEventClassMouse, kEventMouseMoved}.
I wrote a sample window that just displays view that should change
colors when the mouse moves, if the event is captured. When I set a
breakpoint in my ::DoMouseMoved routine, the routine is never called.
Is there some sort of other setup that I need to do that will let my
view or window capture these events?
I will also mention that I have already successfully moved over much of
the window code to PPx, so I am at least familiar with the paradigm, if
not yet completely up to speed on some of the specifics.
Oh, I also have not been able to find any example code that captures
carbon mouse events (specifically kEventMouseMoved, kEventMouseEntered,
kEventMouseExited). Do you know of any?
Thanks,
---Phoenix...
David Phillip Oster wrote:
>
>
>>Okay, So I am an experienced PowerPlant programmer. Recently I have
>>been moving a decent sized gui project over to PPx. Many of the gui
>>elements that I am working with (custom panes and views and such)
>>require mouse tracking in the form of the old LMouseTracker
>>class/LPane::MouseWithin. I was going to try to use an PPx::IdleTimer,
>>essentially copying the behaviour of the LMouseTracker periodical, but
>>the PPx::IdleTimer does not send a mouse event that I can work with. I
>>then discovered PPx::MouseMovedDoer, but I never see the event get
>>posted (my DoMouseMoved method never gets called). Other things I have
>>tried have also proven fruitless. So how do I implement a non-blocking
>>mouse tracker with PPx?
>
>
> Mouse down or mouse up? Mouse down tracking loops generally bottom out
> on either the system call TrackMouseLocation(),
> TrackMouseLocationWithOptions(), or, more rarely, TrackMouseRegion()
>
> for mouse up tracking loops, be sure to read the "Mouse Events" section
> of CarbonEvents.h. Note that CarbonEvents.h has changed since the old
> "Universal Headers" days, so be sure you are looking at the copy of
> CarbonEvents.h inside Carbon.framework (CarbonEvents.h is in
> HIToolbox.framework, inside Carbon.framework).
>
> Once you understand what system calls are being called, then you search
> the PPx source code and examples to see how connect through the PPx
> layer to your code.
>
> Make sure you understand the difference between a
>
> kMouseTrackingMouseDragged and a kMouseTrackingMouseMoved, return values
> from the TrackMouseXXX() system calls.
>
> and between a {kEventClassMouse, kEventMouseMoved} and
> {kEventClassMouse, kEventMouseDragged} Carbon Event.
>
> Note that some of this changed between OS X 10.1 and OS X 10.2. >> Stay informed about: Popup that always sends message