On 07/28/16 08:37, Camille B. wrote:
> The FL_DRAG event is actually still triggered. It's just that
> Fl::event_button() stops returning FL_LEFT_MOUSE when a keyboard key is pressed.
AFAIK, Fl::event_button() is only valid for button events, not other events
(like mouse motion). I think the fact it works at all for FL_DRAG is undefined.
From the docs:
static int Fl::event_button()
Gets which particular mouse button caused the current event.
This returns garbage if the most recent event was not a
FL_PUSH or FL_RELEASE event.
..emphasis on that last bit. Fl::event_button() will have valid info
only for button events like FL_PUSH/RELEASE, not FL_DRAG.
On FL_PUSH, save the state of Fl::event_button() in a class variable
so you can use it later during FL_DRAG, and clear it on FL_RELEASE
for that same button.