Best way to deal with MouseModifiers that change during drag

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:

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

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…


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??)

Mm yip that would make sense. Thanks!