Skip to main content

Class: InputListener

InputListener()

Pointer events monitor. Manage InkController instance stages.

Constructor

new InputListener()

Properties:
NameTypeAttributesDefaultDescription
suppressKeysInputListener.SuppressKeysMapInk input prevent mechanism for special keys
disablePressureProtectionboolean<optional>flaseWhen is true pen pressure protection is disabled. BEGIN Phase is started when pressure is provided only.

Methods

attach(inkController, pointerTypesopt)

Attach ink listeners

Parameters:
NameTypeAttributesDefaultDescription
inkControllerInkInput.InkController
pointerTypesArray.<string><optional>["mouse", "touch", "pen"]

close(inkController)

Detach all listeners

Parameters:
NameTypeDescription
inkControllerInkInput.InkController

Deprecated:

  • since version 2.0 - use method detach instead

createSensorPoint(e) → InkInput.SensorPoint

From event input defines sensor point, based on PointerEvent

Parameters:
NameTypeDescription
ePointerEventInput event
Returns:

Pointer data

Type

InkInput.SensorPoint

detach(inkController)

Detach ink listeners

Parameters:
NameTypeDescription
inkControllerInkInput.InkController

disable(inkControlleropt, pointerTypeopt)

Disable listener

Parameters:
NameTypeAttributesDefaultDescription
inkControllerInkInput.InkController<optional>When is not available, all ink input is disabled
pointerTypestring<optional>allSuppress listener for particular pointer type, wehere it could be one of: pen, mouse, touch

enable(inkControlleropt, pointerTypeopt)

Enable listener

Parameters:
NameTypeAttributesDefaultDescription
inkControllerInkInput.InkController|HTMLCanvasElement<optional>When is not available, all ink input is enable
pointerTypestring<optional>allSuppress listener for particular pointer type, wehere it could be one of: pen, mouse, touch

open(inkController)

Attach ink listeners for mouse, touch and pointer input.Ink abort, depends on ink controller implementation.

Parameters:
NameTypeDescription
inkControllerInkInput.InkController

Deprecated:

  • since version 2.0 - use method attach instead

start(pointerTypeopt)

Enable listening for a particular pointer type, previuosly disabled

Parameters:
NameTypeAttributesDefaultDescription
pointerTypePointerEvent.PointerType<optional>*

Deprecated:

  • since version 2.0 - use method enable instead

stop(pointerTypeopt)

Disable listening for a particular pointer type

Parameters:
NameTypeAttributesDefaultDescription
pointerTypePointerEvent.PointerType<optional>*

Deprecated:

  • since version 2.0 - use method disable instead

Type Definitions

SuppressKeysMap

Suppress keys map

Properties:
NameTypeAttributesDefaultDescription
ctrlKeyboolean<optional>trueWhen ctrl key is pressed, inking is suppressed
altKeyboolean<optional>trueWhen alt key is pressed, inking is suppressed
shiftKeyboolean<optional>trueWhen shift key is pressed, inking is suppressed
metaKeyboolean<optional>trueWhen cmd/win key is pressed, inking is suppressed

Home