TableListBox drag row based on key modifier


#1

Is there a proper way to restrict a drag operation based on mouse event modifiers? I need for rows to only be draggable if the command or ctrl keys are pressed.

-startDragAndDrop cannot be overridden.
-I have tried to use cellClicked to manage my own flag but it only happens on mouseDown when the row isn’t already selected, otherwise it happens on mouseUp which is too late to stop the drag operation.
-getDragSourceDescription does not receive the mouse event so unable to determine the context of the operation there.

Am I missing something obvious? I’m sure I can hack it if I get hacky enough but having a proper method for doing this would be useful.

Thanks.


#2

Can’t you just check ModifierKeys::getCurrentModifiers() in your getDragSourceDescription() ?


#3

Ah yes, yes I can. Thanks!