Hi there,
I’m trying to get an alert each time user copy a created “process”. I know that there is something like “shape.added” and here i can know when user is adding something to the canvas.
But my goal is to call a specific method when user use ctrl+v.
Thank you.
Hi @Seeebas, welcome!
You can listen to specific keyboard events via the keyboard module.
keyboard
const keyboard = modeler.get("keyboard"); keyboard.addListener(1500, function (context) { const event = context.keyEvent; if (keyboard.isCmd(event) && keyboard.isKey(["v", "V", 89], event)) { // todo: do your stuff here console.log("pasted!"); } });
Source: keyboard listener - CodeSandbox
Thank you for your reply @Niklas_Kiefer your solution work for what i need to do.
I did manage to make a workaround with “shape.added” and then force to do something else.
Have a great weekend