[Bug] Behaviour difference: mouseDrag


#1

Hi,

mouseDrag behaves differently on Windows and on Mac.
On Mac, the mouseDrag() is called, as soon as you press the mouse button. Even if you do not move the mouse at all. But on Windows, the mouseDrag() is called, only if you press the button AND move the mouse.

I think, the behaviour should be the same on Windows and on Mac. Thats what I want.

I am using Juce 5.4.1, Win 10 and OSX 10.11.6

Note: this is similar to the following forum topic:


#2

Did you read the following discussion of the thread you linked as well? I guess, the answer is still the same.
The generation of mouse events is the result of an analog value, i.e. the mouse movement or non-movement, so your code needs to cope with that.
The behaviour might even not be consistent, if it is a mouse, a trackpad, touchscreen or a pen-pad. You cannot know.

To check, if the mouse was actually moved, there is a method in the MouseEvent, that you can use: MouseEvent::mouseWasDraggedSinceMouseDown()

Hope that solves the issue…


#3

Thanks, was not aware of that function. I guess that should solve it.
And maybe you could update the documentation of the mouseDrag() function? And add what you just said.


#4

Glad that I could help.
I’ll have to leave the updating to the JUCE team, since I left ROLI recently to save myself from the long tedious commute into London… :wink:


#5

Ah, I was not aware you had left.
Well, thanks anyways :slight_smile: