- Home
- Learn
- Samples
- Intro
- API
- Register
- Download
- Forum
- Contact
- Buy
- Activate

GoJS Class Index

## Diagram Classes

- Adornment
- AnimationManager
- CommandHandler
- Diagram
- DiagramEvent
- GraphObject
- Group
- InputEvent
- Layer
- Link
- Node
- Overview
- Palette
- Panel
- Part
- Picture
- Placeholder
- RowColumnDefinition
- Shape
- TextBlock

## Geometry Classes

- Brush
- Geometry
- Margin
- PathFigure
- PathSegment
- Point
- Rect
- Size
- Spot

## Model Classes

- Binding
- ChangedEvent
- GraphLinksModel
- Model
- Transaction
- TreeModel
- UndoManager

## Layout Classes

- CircularLayout
- ForceDirectedLayout
- GridLayout
- LayeredDigraphLayout
- Layout
- LayoutNetwork
- TreeLayout

## Tool Classes

- ActionTool
- ClickCreatingTool
- ClickSelectingTool
- ContextMenuTool
- DraggingTool
- DragSelectingTool
- LinkingBaseTool
- LinkingTool
- LinkReshapingTool
- PanningTool
- RelinkingTool
- ResizingTool
- RotatingTool
- TextEditingTool
- Tool
- ToolManager

## Collection Classes

- Iterable
- Iterator
- List
- Map
- Set

GoJS® Diagramming Components
version 1.5.20 for JavaScript/HTML
by Northwoods Software®

# Class InputEvent

An InputEvent represents a mouse or keyboard or touch 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).

Many of its properties are provided for convenient access to the state of the input event, such as asking whether the control key was held down at the time, or the targetObject (a GraphObject) that the mouse was over .

## Constructor Summary Details

Returns | Name | Description
--- | --- | ---
| InputEvent() | The InputEvent class constructor produces an empty InputEvent. More... You should not need to call this constructor.

## Properties Summary Details

Returns | Name | Description
--- | --- | ---

{boolean}

alt

Gets or sets whether the alt key is being held down. More... This is true if the key was pressed at the time of the event. See also:

- modifiers
- control
- shift
- meta

{number}

button

Gets or sets the button that caused this event. More... This property is valid if this is a mouse event. Only one button can cause an event at a time. See also:

- left
- middle
- right

{number} | clickCount | Gets or sets whether this event represents a click or a double-click. More... It is zero if not a click; one if a single-click; two if a double-click. This property is valid if this is a mouse event.

{boolean}

control

Gets or sets whether the control key is being held down. More... This is true if the key was pressed at the time of the event. See also:

- modifiers
- shift
- alt
- meta

{number} | delta | Gets or sets the amount of change associated with a mouse-wheel rotation. More... It is an abstract number, either positive or negative. This property is valid if this is a mouse-wheel event.
{Diagram} | diagram | Gets the source diagram associated with the event.

{Point}

documentPoint

Gets or sets the point at which this input event occurred, in document coordinates. More... The Point is in document coordinates, the same as the GraphObject.position for Parts in the diagram. This should be valid for mouse events. For keyboard events, this is the last available mouse point. See also:

- viewPoint

{boolean} | down 1.1 | Gets or sets whether the InputEvent represents a mouse-down or a key-down event. More... The default value is false.

{Event}

event

Gets or sets the platform's user-agent-supplied event for this event. More... It may be null if no underlying event exists. See also:

- timestamp

{boolean} | handled | 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. More... Some event handlers may set this to true to avoid getting any behavior from the containing Panels. The default value is false.

{boolean}

isMultiTouch 1.5

This property is true when the InputEvent is caused by a touch event that registered more than one touch. More... See also:

- isTouchEvent

{boolean}

isTouchEvent 1.5

This read-only property is true when the InputEvent is caused by a touch event. More... See also:

- isMultiTouch

{string} | key | Gets or sets the key pressed or released as this event. More... This property is valid if this is a keyboard event.

{boolean}

left

Gets or sets whether the logical left mouse button is being held down. More... This is true if the button was pressed at the time of the event. See also:

- button
- middle
- right

{boolean}

meta

Gets or sets whether the meta key is being held down. More... This is true if the key was pressed at the time of the event. See also:

- modifiers
- control
- shift
- alt

{boolean}

middle

Gets or sets whether the logical middle mouse button is being held down. More... This is true if the button was pressed at the time of the event. See also:

- button
- left
- right

{number}

modifiers

Gets or sets the modifier keys that were used with the mouse or keyboard event. More... The number will be a combination of flags representing Control, Shift, Alt or Meta. See also:

- control
- shift
- alt
- meta

{boolean}

right

Gets or sets whether the logical right mouse button is being held down. More... This is true if the button was pressed at the time of the event. See also:

- button
- left
- middle

{boolean}

shift

Gets or sets whether the shift key is being held down. More... This is true if the key was pressed at the time of the event. See also:

- modifiers
- control
- alt
- meta

{Diagram} | targetDiagram | Gets or sets the diagram associated with the canvas that the event is currently targeting.

{GraphObject}

targetObject

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

For those events that are bubbled up the chain of parent Panels, this property provides access to the original GraphObject where the input event occurred.

See also:

- handled

{number} | timestamp | Gets or sets the time at which the event occurred, in milliseconds.
{boolean} | up 1.1 | Gets or sets whether the InputEvent represents a mouse-up or a key-up event. More... The default value is false.

{Point}

viewPoint

Gets or sets the point at which this input event occurred. More... The Point is in view coordinates within the viewport, not in document coordinates. This should be valid for mouse events. For keyboard events, this is the last available mouse point. See also:

- documentPoint

## Method Summary Details

Returns | Name | Description
--- | --- | ---

{InputEvent}

copy()

Make a copy of this InputEvent.

Returns:
{InputEvent}