Best way to deal with MouseModifiers that change during drag


#1

I was wondering if there was a way to get the Modifier keys from the initiation of a mouse drag (you can get distance about the drag so JUCE seems to store info about the initial click)? Basically I have code that goes something like:

MOUSE DOWN
If (ctrl-left click) then
setup up information to use in MouseDrag // #point 1

MOUSE DRAG
If (e.mods = ctrl-left click)
logic that requires correct setup at point 1

There doesn’t seem to be a built in way to get the Modifiers of the initiating event, so if I start without ctrl then press during the drag I get issues. Is there a getInitialModifiers method I am missing and if not is this something that might be worth adding? Clearly its simple enough to get around it manually but a getInitialModifiers method might be neat that’s all.

Also if I do want to store the modifiers manually, what is the best way to do it? I can’t seem to cast e.mods to int…

Thoughts?


#2

No, it doesn’t store that for you, just keep a copy of the Modifiers object yourself. (Why would you want to cast it to int rather than just copying it??)


#3

Mm yip that would make sense. Thanks!