# Origin of mouse wheel move

**URL:** <https://forum.juce.com/t/origin-of-mouse-wheel-move/14746>\
**Category:** General JUCE discussion\
**Created:** [May 8, 2015, 1:14pm UTC](https://forum.juce.com/t/origin-of-mouse-wheel-move/14746 "2015-05-08T13:14:13Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![raketa](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/raketa/32/1725_2.png) [@raketa](https://forum.juce.com/u/raketa)\
**Post date:** [May 8, 2015, 1:14pm UTC](https://forum.juce.com/t/origin-of-mouse-wheel-move/14746/1 "2015-05-08T13:14:13Z")

</div>

Hi,

I have various Components that do receive mouse wheel move notifications.

At least Apples MightyMouse under OSX&nbsp;sends a continous stream of notifications after a fast virtual mouse wheel&nbsp;move. Thats OK and works as expected.

But when the mouse wheel moves are initiated in one Component and the mouse itself is moved into another Component&nbsp;before the stream of notifications has been finished the second Component receives the rest of the notifications.

I would consider this as a bug - but maybe I don't see the use case for this.

Anyway, &nbsp;how can I detect that mouse wheel move started over a different Component? Or would it be possible to reset the mouse wheel move stream when the mouse enters&nbsp;and/or leaves&nbsp;a Component. Or what would be the right approach?

(The&nbsp;MouseEvent.eventComponent&nbsp;and the&nbsp;MouseEvent.originalComponent don't give any hints about the mouse wheel move originating Component.)

Thanks for any hints or thoughts, cheers,

raketa

---

<div class="post-metadata">

**Author:** ![railjonrogut](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/railjonrogut/32/505_2.png) [@railjonrogut](https://forum.juce.com/u/railjonrogut)\
**Post date:** [May 8, 2015, 3:43pm UTC](https://forum.juce.com/t/origin-of-mouse-wheel-move/14746/2 "2015-05-08T15:43:39Z")

</div>

grep getMouseWheelMoveCounter in juce\_TooltipWindow.cpp

Rail

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [May 8, 2015, 4:06pm UTC](https://forum.juce.com/t/origin-of-mouse-wheel-move/14746/3 "2015-05-08T16:06:41Z")

</div>

I see what you mean... I've no idea how we could change that behaviour though, since AFAIK OSX just keeps delivering those wheel messages with the current mouse position, so there's no way to know that they should be sent&nbsp;to the original component (?)

---

<div class="post-metadata">

**Author:** ![jpo](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/jpo/32/503_2.png) [@jpo](https://forum.juce.com/u/jpo)\
**Post date:** [May 8, 2015, 6:02pm UTC](https://forum.juce.com/t/origin-of-mouse-wheel-move/14746/4 "2015-05-08T18:02:46Z")

</div>

Maybe you could detect that the wheel event are fake inertial events and send them to the last component that has received a "true" (not inertial) wheel event . Those events have the momentumPhase property != 0

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [May 9, 2015, 8:29am UTC](https://forum.juce.com/t/origin-of-mouse-wheel-move/14746/5 "2015-05-09T08:29:33Z")

</div>

Ah - ok, if there's a flag then it might well be possible..

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [June 22, 2015, 7:34pm UTC](https://forum.juce.com/t/origin-of-mouse-wheel-move/14746/6 "2015-06-22T19:34:38Z")

</div>

FYI I've added a flag to MouseWheelEvent now that says whether it's an inertial event.
