Component::mouseMove() triggered by mousewheel scroll events?


#1

I have an apple Magic Mouse, and mouseMove events are being called when i scroll the mouse.  is this normal?   I'm std::cout'ing the event.getPosition() and the position isn't changing.  If this is normal behavior, can you update the documentation so that it says that mousewheel events will trigger mouseMove? 


#2

If you scroll something, that tends to move components around, and the position of the mouse within them will change, even if the physical mouse position doesn't. So sure, it's perfectly reasonable to expect a mouse-move event so that components can react to that. In fact, you can expect mouse-moves at any time, for no apparent reason, and if I mentioned this in the comments for every method that could possibly trigger a mouse-move (i.e. anything that could move a component's bounds in any way), then people would get sick of reading about it.

But why are you even asking this question? It'd be crazy to write code that doesn't cope with a stream of arbitrary wheel/move messages, because mice will produce both at once.


#3

Im asking it because to me, a mouse move is the cursor changing x/y positions on the desktop screen. To me, A mouse move is not a change in the cursor position relative to a component that slides around in a window when you scroll inside it, even tho the cursor doesnt actually move on the desktop. Thats a mouseWheelScroll event…

Honestly, a mousemove should really only reflect data being transmitted by the part of the mouse that detects physical longitudinal/lattitudinal movements by mouse itself.

“Did the mouse physically move on my desk?”
“No”
“Ok, then obviously dont create a mouseMove event”

shrugs


#4

No one will ever get sick of reading COMPLETE and THOROUGH documentation of implemented behavior. Lol you should know better. This thread would not have been created if the documentation for Component::mouseMove() said “mouse wheel scroll events will cause this event to be triggered”


#5

No, it's not true to say that a wheel event will cause a mouse move.

A more useful comment about how you should think about this would be:

"mouse-moves will occur at any time, because obviously there's one or more unknown mouse/trackwheel/pen tablets on the end of a wire somewhere, often being used by people with shaky hands.. Bottom line: if you make any silly assumptions that the stream of mouse-events will ever stop completely, you're going to have a bad time. Even a seemingly stationary mouse could be generating sub-pixel movements or pressure-change events."