InputHelper

lumin. InputHelper

Classes

DeviceInfo
EyeFixationPosition
EyeInfo
EyeStressInfo
GestureState
HandState
TouchPadState

Methods

getActiveDevices() → {Array.<lumin.InputHelper.DeviceInfo>}

Returns infomation about the devices that have been used with this client

Returns:

a vector containing the active device information

Type
Array.<lumin.InputHelper.DeviceInfo>

getAllPerformedGestures() → {Object.<number, Array.<lumin.input.GestureType>>}

Returns a map of the gestures performed by all the active devices, mapped by their device IDs

Returns:

the map of devices and gestures

Type
Object.<number, Array.<lumin.input.GestureType>>

getDeviceOrientation(deviceID) → {quat}

Returns the orientation of the given device (in world coordinates)

Parameters:
Name Type Description
deviceID number

the ID of the device to retreive the orientation for

Returns:

the given device's orientation (in world coordinates)

Type
quat

getDevicePosition(deviceID) → {vec3}

Returns the position of the given device (in world coordinates)

Parameters:
Name Type Description
deviceID number

the ID of the device to retreive the position for

Returns:

the given device's position (in world coordinates)

Type
vec3

getDevicesButtonDown(keycode) → {Array.<number>}

Returns a list of all the devices that a given key is down on (Note that a button is
considered "down" at any point while it is held)

Parameters:
Name Type Description
keycode lumin.input.KeyCodes

the code of the key to test

Returns:

the list of devices that have the given key down

Type
Array.<number>

getDevicesButtonPressed(keycode) → {Array.<number>}

Returns a list of all the devices that a given key has been pressed on this frame (Note
that a button is considered "pressed" only on the first frame that it is held, use
isButtonDown to test if the button is down over multiple frames)

Parameters:
Name Type Description
keycode lumin.input.KeyCodes

the code of the key to test

Returns:

the list of devices that have the given key pressed

Type
Array.<number>

getDevicesButtonReleased(keycode) → {Array.<number>}

Returns a list of all the devices that a given key has been released on this frame

Parameters:
Name Type Description
keycode lumin.input.KeyCodes

the code of the key to test

Returns:

the list of devices that have the given key released

Type
Array.<number>

getDevicesGesturePerformed(gesture) → {Array.<number>}

Returns whether ANY device is receiving (or has received) a given gesture this frame and
also returns a list of those devices

Parameters:
Name Type Description
gesture lumin.input.GestureType

the gesture to test

Returns:

a list of devices currently performing the given gesture

    any device, false otherwise
Type
Array.<number>

getDeviceType(deviceID) → {lumin.input.EventSource}

Returns the type of a requested device

Parameters:
Name Type Description
deviceID number

the ID of the device

Returns:

the type of the device

Type
lumin.input.EventSource

getDownButtons() → {Object.<number, Array.<lumin.input.KeyCodes>>}

Returns a map of all keys down this frame, mapped by their devices

Returns:

a map of devices to lists of keys that are currently down on
that device

Type
Object.<number, Array.<lumin.input.KeyCodes>>

getEyeFixationPosition() → {lumin.InputHelper.EyeFixationPosition}

Returns the data associated with the fixation of the eyes (in world coordinates)

Returns:

the position of the user's fixation and the confidence in the values given
by the eye tracking system(ranges from 0.0 to 1.0f), null if eye fixation
data doesn't exist

Type
lumin.InputHelper.EyeFixationPosition

getEyeStressInformation() → {lumin.InputHelper.EyeStressInfo}

Returns data about potential eye stress

Returns:

data structure of eye stress if it exists

    - isFixationDepthUncomfortable whether or not the users current fixation point
      is too close to them
    - hasDepthViolationOccured whether or not a depth violation has occurred (this
      happens when a user's fixation point remains too close for too long)
    - remainingAtUncomfortableDistance the number of seconds remaining for a user
      to have their fixation depth at an unacceptable distance before a depth
      violation occurs
    null thoerwise
Type
lumin.InputHelper.EyeStressInfo

getGestureData(deviceID, gesture) → {Array.<lumin.InputHelper.GestureState>}

Returns the gesture data associated with a given gesture for a given device

Parameters:
Name Type Description
deviceID number

the device to retreive the gesture data for

gesture lumin.input.GestureType

the gesture to retrieve the gesture data for

Returns:

a list of the gesture data that has been received since it was last
updated

Type
Array.<lumin.InputHelper.GestureState>

getLeftEyeInformation() → {lumin.InputHelper.EyeInfo}

Returns the data associated with the left eye (in world coordinates)

Returns:

data structure of the left eye information if it exists

    - position the position of the left eye
    - rotation the rotation of the left eye
    - confidence the confidence in the values given by the eye tracking system
      (ranges from 0.0 to 1.0f)
    - isBlinking true if the user has their left eye closed, false otherwise
    null otherwise
Type
lumin.InputHelper.EyeInfo

getLeftHandState() → {lumin.InputHelper.HandState}

Returns the left hand tracking information

Returns:

the left hand tracking information

Type
lumin.InputHelper.HandState

getPerformedGesture(deviceID) → {Array.<lumin.input.GestureType>}

Returns a list of all gestures performed (or being performed) on a given device this frame

Parameters:
Name Type Description
deviceID number

the ID of the device for which to retreive the gesture data

Returns:

the list of gestures performed (or being performed) this frame

    device this frame, false otherwise
Type
Array.<lumin.input.GestureType>

getPressedButtons() → {Object.<number, Array.<lumin.input.KeyCodes>>}

Returns a map of all keys pressed this frame, mapped by their devices

Returns:

a map of devices to lists of keys that are currently pressed
on that device

Type
Object.<number, Array.<lumin.input.KeyCodes>>

getReleasedButtons() → {Object.<number, Array.<lumin.input.KeyCodes>>}

Returns a map of all keys released this frame, mapped by their devices

Returns:

a map of devices to lists of keys released on that device

Type
Object.<number, Array.<lumin.input.KeyCodes>>

getRightEyeInformation() → {lumin.InputHelper.EyeInfo}

Returns the data associated with the right eye (in world coordinates)

Returns:

data structure of the right eye information if it exists

    - position the position of the right eye
    - rotation the rotation of the right eye
    - confidence the confidence in the values given by the eye tracking system
      (ranges from 0.0 to 1.0f)
    - isBlinking true if the user has their right eye closed, false otherwise
    null otherwise
Type
lumin.InputHelper.EyeInfo

getRightHandState() → {lumin.InputHelper.HandState}

Returns the right hand tracking information

Returns:

the right hand tracking information

Type
lumin.InputHelper.HandState

getTouchPadPosition() → {Array.<lumin.InputHelper.TouchPadState>}

Returns the touchpad touch information for all active devices that have touchpad information

Returns:

touchPadInfo the list of device touchpad information
return true if at least one device with touchpad information exists, false otherwise

Type
Array.<lumin.InputHelper.TouchPadState>

getTouchPadPosition(deviceID) → {lumin.InputHelper.TouchPadState}

Returns the touched touchpad position(s) for a given device

Parameters:
Name Type Description
deviceID number

the ID of the device to retreive the touchpad position for

Returns:

the returned touchpad information

Type
lumin.InputHelper.TouchPadState

isButtonDown(keycode) → {boolean}

Returns whether a given key is currently down on ANY active device (Note that a button
is considered "down" at any point while it is held)

Parameters:
Name Type Description
keycode lumin.input.KeyCodes

the code of the key to test

Returns:

true if there is a device has the given key down, false otherwise

Type
boolean

isButtonDown(keycode, deviceID) → {boolean}

Returns whether a given key is currently down the given device (Note that a button
is considered "down" at any point while it is held)

Parameters:
Name Type Description
keycode lumin.input.KeyCodes

the code of the key to test

deviceID number

the device to test the keycode on

Returns:

true if the given device has the given key down, false otherwise

Type
boolean

isButtonPressed(keycode) → {boolean}

Returns whether a given key has been pressed on ANY active device this frame (Note that
a button is considered "pressed" only on the first frame that it is held, use
isButtonDown to test if the button is down over multiple frames)

Parameters:
Name Type Description
keycode lumin.input.KeyCodes

the code of the key to test

Returns:

true if there is a device has pressed the given key this frame, false otherwise

Type
boolean

isButtonPressed(keycode, deviceID) → {boolean}

Returns whether a given key has been pressed on the given device this frame (Note that
a button is considered "pressed" only on the first frame that it is held, use
isButtonDown to test if the button is down over multiple frames)

Parameters:
Name Type Description
keycode lumin.input.KeyCodes

the code of the key to test

deviceID number

the device to test the keycode on

Returns:

true if the given device has the given key pressed this frame, false otherwise

Type
boolean

isButtonReleased(keycode) → {boolean}

Returns whether a given key has been released on ANY active device this frame

Parameters:
Name Type Description
keycode lumin.input.KeyCodes

the code of the key to test

Returns:

true if there is a device has released the given key this frame, false otherwise

Type
boolean

isButtonReleased(keycode, deviceID) → {boolean}

Returns whether a given key has been released on the given device this frame

Parameters:
Name Type Description
keycode lumin.input.KeyCodes

the code of the key to test

deviceID number

the device to test the keycode on

Returns:

true if the given deivce has released the given key this frame, false otherwise

Type
boolean

isDeviceOrientationUpdated(deviceID) → {boolean}

Checks if the given device's orientation has been updated this frame

Parameters:
Name Type Description
deviceID number

the ID of the device to test

Returns:

true if the given device has had its orientation updated this frame, false
otherwise

Type
boolean

isDevicePositionUpdated(deviceID) → {boolean}

Checks if the given device's position has been updated this frame

Parameters:
Name Type Description
deviceID number

the ID of the device to test

Returns:

true if the given device has had its position updated this frame, false
otherwise

Type
boolean

isEyeTrackingUpdated() → {boolean}

Returns whether or not new eye tracking information has been received this frame

Returns:

true if new eye tracking information has been received this frame, false otherwise

Type
boolean

isGestureDataUpdated(deviceID, gesture) → {boolean}

Returns whether new data for a gesture has been received this frame

Parameters:
Name Type Description
deviceID number

the device to check the gesture data for

gesture lumin.input.GestureType

the gesture to check the gesture data for

Returns:

true if this device exists, has data for the given gesture and that data has been
updated this frame, false otherwise

Type
boolean

isGesturePerformed(gesture) → {boolean}

Returns whether ANY device is receiving (or has received) a given gesture this frame

Parameters:
Name Type Description
gesture lumin.input.GestureType

the gesture to test

Returns:

true if the given gesture has been received (or is being received) this frame by
any device, false otherwise

Type
boolean

isLeftHandTrackingUpdated() → {boolean}

Returns whether or not new left hand tracking information has been received this frame

Returns:

true if new left hand tracking information has been received this frame, false
otherwise

Type
boolean

isRightHandTrackingUpdated() → {boolean}

Returns whether or not new right hand tracking information has been received this frame

Returns:

true if new right hand tracking information has been received this frame, false
otherwise

Type
boolean

isTouchPadDown() → {boolean}

Returns whether ANY active device's touchpad is currently being used

Returns:

true if there is a device whose touchpad is being used, false otherwise

Type
boolean

isTouchPadDown(deviceID) → {boolean}

Returns whether the given device's touchpad is currently being used

Parameters:
Name Type Description
deviceID number
Returns:

true if the given device exists and has its touchpad being used

Type
boolean