MouseDeltaX/Y for CanvasGadget
Posted: Fri Aug 26, 2011 1:03 am
With 4.60 beta 4 I have been finally diving deep into the new CanvasGadget, and it is GREAT, thank you for it (to freak? Fred? everyone?)!
I'm just surprised that with so many EventTypes, there is no #PB_Canvas_MouseDeltaX or #PB_Canvas_MouseDeltaY, which would be very useful for dragging objects or panning a view.
Unless I have overlooked something, you can only achieve dragging by keeping track of the new and previous mouse coordinates, correct?
This isn't difficult at all, but a simple GetGadgetAttribute(Canvas, #PB_Canvas_MouseDeltaX/Y) would be awesome.
The other issue is: sometimes you want to clip the mouse to the canvas (often hide it too) but this bounds the MouseX and MouseY values, so you cannot detect mouse motion BEYOND the edges with the coordinates method. This is the situation I have run into, I want to clip and hide the mouse, but the user should be able to pan the camera "forever" with a single mouse-button-down.
(For comparison, look at MouseDeltaX() and MouseDeltaY() from the mouse library. If I recall correctly, these report mouse motion even when the x/y coordinates are actually stopped at the edge of the screen.)
Does this request make sense??
I'm just surprised that with so many EventTypes, there is no #PB_Canvas_MouseDeltaX or #PB_Canvas_MouseDeltaY, which would be very useful for dragging objects or panning a view.
Unless I have overlooked something, you can only achieve dragging by keeping track of the new and previous mouse coordinates, correct?
This isn't difficult at all, but a simple GetGadgetAttribute(Canvas, #PB_Canvas_MouseDeltaX/Y) would be awesome.
The other issue is: sometimes you want to clip the mouse to the canvas (often hide it too) but this bounds the MouseX and MouseY values, so you cannot detect mouse motion BEYOND the edges with the coordinates method. This is the situation I have run into, I want to clip and hide the mouse, but the user should be able to pan the camera "forever" with a single mouse-button-down.
(For comparison, look at MouseDeltaX() and MouseDeltaY() from the mouse library. If I recall correctly, these report mouse motion even when the x/y coordinates are actually stopped at the edge of the screen.)
Does this request make sense??