This is an extension and not part of the main GoJS library. Note that the API for this class may change at any time. If you intend to use an extension in production, you should copy the code to your own source directory. Extensions can be found in the GoJS kit under the extensions
(for loading via script tags),extensionsTS
(UMD modules), or extensionsJSM
(ES6 modules) folders. See the Extensions intro page for more information.
Gets or sets the Diagram associated with this Robot.
Simulate a key down event.
the timestamp of the simulated event, in milliseconds; default zero
an optional argument providing properties for the InputEvent.
Simulate a key up event.
the timestamp of the simulated event, in milliseconds; default zero
an optional argument providing properties for the InputEvent.
Simulate a mouse down event.
the X-coordinate of the mouse point in document coordinates.
the Y-coordinate of the mouse point in document coordinates.
the timestamp of the simulated event, in milliseconds; default zero
an optional argument providing properties for the InputEvent.
Simulate a mouse move event.
the X-coordinate of the mouse point in document coordinates.
the Y-coordinate of the mouse point in document coordinates.
the timestamp of the simulated event, in milliseconds; default zero
an optional argument providing properties for the InputEvent.
Simulate a mouse up event.
the X-coordinate of the mouse point in document coordinates.
the Y-coordinate of the mouse point in document coordinates.
the timestamp of the simulated event, in milliseconds; default zero
an optional argument providing properties for the InputEvent.
Simulate a mouse wheel event.
non-zero turn
the timestamp of the simulated event, in milliseconds; default zero
an optional argument providing properties for the InputEvent.
A class for simulating mouse and keyboard input.
As a special hack, this supports limited simulation of drag-and-drop between Diagrams, by setting both the
sourceDiagram
andtargetDiagram
properties on theeventprops
argument of the mouseDown/mouseMove/mouseUp methods. Although InputEvent.targetDiagram is a real property, thesourceDiagram
property is only used by these Robot methods.If you want to experiment with this extension, try the Simulating Input sample.