Mouse event listener issue #705
-
HI, I have created an extension which will be returning the mouse position by extending a MouseTool class. Below is the code for the extension:
}` and below is di.config for the extension:
});` It is working fine, I'm able to get the position of the mouse when I dbClick anywhere on the editor. But the issue is that I'm now unable to perform any action on the editor like selecting the node, dragging nodes here and there, etch. Please help me by providing the feedback on what I'm doing wrong. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
Hi @Abhay0294 Please note that in GLSP we already use a custom mouse tool, the I think in your case registering your action as a mouse listener and injecting the |
Beta Was this translation helpful? Give feedback.
Hi @Abhay0294
Please note that in GLSP we already use a custom mouse tool, the
RankingMouseTool
if you use theglspMouseToolModule
. In that case it would be better for you to rebind that as well instead of only the MouseTool.I think in your case registering your action as a mouse listener and injecting the
MousePositionTracker
(for thelastPositionOnDiagram
) should be enough. The original mouse tool singleton will notify all registered mouse listeners and already has a proper binding for double click. So you can simply dobind(TYPES.MouseListener).to(HideNodeAction)
and implement that interface instead. However, if you really do rebind the mouse tool, you probably need to callsuper.deco…