robot_2Generated
code_blocksInput

Description

The TrackedDeviceRole.Gamepad field is a member of the TrackedDeviceRole enumeration within the Sandbox.VR namespace. It represents a gamepad device role in a virtual reality environment. This role is used to identify and manage input from gamepad devices within the VR system.

Usage

Use the TrackedDeviceRole.Gamepad field to specify or check if a tracked device is functioning as a gamepad. This can be useful when handling input events or configuring device-specific settings in a VR application.

Example

// Example of using TrackedDeviceRole.Gamepad

// Check if a device is a gamepad
if (device.Role == TrackedDeviceRole.Gamepad)
{
    // Handle gamepad-specific logic
    HandleGamepadInput(device);
}

// Assign a role to a device
VRDevice device = GetDevice();
device.Role = TrackedDeviceRole.Gamepad;