Reputation: 2710
I need to find out a way to disable dragging shapes in KineticJS
For example, I have a Circle with the draggable
option enabled.
I want to disable dragging this circle if the shiftKey is pressed down and I would like to handle this case in a different way.
Here's an example of what I would like to do: http://jsfiddle.net/nL3kb/
Is it possible somehow?
Upvotes: 0
Views: 1880
Reputation: 5219
You have several options. One thing you could do is make a group draggable and add the circle to the group. On mousedown, if shift was pressed, you can cancel the event propagation such that the group drag and drop functionality is canceled.
You could also add logic that toggles off drag and drop using draggable(false) whenever the shift key is pressed down
Cheers!
Upvotes: 3