mouseWheelMove callback


#1

Hi again,

I’m using the Component::mouseWheelMove callback for some custom numerical value editor, it would be a good way to make some precise changes, but it doesn’t react as I expected.

As specified in the documentation, the callback is sent to the component that the mouse is over when the wheel is moved.
However, under ms windows environment the mouse wheel messages are sent to the control having keyboard focus.
for example if you are typing in notepad, and then move the mouse away without clicking, your keystrokes and mousewheel movements will continue to be caught by the notepad application.

Anyway for my application, using the catching mouseWheel events the way it’s done in juce now is too error-prone for the end user, as he could change something he didn’t want.

I don’t know if juce should be changed, what about mac and linux users ?
Do mac users ever change values with the mighty mouse or is it just for vague navigation?


#2

[quote=“thomas”]Hi again,
I don’t know if juce should be changed, what about mac and linux users ?
Do mac users ever change values with the mighty mouse or is it just for vague navigation?[/quote]

I think it’s quite natural to send mouse wheel events straight to components (windows) over which your mouse is hovering at the moment. Linux and MacOS X behave exactly this way. Windows has been always an outsider and keeps doing that for compatibility reasons. So, I think JUCE goes the right way. Moreover, I have written a little Windows program 5 years ago with JUCE like mouse wheel behaviour and given it to test to my friends. They had liked and been accustomed to its mouse wheel behaviour so much that couldn’t understand why Windows OS doesn’t support such a natural behaviour (even optionally). There are no ‘right’ behaviours for mouse events but the natural ones (easy to understand, guiding) are.


#3

Thanks for the advices Ptomaine, I guess I got wrong habits with ms windows then. I understand the windows designers considered the mouse wheel as a replacement for page up/down keys and therefore treat it like the keyboard.

In my application it makes sense cause mousewheel is used to change values, imagine you have dozens of controllers on the screen that you can change with the mouse wheel. You want your mouse wheel to act like a midi slider that changes the value of the currently selected control, not the one under the mouse because the risk of moving the mouse while rotating the wheel is too high, you don’t want to have to keep the mouse tight while doing that.

Anyway does anybody knows how this behavior could be achived ? I guess the only possible way is to create a big transparent component that covers all the screen, and catch the mousewheel events ?


#4

You could do it with a GlobalMouseListener, I think…


#5