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

NameDescription
Public propertyHandedness

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.

Public propertyIsHandednessSupported

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.

Public propertyJoystickDeadZone 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.
Public propertyLeftController3DModel Gets the left instanced 3D controller model, if available. In Single configurations where IsHandednessSupported is false, both sides will return the same model.
Public propertyLeftControllerName 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.
Public propertyMainJoystickIsTouchpad 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.
Public propertyPrimary

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.

Public propertyRightController3DModel Gets the right instanced 3D controller model, if available. In Single configurations where IsHandednessSupported is false, both sides will return the same model.
Public propertyRightControllerName 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.
Public propertySecondary Gets which hand is not holding the controller in Single setups where IsHandednessSupported is available. In Dual setups it identifies the non-dominant hand.
Public propertySetupType Gets the setup type. See UxrControllerSetupType.

Methods

NameDescription
Public methodAreAllControllerElementsBlinking Checks if all elements of a specific controller element are currently blinking
Public methodGetButtonPressFlags Gets an uint value representing press states for each the controller UxrInputButtons flags in the current frame.
Public methodGetButtonPressFlagsLastFrame Gets an uint value representing press states for each the in the last frame.
Public methodGetButtonsEvent Checks if a given input event took place for a button or all buttons in a set in the current frame.
Public methodGetButtonsEventAny Checks if a given input event took place for a button or any button in a set in the current frame.
Public methodGetButtonsPress Checks if the given button or buttons are being pressed in the current frame.
Public methodGetButtonsPressAny Checks if the given button or any button in a set is being pressed in the current frame.
Public methodGetButtonsPressDown Checks if the given button or buttons are being pressed in the current frame but weren’t the previous frame (press-down).
Public methodGetButtonsPressDownAny 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).
Public methodGetButtonsPressUp Checks if the given button or buttons aren’t being pressed in the current frame but were during the previous frame (release press).
Public methodGetButtonsPressUpAny 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).
Public methodGetButtonsTouch Checks if the given button or all buttons in a set are being touched in the current frame.
Public methodGetButtonsTouchAny Checks if the given button or any button in a set is being touched in the current frame.
Public methodGetButtonsTouchDown Checks if the given button or buttons are being touched in the current frame but weren’t the previous frame (touch-down).
Public methodGetButtonsTouchDownAny 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).
Public methodGetButtonsTouchUp Checks if the given button or buttons aren’t being touched in the current frame but were during the previous frame (release touch).
Public methodGetButtonsTouchUpAny 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).
Public methodGetButtonTouchFlags Gets an uint value representing touch states for each the controller UxrInputButtons flags in the current frame.
Public methodGetButtonTouchFlagsLastFrame Gets an uint value representing touch states for each the controller UxrInputButtons flags in the last frame.
Public methodGetController3DModel Gets the instanced controller 3D model for a given hand.
Public methodGetControllerCapabilities Gets the capabilities of the XR controller.
Public methodGetControllerElementsGameObjects 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.
Public methodGetInput1D Gets the state of an analog controller input element.
Public methodGetInput2D Gets the state of a 2D input element (joystick, touchpad…).
Public methodHasControllerElements Checks if the given controller has specific elements.
Public methodIsAnyControllerElementBlinking Checks if any specific controller element is currently blinking
Public methodIsControllerEnabled Checks whether the given controller is enabled.
Public methodSendGrabbableHapticFeedback(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.
Public methodSendGrabbableHapticFeedback(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.
Public methodSendHapticFeedback(UxrHandSide, UxrHapticClip) Sends haptic feedback to a controller if the controller supports it.
Public methodSendHapticFeedback(UxrHandSide, Single, Single, Single, UxrHapticMode) Sends haptic feedback to a controller if the controller supports it.
Public methodSendHapticFeedback(UxrHandSide, UxrHapticClipType, Single, Single, UxrHapticMode) Sends a predefined haptic clip to a controller.
Public methodStartControllerElementsBlinking Starts blinking one or more elements in a controller. This can be useful during tutorials to highlight which button(s) to press.
Public methodStopAllBlinking Stops all controller elements to blink
Public methodStopControllerElementsBlinking Stops controller elements to blink
Public methodStopHapticFeedback Stops all current haptics in a given controller.

Events

NameDescription
Public eventButtonStateChanged Event called after a controller button state changed.
Public eventHapticRequesting Event called right before haptic feedback was requested.
Public eventInput1DChanged Event called after a UxrInput1D element changed.
Public eventInput2DChanged Event called after a UxrInput2D element changed.
Public eventUpdated Event called right after the controller input state has been updated.
Public eventUpdating Event called right before the controller input state is updated.

See Also

Reference

UltimateXR.Devices Namespace