# MouseWheel problem since 1.46

**URL:** <https://forum.juce.com/t/mousewheel-problem-since-1-46/3711>\
**Category:** General JUCE discussion\
**Created:** [February 27, 2009, 3:28pm UTC](https://forum.juce.com/t/mousewheel-problem-since-1-46/3711 "2009-02-27T15:28:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![friscokid](https://avatars.discourse-cdn.com/v4/letter/f/d9b06d/32.png) [@friscokid](https://forum.juce.com/u/friscokid)\
**Post date:** [February 27, 2009, 3:28pm UTC](https://forum.juce.com/t/mousewheel-problem-since-1-46/3711/1 "2009-02-27T15:28:50Z")

</div>

Hi,

since version 1.46 none of my custom components derived from juce::Component are getting MouseWheel callbacks under Windows. The only workaround is to add a juce::Slider component and make it visible and suddenly my components are getting the MouseWheel events. If I remove the “dummy Slider” wheel doesn’t work anymore. In version 1.45 my components worked properly.  
Anything known of a “bug in juce\_win32\_Windowing”? Because without the dummy Slider

`LRESULT peerWindowProc(...)
...
case 0x020A: /* WM_MOUSEWHEEL */
                        doMouseWheel (wParam, true);
                        return 0;
case 0x020E: /* WM_MOUSEHWHEEL */
...`

are never reached?

After hours of debugging, still no idea what goes wrong.

Thanks for any help.

friscokid

---

<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:** [March 1, 2009, 11:22am UTC](https://forum.juce.com/t/mousewheel-problem-since-1-46/3711/2 "2009-03-01T11:22:26Z")

</div>

Maybe all of your components are set to not want keyboard focus? If the window doesn’t have focus, I think that the OS might not send it any wheel events. Adding a slider (which does want key focus) would be enough to persuade it to grab the focus.

---

<div class="post-metadata">

**Author:** ![friscokid](https://avatars.discourse-cdn.com/v4/letter/f/d9b06d/32.png) [@friscokid](https://forum.juce.com/u/friscokid)\
**Post date:** [March 1, 2009, 2:47pm UTC](https://forum.juce.com/t/mousewheel-problem-since-1-46/3711/3 "2009-03-01T14:47:36Z")

</div>

Bull’s eye!  
That was the problem. Thanks a lot Jules. You made my day.

---

<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:** [March 3, 2009, 11:06am UTC](https://forum.juce.com/t/mousewheel-problem-since-1-46/3711/4 "2009-03-03T11:06:57Z")

</div>

No problem. That “not-getting-a-scroll-event-unless-the-window-is-focused” behaviour is definitely one of the most irritating things about Vista.
