Quantcast
Channel: GoJS - Northwoods Software
Viewing all articles
Browse latest Browse all 6969

How to hold SHIFT key and mouse move?

$
0
0

@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) MouseUp

As 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

Read full topic


Viewing all articles
Browse latest Browse all 6969

Trending Articles