Represents an input device generically, with specifics being fleshed out in subclasses.
|0||A non-spatial input, used for power buttons and system volume and such|
|1||Contains a pose and datamap for buttons, trackpad, joystick, grip, trigger, etc.|
|2||Defined by origin, direction, and tilt with datamap for buttons, trackpad, etc.|
|3||Contains a full 27-bone hand skeleton (including forearm) and datamap for abstractions like grip, pinch distance/point, etc.|
Returns the distance from this input to a field in meters.
field is the name of the field, not the full path.
Returns a serialized version of the InputMethod, each serialized schema is shown under #Serialization in the respective Input subclasses.
The datamap is a dictionary containing abstracted and raw data related to the input that clients can use to analyze input in the most optimal way. It has keys of type
Key(Flexbuffers-specific, in any other language use a
String) and values:
|Type||Example Uses||Usage Notes|
|Digital buttons||If values are analog, use a |
|Analog trigger, grip||For values such as grip/trigger, make the range |
|Touchpad, joystick||For values such as trackpad and joystick, make each component in the range of |
|Pinch position, grip axis vector||For points and directions, make this a value inside the InputMethod's local space. Raw hand pose data should not be put in the datamap.|
|Input device type/name||Device name such as |
Standard supported datamap keys will be put in the individual type's documentation, however you can put more data in and some input handlers may be able to use that data for better interactions.
Merges the datamap of this InputMethod with
data. Each key here will add to the datamap if not present and set the existing value if present. Any key not present in
data will be unaffected.