Mouse buttons


#1

I’ve noticed a few limitations in the mouse handling lately, which are preventing me from implementing certain interface features.

If a drag gesture is started with the one mouse button, I am not able to detect a change in state of any other mouse buttons until after the first has been released. Neither am I able to receive wheel events.

I’ve implemented a navigation strip which allows the user to scroll horizontally using the left button, or stretch/zoom horizontally (anchored at the left edge) with the right button. These features are fine in isolation, but I want to also be able to introduce zooming from vertical motion if the right mouse button is held whilst already scrolling with the left button.

This currently appears to be impossible, at least using the events provided in the mouse callbacks. I thought maybe I could work around it by looking at the mouse source directly (Desktop::getInstance().getMainMouseSource().getCurrentModifiers()) but they’re the same.

Is there anything I can do?

[edit] it works fine with keyboard modifiers (i.e., if I press Ctrl during a drag, it is picked up), so I can’t really see a reason why it shouldn’t behave that way for the other buttons. Unless it’s an OS limitation, but I can’t remember encountering such a thing in the past.


#2

Yes, that was never something that I factored into the design from the start (though this is the first time I remember anyone asking for it, so it’s clearly pretty uncommon!)

I suspect that’s it’s possible (not 100% sure if the mac can do it, but it seems likely…) and the changes could be sent via modifierKeysChanged, it’d just require some time spent fiddling about to make sure it works on all platforms - not hard, just quite time-consuming.

I’m a bit surprised you said that mouse-wheel messages aren’t getting through though - that should be unrelated to the button state. Is it Windows that you’re using?


#3

yeah, win 7 if that makes any difference.


#4

I’ll have to check that - it might be that Windows or your mouse-driver is what’s stopping the wheel messages from arriving when the button is down.