Drag[en]gine Script Module DragonScript 1.35
Loading...
Searching...
No Matches
Dragengine.InputDevice Class Reference

Input device information. More...

Inheritance diagram for Dragengine.InputDevice:

Public Member Functions

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

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.

References getFeedbackCount().

Referenced by getDeviceBonePoseMatrix(), and getDeviceFaceExpressionAt().

◆ 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.

References getComponentCount().

◆ 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.

References getButtonAt(), and getButtonCount().

Referenced by getDeviceBonePoseCount(), and getDeviceFaceExpressionAt().

◆ 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.

References getFeedbackAt().

◆ getAxisAt()

InputDeviceAxis Dragengine.InputDevice.getAxisAt ( int index)

Get wrapper for axis.

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

Referenced by getComponentAt().

◆ getAxisCount()

int Dragengine.InputDevice.getAxisCount ( )

Number of axes.

References getUsingHandInteraction().

Referenced by getComponentAt().

◆ getBodyRig()

Rig Dragengine.InputDevice.getBodyRig ( )

Body rig if InputDeviceBoneConfiguration#upperBody or InputDeviceBoneConfiguration#fullBody is used.

Version
1.31

References getBoneConfiguration().

Referenced by getVRModel().

◆ getBoneConfiguration()

InputDeviceBoneConfiguration Dragengine.InputDevice.getBoneConfiguration ( )

Device bone configuration.

Version
1.6

References getLargestDisplayIconX().

Referenced by getBodyRig().

◆ getButtonAt()

InputDeviceButton Dragengine.InputDevice.getButtonAt ( int index)

Get wrapper for button.

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

References getVRSkin().

Referenced by buttonMatchingKeyCode().

◆ getButtonCount()

int Dragengine.InputDevice.getButtonCount ( )

Number of buttons.

References getVRModel().

Referenced by buttonMatchingKeyCode().

◆ getComponentAt()

InputDeviceComponent Dragengine.InputDevice.getComponentAt ( int index)

Get wrapper for component.

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

References getAxisAt(), and getAxisCount().

Referenced by getDevicePoseLinearVelocity().

◆ getComponentCount()

int Dragengine.InputDevice.getComponentCount ( )

Number of components.

References isPresent().

Referenced by buttonMatchingKeyChar().

◆ getDeviceBonePoseCount()

int Dragengine.InputDevice.getDeviceBonePoseCount ( )

Count of device bone pose positions.

References buttonMatchingKeyCode().

Referenced by getDeviceFaceExpressionAt().

◆ 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.

References buttonMatchingKeyChar().

Referenced by getDeviceFaceExpressionAt().

◆ 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.

Referenced by getDeviceFaceExpressionAt().

◆ 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.

Referenced by getDeviceFaceExpressionAt().

◆ getDeviceFaceExpressionAt()

◆ getDeviceFaceExpressionCount()

int Dragengine.InputDevice.getDeviceFaceExpressionCount ( )

Count of device face expressions.

Referenced by getDeviceFaceExpressionAt().

◆ getDevicePoseAngularVelocity()

Vector Dragengine.InputDevice.getDevicePoseAngularVelocity ( )

Device pose angular velocity relative to tracking reference coordinate frame.

Referenced by getDeviceFaceExpressionAt().

◆ getDevicePoseLinearVelocity()

Vector Dragengine.InputDevice.getDevicePoseLinearVelocity ( )

Device pose linear velocity relative to tracking reference coordinate frame.

References getComponentAt().

Referenced by getDeviceFaceExpressionAt().

◆ getDevicePoseMatrix()

Matrix Dragengine.InputDevice.getDevicePoseMatrix ( )

Device pose matrix relative to tracking reference coordinate frame.

Referenced by getDeviceFaceExpressionAt().

◆ getDevicePoseOrientation()

Quaternion Dragengine.InputDevice.getDevicePoseOrientation ( )

Device pose orientation relative to tracking reference coordinate frame.

Referenced by getDeviceFaceExpressionAt().

◆ getDevicePosePosition()

Vector Dragengine.InputDevice.getDevicePosePosition ( )

Device pose position relative to tracking reference coordinate frame.

Referenced by getDeviceFaceExpressionAt().

◆ 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.

References getDisplayImage().

Referenced by getDisplayText().

◆ getDisplayIconCount()

int Dragengine.InputDevice.getDisplayIconCount ( )

Count of icons representing the device in bindings.

References getDisplaySkin().

Referenced by getLargestDisplayIconX().

◆ 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.

References getDisplayModel().

Referenced by getDisplayIconAt().

◆ getDisplayModel()

Model Dragengine.InputDevice.getDisplayModel ( )

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

References getName().

Referenced by getDisplayImage().

◆ getDisplaySkin()

Skin Dragengine.InputDevice.getDisplaySkin ( )

Skin for display model or null if not set.

References getType().

Referenced by getDisplayIconCount().

◆ getDisplayText()

String Dragengine.InputDevice.getDisplayText ( )

Text to display centered across display image or icon.

References getDisplayIconAt().

Referenced by getHandRig().

◆ getFeedbackAt()

InputDeviceFeedback Dragengine.InputDevice.getFeedbackAt ( int index)

Get wrapper for feedback.

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

Referenced by buttonMatchingKeyCode().

◆ getFeedbackCount()

int Dragengine.InputDevice.getFeedbackCount ( )

Number of feedbacks.

References getVRTrackerRole().

Referenced by buttonMatchingKeyChar().

◆ 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.

References getLargestDisplayIconY().

Referenced by getSupportsFaceMouthExpressions().

◆ getHandRig()

Rig Dragengine.InputDevice.getHandRig ( )

Hand rig if InputDeviceBoneConfiguration#hand is used.

Version
1.6

References getDisplayText().

Referenced by getUsingHandInteraction().

◆ 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.

References getID().

Referenced by getID().

◆ getIndex()

int Dragengine.InputDevice.getIndex ( )

Device index.

References getIndex().

Referenced by getIndex().

◆ 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.

References getDisplayIconCount().

Referenced by getBoneConfiguration().

◆ 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.

Referenced by getFingerTipOffset().

◆ 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.

Referenced by getDisplayModel().

◆ getSource()

InputEventSource Dragengine.InputDevice.getSource ( )

System owning the device.

Version
1.6

Device index is only valid for the matching system.

References getSource().

Referenced by getSource().

◆ getSupportsFaceEyeExpressions()

bool Dragengine.InputDevice.getSupportsFaceEyeExpressions ( )

Device supports face eye expressions.

Version
1.12

Referenced by getVRTrackerRole().

◆ getSupportsFaceMouthExpressions()

bool Dragengine.InputDevice.getSupportsFaceMouthExpressions ( )

Device supports face mouth expressions.

Version
1.12

References getFingerTipOffset().

Referenced by getVRTrackerRole().

◆ getType()

InputDeviceType Dragengine.InputDevice.getType ( )

Device type.

Referenced by getDisplaySkin().

◆ getUsingHandInteraction()

bool Dragengine.InputDevice.getUsingHandInteraction ( )

Device is using hand interaction.

Version
1.28

Used for devices of type InputDeviceType#vrRightHand or InputDeviceType#vrLeftHand. If true the device is representing hand interaction with no controller held in hand. Typically applications should use different aiming, pointing and input behavior.

References getHandRig().

Referenced by getAxisCount().

◆ getVRModel()

Model Dragengine.InputDevice.getVRModel ( )

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

Version
1.6

References getBodyRig().

Referenced by getButtonCount().

◆ getVRSkin()

Skin Dragengine.InputDevice.getVRSkin ( )

Skin for VR model or null if not set.

Version
1.6

Referenced by getButtonAt().

◆ getVRTrackerRole()

InputDeviceVRTrackerRole Dragengine.InputDevice.getVRTrackerRole ( )

VR tracker role.

Version
1.31

References getSupportsFaceEyeExpressions(), and getSupportsFaceMouthExpressions().

Referenced by getFeedbackCount().

◆ 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.

Referenced by getComponentCount().


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