IUxrControllerInput Interface
Controller interface for all XR input devices, supporting single controller and dual controller setups.
Namespace: UltimateXR.Devices
Assembly: UltimateXR (in UltimateXR.dll) Version: 0.0.0.0
Syntax
C#
public interface IUxrControllerInput : IUxrDevice
The IUxrControllerInput type exposes the following members.
Properties
Name | Description | |
---|---|---|
Handedness |
Gets or sets the handedness, which is the Primary -dominant- hand in Dual controller setups. In Single controller setups where the controller is grabbed with one hand, it determines which hand is being used. If IsHandednessSupported false, such as in gamepads, the handedness value should be ignored. | |
IsHandednessSupported |
Gets whether Handedness can be used. In Single devices, it may be used to control which hand is holding the controller. In Dual devices it is used to determine which hands have the Primary (dominant) and Secondary (non-dominant) roles. Devices such as gamepads don’t support handedness and will target the single device no matter which UxrHandSide is used. In this case it is good practice to use Primary to target the device in order to make the code cleaner. | |
JoystickDeadZone | Gets the controller’s joystick dead zone [0.0, 1.0]. Some controllers may have a more sensitive joystick, and this property can be used to compensate in different implementations. | |
LeftController3DModel | Gets the left instanced 3D controller model, if available. In Single configurations where IsHandednessSupported is false, both sides will return the same model. | |
LeftControllerName | Gets the left controller name, or empty if not connected / doesn’t exist. In Single configurations where IsHandednessSupported is not available, both sides will return the same name. | |
MainJoystickIsTouchpad | Gets a value indicating whether the main two-axis input element is a touchpad. If false, it usually means the main joystick is a thumbstick. | |
Primary |
Gets which hand is holding the controller in Single setups where IsHandednessSupported is available. In Dual setups it identifies the dominant hand. In both cases, Handedness determines which hand it is. In Single devices where handedness is not applicable ( IsHandednessSupported is false) it is good practice to use Primary to address the device, even if both left and right can too. | |
RightController3DModel | Gets the right instanced 3D controller model, if available. In Single configurations where IsHandednessSupported is false, both sides will return the same model. | |
RightControllerName | Gets the right controller name, or empty if not connected / doesn’t exist. In Single configurations where IsHandednessSupported is not available, both sides will return the same name. | |
Secondary | Gets which hand is not holding the controller in Single setups where IsHandednessSupported is available. In Dual setups it identifies the non-dominant hand. | |
SetupType | Gets the setup type. See UxrControllerSetupType. |
Methods
Name | Description | |
---|---|---|
AreAllControllerElementsBlinking | Checks if all elements of a specific controller element are currently blinking | |
GetButtonPressFlags | Gets an uint value representing press states for each the controller UxrInputButtons flags in the current frame. | |
GetButtonPressFlagsLastFrame | Gets an uint value representing press states for each the in the last frame. | |
GetButtonsEvent | Checks if a given input event took place for a button or all buttons in a set in the current frame. | |
GetButtonsEventAny | Checks if a given input event took place for a button or any button in a set in the current frame. | |
GetButtonsPress | Checks if the given button or buttons are being pressed in the current frame. | |
GetButtonsPressAny | Checks if the given button or any button in a set is being pressed in the current frame. | |
GetButtonsPressDown | Checks if the given button or buttons are being pressed in the current frame but weren’t the previous frame (press-down). | |
GetButtonsPressDownAny | Checks if the given button or any button in a set is being pressed in the current frame but wasn’t the previous frame (press-down). | |
GetButtonsPressUp | Checks if the given button or buttons aren’t being pressed in the current frame but were during the previous frame (release press). | |
GetButtonsPressUpAny | Checks if the given button or any button in a set isn’t being pressed in the current frame but was during the previous frame (release press). | |
GetButtonsTouch | Checks if the given button or all buttons in a set are being touched in the current frame. | |
GetButtonsTouchAny | Checks if the given button or any button in a set is being touched in the current frame. | |
GetButtonsTouchDown | Checks if the given button or buttons are being touched in the current frame but weren’t the previous frame (touch-down). | |
GetButtonsTouchDownAny | Checks if the given button or any button in a set is being touched in the current frame but not in the previous frame (touch-down). | |
GetButtonsTouchUp | Checks if the given button or buttons aren’t being touched in the current frame but were during the previous frame (release touch). | |
GetButtonsTouchUpAny | Checks if the given button or any button in a set isn’t being touched in the current frame but was during the previous frame (release touch). | |
GetButtonTouchFlags | Gets an uint value representing touch states for each the controller UxrInputButtons flags in the current frame. | |
GetButtonTouchFlagsLastFrame | Gets an uint value representing touch states for each the controller UxrInputButtons flags in the last frame. | |
GetController3DModel | Gets the instanced controller 3D model for a given hand. | |
GetControllerCapabilities | Gets the capabilities of the XR controller. | |
GetControllerElementsGameObjects | Returns a list of GameObjects that represent parts of the instantiated controller. This can be useful to highlight buttons or other elements during tutorials. Functionality to make these elements blink is also provided by the framework. | |
GetInput1D | Gets the state of an analog controller input element. | |
GetInput2D | Gets the state of a 2D input element (joystick, touchpad…). | |
HasControllerElements | Checks if the given controller has specific elements. | |
IsAnyControllerElementBlinking | Checks if any specific controller element is currently blinking | |
IsControllerEnabled | Checks whether the given controller is enabled. | |
SendGrabbableHapticFeedback(UxrGrabbableObject, UxrHapticClip) | Sends haptic feedback to XR controllers that are being used to manipulate a grabbable object. Each hand associated to an XR controller that is grabbing the object will receive haptic feedback. | |
SendGrabbableHapticFeedback(UxrGrabbableObject, UxrHapticClipType, Single, Single, UxrHapticMode) | Sends haptic feedback to XR controllers that are being used to manipulate a grabbable object. Each hand associated to an XR controller that is grabbing the object will receive haptic feedback. | |
SendHapticFeedback(UxrHandSide, UxrHapticClip) | Sends haptic feedback to a controller if the controller supports it. | |
SendHapticFeedback(UxrHandSide, Single, Single, Single, UxrHapticMode) | Sends haptic feedback to a controller if the controller supports it. | |
SendHapticFeedback(UxrHandSide, UxrHapticClipType, Single, Single, UxrHapticMode) | Sends a predefined haptic clip to a controller. | |
StartControllerElementsBlinking | Starts blinking one or more elements in a controller. This can be useful during tutorials to highlight which button(s) to press. | |
StopAllBlinking | Stops all controller elements to blink | |
StopControllerElementsBlinking | Stops controller elements to blink | |
StopHapticFeedback | Stops all current haptics in a given controller. |
Events
Name | Description | |
---|---|---|
ButtonStateChanged | Event called after a controller button state changed. | |
HapticRequesting | Event called right before haptic feedback was requested. | |
Input1DChanged | Event called after a UxrInput1D element changed. | |
Input2DChanged | Event called after a UxrInput2D element changed. | |
Updated | Event called right after the controller input state has been updated. | |
Updating | Event called right before the controller input state is updated. |