Class: InputListener
InputListener()
Pointer events monitor. Manage InkController instance stages.
Constructor
new InputListener()
Properties:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
suppressKeys | InputListener.SuppressKeysMap | Ink input prevent mechanism for special keys | ||
disablePressureProtection | boolean | <optional> | flase | When is true pen pressure protection is disabled. BEGIN Phase is started when pressure is provided only. |
Methods
attach(inkController, pointerTypesopt)
Attach ink listeners
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
inkController | InkInput.InkController | |||
pointerTypes | Array.<string> | <optional> | ["mouse", "touch", "pen"] |
close(inkController)
Detach all listeners
Parameters:
Name | Type | Description |
---|---|---|
inkController | InkInput.InkController |
Deprecated:
- since version 2.0 - use method detach instead
createSensorPoint(e) → InkInput.SensorPoint
From event input defines sensor point, based on PointerEvent
Parameters:
Name | Type | Description |
---|---|---|
e | PointerEvent | Input event |
Returns:
Pointer data
Type
detach(inkController)
Detach ink listeners
Parameters:
Name | Type | Description |
---|---|---|
inkController | InkInput.InkController |
disable(inkControlleropt, pointerTypeopt)
Disable listener
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
inkController | InkInput.InkController | <optional> | When is not available, all ink input is disabled | |
pointerType | string | <optional> | all | Suppress listener for particular pointer type, wehere it could be one of: pen, mouse, touch |
enable(inkControlleropt, pointerTypeopt)
Enable listener
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
inkController | InkInput.InkController|HTMLCanvasElement | <optional> | When is not available, all ink input is enable | |
pointerType | string | <optional> | all | Suppress 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:
Name | Type | Description |
---|---|---|
inkController | InkInput.InkController |
Deprecated:
- since version 2.0 - use method attach instead
start(pointerTypeopt)
Enable listening for a particular pointer type, previuosly disabled
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
pointerType | PointerEvent.PointerType | <optional> | * |
Deprecated:
- since version 2.0 - use method enable instead
stop(pointerTypeopt)
Disable listening for a particular pointer type
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
pointerType | PointerEvent.PointerType | <optional> | * |
Deprecated:
- since version 2.0 - use method disable instead
Type Definitions
SuppressKeysMap
Suppress keys map
Properties:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
ctrlKey | boolean | <optional> | true | When ctrl key is pressed, inking is suppressed |
altKey | boolean | <optional> | true | When alt key is pressed, inking is suppressed |
shiftKey | boolean | <optional> | true | When shift key is pressed, inking is suppressed |
metaKey | boolean | <optional> | true | When cmd/win key is pressed, inking is suppressed |