Bug or wanted behaviour in Component::mouseDown()


I am writing a knob component which I also did in C++ Builder. The knob has the particularity that it resets to the middle if one presses the right mouse button. This works even while turning the knob.

In JUCE this seems not possible, because mouseDown is called only once, i.e. when I press the left mouse button on the component, it receives a mouseDown, and then when still holding the left mouse button i press the right mouse button too, then no second mousedown is generated.

Is this a wanted behaviour?

If yes, is there another possibility of still receiving the right mouse button down while the left mouse button is already pressed?


I didn’t implement that because I’m not sure if it’s cross-platform - on the mac, I don’t know if it can detect secondary clicks like that. Would have to look into it. In the meantime I guess you could try using ModifierKeys::getCurrentModifiers to poll for the second button…


Would be nice if it worked on Mac, but I can´t tell cause I am no Mac specialist… Polling would require adding a timer though,…


You’re right, I checked it, and that doesn’t work on OS X. By the way: Would it be possible to add the FN key to the modifiers? Don’t know if it’s possible but it would be nice.
Also, would it be possible to make a distinction between left and right control key? On Windows it is possible, but again on OS X I don’t know.



in the PC it notices secondary clicks but any release of one button would make the other button stop as well (they both trigger the mouse up function).
in mac it doesnt even permit that.

to manage secondary clicks we could urge our users to get multibutton mice and assign them to the modifier keys. but imo since this is a software for creationg musical instruments, and since you do need at least one hand free for the midi keyboard this is an important feature to implement.

for instance, fine tuning for knobs is something very usefull to have when adding right click to the left one without compromising right click.

i think its worth looking into. i will do some more research myself. hopefully there is a way for mac to support secondary clicks from a mouse…