Drag[en]gine Script Module DragonScript  1.23
Dragengine.InputDevice Class Reference

Input device information. More...

Inheritance diagram for Dragengine.InputDevice:

Public Member Functions

Management
InputEventSource getSource ()
 System owning the device. More...
 
int getIndex ()
 Device index. More...
 
String getID ()
 Device identifier. More...
 
String getName ()
 Display name. More...
 
InputDeviceType getType ()
 Device type. More...
 
Model getDisplayModel ()
 Model to represent the device in 3D user interfaces or null if not set. More...
 
Skin getDisplaySkin ()
 Skin for display model or null if not set. More...
 
Image getDisplayImage ()
 Image to represent the device in 2D user interfaces or NULL if not set. More...
 
int getDisplayIconCount ()
 Count of icons representing the device in bindings. More...
 
Image getDisplayIconAt (int index)
 Icon at index representing the device in bindings. More...
 
Image getLargestDisplayIconX (int maxWidth)
 Largest icon not exceeding width representing the device in bindings. More...
 
Image getLargestDisplayIconY (int maxHeight)
 Largest icon not exceeding height representing the device in bindings. More...
 
String getDisplayText ()
 Text to display centered across display image or icon. More...
 
InputDeviceBoneConfiguration getBoneConfiguration ()
 Device bone configuration. More...
 
Vector getFingerTipOffset (int index)
 Finger tip offsets. More...
 
Rig getHandRig ()
 Hand rig if ebcHand is used. More...
 
bool getSupportsFaceEyeExpressions ()
 Device supports face eye expressions. More...
 
bool getSupportsFaceMouthExpressions ()
 Device supports face mouth expressions. More...
 
Model getVRModel ()
 Model to represent the device in VR environments or null if not set. More...
 
Skin getVRSkin ()
 Skin for VR model or null if not set. More...
 
bool isPresent ()
 Input device is present on the host platform. More...
 
int getAxisCount ()
 Number of axes. More...
 
InputDeviceAxis getAxisAt (int index)
 Get wrapper for axis. More...
 
int getButtonCount ()
 Number of buttons. More...
 
InputDeviceButton getButtonAt (int index)
 Get wrapper for button. More...
 
int getFeedbackCount ()
 Number of feedbacks. More...
 
InputDeviceFeedback getFeedbackAt (int index)
 Get wrapper for feedback. More...
 
int getComponentCount ()
 Number of components. More...
 
InputDeviceComponent getComponentAt (int index)
 Get wrapper for component. More...
 
int buttonMatchingKeyCode (int keyCode)
 Index of button best matching key code or -1 if not found. More...
 
int buttonMatchingKeyChar (int character)
 Index of button best matching character or -1 if not found. More...
 
int buttonMatchingKeyCode (int keyCode, InputEventKeyLocation location)
 Index of button best matching key code or -1 if not found. More...
 
int buttonMatchingKeyChar (int character, InputEventKeyLocation location)
 Index of button best matching character or -1 if not found. More...
 
Vector getDevicePosePosition ()
 Device pose position relative to tracking reference coordinate frame. More...
 
Quaternion getDevicePoseOrientation ()
 Device pose orientation relative to tracking reference coordinate frame. More...
 
Vector getDevicePoseLinearVelocity ()
 Device pose linear velocity relative to tracking reference coordinate frame. More...
 
Vector getDevicePoseAngularVelocity ()
 Device pose angular velocity relative to tracking reference coordinate frame. More...
 
Matrix getDevicePoseMatrix ()
 Device pose matrix relative to tracking reference coordinate frame. More...
 
int getDeviceBonePoseCount ()
 Count of device bone pose positions. More...
 
Vector getDeviceBonePosePosition (int bone, bool withController)
 Device bone pose position relative to parent reference coordinate frame. More...
 
Quaternion getDeviceBonePoseOrientation (int bone, bool withController)
 Device bone pose orientation relative to parent reference coordinate frame. More...
 
Matrix getDeviceBonePoseMatrix (int bone, bool withController)
 Device bone pose matrix relative to parent reference coordinate frame. More...
 
int getDeviceFaceExpressionCount ()
 Count of device face expressions. More...
 
float getDeviceFaceExpressionAt (int index)
 Device face expression. More...
 

Detailed Description

Input device information.

Stores information about an input device attached to the host platform. The information stays present as long as a reference is hold to this instance. The input device itself can though be removed from the host system at any time without warning. To avoid exceptions due to missing input devices the input device can be still queried if not attached but returns a dummy state. Use the isPresent() method to check if the device is still attached to the host platform or not.

Input devices have a unique identifier valid across host platforms. Using this identifier the scripts can save control bindings in config files. Identifiers compose only of letters and the underscore.

This is a native class.

Member Function Documentation

◆ buttonMatchingKeyChar() [1/2]

int Dragengine.InputDevice.buttonMatchingKeyChar ( int  character)

Index of button best matching character or -1 if not found.

If more than one button matches the character the input module decides which button is the more likely choice. Once decided the input module is required to return the same button for the same character in subsequent queries unless a deInputEvent::eeDeviceParamsChanged event is issued.

Keys usually have different characters depending on the state of modifier keys. The input module matches character case insensitive to increase the chance to find a match. If mutliple keys match the character but under different modifier states the input module has to first select the key matching case sensitive then the key requiring less modifiers.

Can be used for example to locate keyboard keys to create default binding layouts without the user pressing input keys.

◆ buttonMatchingKeyChar() [2/2]

int Dragengine.InputDevice.buttonMatchingKeyChar ( int  character,
InputEventKeyLocation  location 
)

Index of button best matching character or -1 if not found.

Version
1.7

Same as buttonMatchingKeyChar(int) but allows to distinguish between multiple keys of the same type, for example left and right shift key.

◆ buttonMatchingKeyCode() [1/2]

int Dragengine.InputDevice.buttonMatchingKeyCode ( int  keyCode)

Index of button best matching key code or -1 if not found.

If more than one button matches the key code the input module decides which button is the more likely choice. Once decided the input module is required to return the same button for the same key code in subsequent queries unless a deInputEvent::eeDeviceParamsChanged event is issued.

Can be used for example to locate keyboard keys to create default binding layouts without the user pressing input keys.

◆ buttonMatchingKeyCode() [2/2]

int Dragengine.InputDevice.buttonMatchingKeyCode ( int  keyCode,
InputEventKeyLocation  location 
)

Index of button best matching key code or -1 if not found.

Version
1.7

Same as buttonMatchingKeyChar(int) but allows to distinguish between multiple keys of the same type, for example left and right shift key.

◆ getAxisAt()

InputDeviceAxis Dragengine.InputDevice.getAxisAt ( int  index)

Get wrapper for axis.

Exceptions
EOutOfBoundaryindex is less than 0 or larger than or equal to getAxisCount().

◆ getAxisCount()

int Dragengine.InputDevice.getAxisCount ( )

Number of axes.

◆ getBoneConfiguration()

InputDeviceBoneConfiguration Dragengine.InputDevice.getBoneConfiguration ( )

Device bone configuration.

Version
1.6

◆ getButtonAt()

InputDeviceButton Dragengine.InputDevice.getButtonAt ( int  index)

Get wrapper for button.

Exceptions
EOutOfBoundaryindex is less than 0 or larger than or equal to getButtonCount().

◆ getButtonCount()

int Dragengine.InputDevice.getButtonCount ( )

Number of buttons.

◆ getComponentAt()

InputDeviceComponent Dragengine.InputDevice.getComponentAt ( int  index)

Get wrapper for component.

Exceptions
EOutOfBoundaryindex is less than 0 or larger than or equal to getComponentCount().

◆ getComponentCount()

int Dragengine.InputDevice.getComponentCount ( )

Number of components.

◆ getDeviceBonePoseCount()

int Dragengine.InputDevice.getDeviceBonePoseCount ( )

Count of device bone pose positions.

◆ getDeviceBonePoseMatrix()

Matrix Dragengine.InputDevice.getDeviceBonePoseMatrix ( int  bone,
bool  withController 
)

Device bone pose matrix relative to parent reference coordinate frame.

Parameters
withControllerIf true returns bone position as accurate as possible to the real hand position. If false remaps the position to simulate not holding the controller in hand.

◆ getDeviceBonePoseOrientation()

Quaternion Dragengine.InputDevice.getDeviceBonePoseOrientation ( int  bone,
bool  withController 
)

Device bone pose orientation relative to parent reference coordinate frame.

Parameters
withControllerIf true returns bone position as accurate as possible to the real hand position. If false remaps the position to simulate not holding the controller in hand.

◆ getDeviceBonePosePosition()

Vector Dragengine.InputDevice.getDeviceBonePosePosition ( int  bone,
bool  withController 
)

Device bone pose position relative to parent reference coordinate frame.

Parameters
boneIndex of bone to retrieve.
withControllerIf true returns bone position as accurate as possible to the real hand position. If false remaps the position to simulate not holding the controller in hand.

◆ getDeviceFaceExpressionAt()

float Dragengine.InputDevice.getDeviceFaceExpressionAt ( int  index)

Device face expression.

Parameters
indexIndex of face expression. Use InputDeviceFaceExpression constants.

◆ getDeviceFaceExpressionCount()

int Dragengine.InputDevice.getDeviceFaceExpressionCount ( )

Count of device face expressions.

◆ getDevicePoseAngularVelocity()

Vector Dragengine.InputDevice.getDevicePoseAngularVelocity ( )

Device pose angular velocity relative to tracking reference coordinate frame.

◆ getDevicePoseLinearVelocity()

Vector Dragengine.InputDevice.getDevicePoseLinearVelocity ( )

Device pose linear velocity relative to tracking reference coordinate frame.

◆ getDevicePoseMatrix()

Matrix Dragengine.InputDevice.getDevicePoseMatrix ( )

Device pose matrix relative to tracking reference coordinate frame.

◆ getDevicePoseOrientation()

Quaternion Dragengine.InputDevice.getDevicePoseOrientation ( )

Device pose orientation relative to tracking reference coordinate frame.

◆ getDevicePosePosition()

Vector Dragengine.InputDevice.getDevicePosePosition ( )

Device pose position relative to tracking reference coordinate frame.

◆ getDisplayIconAt()

Image Dragengine.InputDevice.getDisplayIconAt ( int  index)

Icon at index representing the device in bindings.

Icon typically has a size of 16, 24, 32 or 64.

◆ getDisplayIconCount()

int Dragengine.InputDevice.getDisplayIconCount ( )

Count of icons representing the device in bindings.

◆ getDisplayImage()

Image Dragengine.InputDevice.getDisplayImage ( )

Image to represent the device in 2D user interfaces or NULL if not set.

Large image of 128 pixels squared or larger.

◆ getDisplayModel()

Model Dragengine.InputDevice.getDisplayModel ( )

Model to represent the device in 3D user interfaces or null if not set.

◆ getDisplaySkin()

Skin Dragengine.InputDevice.getDisplaySkin ( )

Skin for display model or null if not set.

◆ getDisplayText()

String Dragengine.InputDevice.getDisplayText ( )

Text to display centered across display image or icon.

◆ getFeedbackAt()

InputDeviceFeedback Dragengine.InputDevice.getFeedbackAt ( int  index)

Get wrapper for feedback.

Exceptions
EOutOfBoundaryindex is less than 0 or larger than or equal to getFeedbackCount().

◆ getFeedbackCount()

int Dragengine.InputDevice.getFeedbackCount ( )

Number of feedbacks.

◆ getFingerTipOffset()

Vector Dragengine.InputDevice.getFingerTipOffset ( int  index)

Finger tip offsets.

Version
1.6

For use with ebcHand bone configuration. Defines the offset of the finger tip point relative to the last finger segment coordinate frame. These are typically used to figure out where finger tips touch objects in the world.

◆ getHandRig()

Rig Dragengine.InputDevice.getHandRig ( )

Hand rig if ebcHand is used.

Version
1.6

◆ getID()

String Dragengine.InputDevice.getID ( )

Device identifier.

Unique identifier for the device identifying it across removing and attaching the device to the host system. The prefix is a normalized string that contains only letters, numbers and underscores. It is suitable to be combined with button or axis identifiers to store them in config files as key bindings.

◆ getIndex()

int Dragengine.InputDevice.getIndex ( )

Device index.

◆ getLargestDisplayIconX()

Image Dragengine.InputDevice.getLargestDisplayIconX ( int  maxWidth)

Largest icon not exceeding width representing the device in bindings.

Icon typically has a size of 16, 24, 32 or 64.

◆ getLargestDisplayIconY()

Image Dragengine.InputDevice.getLargestDisplayIconY ( int  maxHeight)

Largest icon not exceeding height representing the device in bindings.

Icon typically has a size of 16, 24, 32 or 64.

◆ getName()

String Dragengine.InputDevice.getName ( )

Display name.

Dispaly name is human readable like for example 'USB Gamepad #1'. The name is unique but not guaranteed to stay the same across restarting the input module or game engine.

◆ getSource()

InputEventSource Dragengine.InputDevice.getSource ( )

System owning the device.

Version
1.6

Device index is only valid for the matching system.

◆ getSupportsFaceEyeExpressions()

bool Dragengine.InputDevice.getSupportsFaceEyeExpressions ( )

Device supports face eye expressions.

Version
1.12

◆ getSupportsFaceMouthExpressions()

bool Dragengine.InputDevice.getSupportsFaceMouthExpressions ( )

Device supports face mouth expressions.

Version
1.12

◆ getType()

InputDeviceType Dragengine.InputDevice.getType ( )

Device type.

◆ getVRModel()

Model Dragengine.InputDevice.getVRModel ( )

Model to represent the device in VR environments or null if not set.

Version
1.6

◆ getVRSkin()

Skin Dragengine.InputDevice.getVRSkin ( )

Skin for VR model or null if not set.

Version
1.6

◆ isPresent()

bool Dragengine.InputDevice.isPresent ( )

Input device is present on the host platform.

Returns true if a device matching the identifier is currently attached to the host platform. If absent all values queried from the device are 0 to avoid exceptions to be thrown.


The documentation for this class was generated from the following file: