Class InputEvent

An InputEvent represents a mouse or keyboard event. The principal properties hold information about a particular input event. These properties include the #documentPoint at which a mouse event occurred in document coordinates, the corresponding point in view/element coordinates, #viewPoint, the #key for keyboard events, and the #modifiers and #button at the time. Additional descriptive properties include #clickCount, #delta,

timestamp, and the source event #event (if available).

Index

Constructor methods

Properties

Methods

Constructor methods

constructor(): InputEvent

The InputEvent class constructor produces an empty InputEvent.

Returns

InputEvent

Properties

public alt: boolean

Gets whether the alt key is being held down.

public bubbles: boolean

Gets or sets whether the underlying #event is prevented from bubbling up the hierarchy of HTML elements outside of the Diagram and whether any default action is canceled.

public button: number

Gets or sets the button that caused this event.

public clickCount: number

Gets or sets whether this event represents a click or a double-click.

public control: boolean

Gets whether the control key is being held down.

public delta: number

Gets or sets the amount of change associated with a mouse-wheel rotation.

public diagram: Diagram

Gets the source diagram associated with the event.

public documentPoint: Point

Gets or sets the point at which this input event occurred, in document coordinates.

public down: boolean

Gets or sets whether the InputEvent represents a mouse-down or a key-down event.

public event: Event

Gets or sets the platform's user-agent-supplied event for this event.

public handled: boolean

Gets or sets whether an InputEvent that applies to a GraphObject and bubbles up the chain of containing Panels is stopped from continuing up the chain.

public key: string

Gets or sets the key pressed or released as this event.

public left: boolean

Gets whether the logical left mouse button is being held down.

public meta: boolean

Gets whether the meta key is being held down.

public middle: boolean

Gets whether the logical middle mouse button is being held down.

public modifiers: number

Gets or sets the modifier keys that were used with the mouse or keyboard event.

public right: boolean

Gets whether the logical right mouse button is being held down.

public shift: boolean

Gets whether the shift key is being held down.

public targetDiagram: Diagram

Gets or sets the diagram associated with the canvas that the event is currently targeting.

public targetObject: GraphObject

Gets or sets the GraphObject that is at the current mouse point, if any.

public timestamp: number

Gets or sets the time at which the event occurred, in milliseconds.

public up: boolean

Gets or sets whether the InputEvent represents a mouse-up or a key-up event.

public viewPoint: Point

Gets or sets the point at which this input event occurred.

Methods

public copy(): InputEvent

Make a copy of this InputEvent.

Returns

InputEvent