@akisiel wrote:
Hi!
I am trying to reproduce fallowing behavoiur using Robot.js class:
1) press SHIFT key
2) MouseDown on an element
3) MouseMove to some other location
4) MouseUpAs far my code is not working, it behaves like shift it not held. Can anyone know how I can simulate shift down with robot.js?
const dragdrop = { sourceDiagram: this.canvasDiagram, targetDiagram: this.canvasDiagram }; const node = this.canvasDiagram.findNodesByExample({name: res.data.name}).first(); const loc = node.actualBounds.center; this.robotTest.keyDown(16); //tried also this.robotTest.keyDown(16, 0, {shift:true}); this.robotTest.mouseDown(loc.x, loc.y, this.canvasDiagram.toolManager.dragSelectingTool.delay + 50, dragdrop); this.robotTest.mouseMove(res.data.x, res.data.x, this.canvasDiagram.toolManager.dragSelectingTool.delay + 200, dragdrop); this.robotTest.mouseUp(res.data.x, res.data.y, this.canvasDiagram.toolManager.dragSelectingTool.delay + 200, dragdrop);
Thanks!
Posts: 2
Participants: 2