Skip to main content

Class: InputDevice

InkInput.InputDevice()

new InputDevice()

Properties:
NameTypeDescription
environmentEnvironment

Extends

Methods

add(input, ignoredopt)

Adds sensor data input

Parameters:
NameTypeAttributesDefaultDescription
inputPathBuilding.PointerDataInk input
ignoredboolean<optional>falsePipeline will ignore this input sample

closeStream(abortedopt) → InkInput.SensorData

Parameters:
NameTypeAttributesDefaultDescription
abortedboolean<optional>falseIs stream is aborted or closed normally
Returns:

collected sesnor data

Type

InkInput.SensorData

getInkInputProvider(type) → InkInput.InkInputProvider

Provides default InkInputProvider instance. For user defined instance should be overridden.

Parameters:
NameTypeDescription
typeInkInput.InkInputProvider.TypePointer type
Returns:

Default instance based on type

Type

InkInput.InkInputProvider

getInkSensorContext(inkProviderType) → InkInput.SensorContext

Provides default SensorContext instance. For user defined instance should be overridden.

Parameters:
NameTypeDescription
inkProviderTypeInkInput.InkInputProvider.TypePointer type
Returns:

Default instance based on type

Type

InkInput.SensorContext

link(device)

When external device provides collecatable data, InputDevice class should be extended.openStream, add and closeStream metods should be overridden.openStream and closeStream are called for every device when ink stream is opened and closed.openStream recieves as argument an instance of SensorData with ink sensor stream.

Parameters:
NameTypeDescription
deviceInkInput.InputDevice

openStream(sample)

Resets collector state. Reset state should happens when BEGIN phase is detected.InkBuilder implementation automates this processing when instance is configured to collect sensor data..

Parameters:
NameTypeDescription
sampleInkInput.SensorPointSample input

(async, static) createInstance(envProps) → InkInput.InputDevice

Creates default input device instance, based on system information

Parameters:
NameTypeDescription
envPropsPropertiesUser defined env properties, like app.id for example
Returns:

default instance

Type

InkInput.InputDevice

(static) hasUsage(name, e) → {boolean}

Validate input value

Parameters:
NameTypeDescription
namestringProperty name
ePointerEventInput event
Returns:

Is property usable

Type

boolean

(static) isValidInput(name, point) → {boolean}

Validate input value

Parameters:
NameTypeDescription
namestringProperty name
pointInkInput.SensorPointPointer data
Returns:

Is valid property value

Type

boolean

Home