Skip to content

IInteractionObjectEvents

Type interface

Defines events for InteractionObject.

Sources

IInteractionObjectEvents is an interface: it describes a shape of data and is not imported on its own.

Inheritance

IInteractionObjectEvents extends IBaseObjectEvents.

IInteractionObjectEvents is extended by ISpriteEvents.

Properties

blur

Type { event: FocusEvent }

Invoked when focusable object loses focus, e.g. by clicking outside it or pressing TAB button to focus on the next focusable object.

doublehit

Type PointerTypeEvent & PointEvent & MouseTouchEvent

Invoked when object is clicked or touched twice in rapid succession.

Check IHitOptions for settings about double hit.

down

Type PointerTypeEvent & PointerEvent & MouseTouchEvent

Invoked when the mouse button is pressed or touch starts.

drag

Type PointerTypeEvent & ShiftEvent & PointEvent & { event: MouseEvent | TouchEvent | KeyboardEvent, startPoint: IPoint }

Invoked when draggable object is being dragged. (using mouse, touch or keyboard)

dragstart

Type PointerTypeEvent & { event: MouseEvent | TouchEvent | KeyboardEvent }

Invoked when draggable object dragging starts. This event is not invoked immediatelly after down, but only if there's a movement of the pointer.

dragstop

Type PointerTypeEvent & { event: MouseTouchEvent | KeyboardEvent }

Invoked when draggable object is released. This event will not fire if position of the object did not change.

focus

Type { event: FocusEvent }

Invoked when focusable object gains focus, e.g. by using TAB button.

hit

Type PointerTypeEvent & PointEvent & MouseTouchEvent

Invoked when object is clicked or touched.

input

Type { event: KeyboardEvent }

Invoked whenever information changes in the textual input elements, like <input>, <textarea>, etc.

keydown

Type { event: KeyboardEvent }

Invoked when the key is pressed on the keyboard.

keypress

Type { event: KeyboardEvent }

Invoked when the key generates a "press", e.g. pressing and holding a letter key will generate repeated "keypress" events.

keyup

Type { event: KeyboardEvent }

Invoked when the key is released on the keyboard.

out

Type PointerTypeEvent & MouseTouchEvent & PointerEvent

Invoked when mouse cursor moves out of hoverable object or it is no longer touched.

NOTE: this event might not always contains pointer parameter as event might be triggered by API?

over

Type PointerTypeEvent & MouseTouchEvent & PointerEvent

Invoked when mouse cursor moves over hoverable object or it is touched.

NOTE: this event might not always contains pointer parameter as event might be triggered by API?

resize

Type PointerTypeEvent & ScaleEvent & MouseTouchEvent & { point1: IPoint, point2: IPoint, startPoint1: IPoint, startPoint2: IPoint }

Invoked when resizable object is being resized either by mouse or touch pinch gesture.

rightclick

Type MouseTouchEvent

Invoked when right mouse button is clicked on the object.

swipe

Type PointerTypeEvent & MouseTouchEvent

Invoked when user performs "swiping" gesture (quick horizontal movement) on the object, either using mouse or touch.

swipeleft

Type PointerTypeEvent & MouseTouchEvent

Invoked when user performs "swiping" gesture towards left.

swiperight

Type PointerTypeEvent & MouseTouchEvent

Invoked when user performs "swiping" gesture towards right.

track

Type PointerTypeEvent & PointEvent & PointerEvent & MouseTouchEvent

Invoked when pointer (mouse cursor or touch point) moves over trackable object.

up

Type PointerTypeEvent & PointerEvent & MouseTouchEvent

Invoked when the mouse button is released or touch ends.

wheel

Type PointEvent & ShiftEvent & { event: WheelEvent }

Invoked when user turns mouse wheel while over the object.

wheeldown

Type PointEvent & ShiftEvent & { event: WheelEvent }

Invoked when user turns mouse wheel downwards while over the object.

wheelleft

Type PointEvent & ShiftEvent & { event: WheelEvent }

Invoked when user turns mouse wheel leftwards while over the object.

wheelright

Type PointEvent & ShiftEvent & { event: WheelEvent }

Invoked when user turns mouse wheel rightwards while over the object.

wheelup

Type PointEvent & ShiftEvent & { event: WheelEvent }

Invoked when user turns mouse wheel upwards while over the object.