Adam
Adam

Reputation: 423

Vaadin - drag & drop with control key

Is it possible to find out if some key is pressed during dragging in vaadin? I would like if user could copy item by dragging with pressed Ctrl.

Upvotes: 0

Views: 209

Answers (1)

Adam
Adam

Reputation: 423

In drop method just use this:

TreeTargetDetails treeTargetDetails = 
    ((TreeTargetDetails) event.getTargetDetails());
MouseEventDetails mouseEventDetails =
    MouseEventDetails.deSerialize((String) treeTargetDetails.getData("mouseEvent"));

if (mouseEventDetails.isCtrlKey())
{
    ...
}

Upvotes: 1

Related Questions