Share via


GameInputDeviceInfo

Describes all the information about an input device.

Syntax

struct GameInputDeviceInfo
{
    uint16_t               vendorId;
    uint16_t               productId;
    uint16_t               revisionNumber;
    GameInputUsage         usage;
    GameInputVersion       hardwareVersion;
    GameInputVersion       firmwareVersion;
    APP_LOCAL_DEVICE_ID    deviceId;
    APP_LOCAL_DEVICE_ID    deviceRootId;
    GameInputDeviceFamily  deviceFamily;
    GameInputKind          supportedInput;
    GameInputRumbleMotors  supportedRumbleMotors;
    GameInputSystemButtons supportedSystemButtons;
    GUID                   containerId;
    const char*            displayName;
    const char*            pnpPath;

    const GameInputKeyboardInfo* keyboardInfo;
    const GameInputMouseInfo*    mouseInfo;
    const GameInputSensorsInfo*  sensorsInfo;

    const GameInputControllerInfo*  controllerInfo;
    const GameInputArcadeStickInfo* arcadeStickInfo;
    const GameInputFlightStickInfo* flightStickInfo;
    const GameInputGamepadInfo*     gamepadInfo;
    const GameInputRacingWheelInfo* racingWheelInfo;

    uint32_t                               forceFeedbackMotorCount;
    const GameInputForceFeedbackMotorInfo* forceFeedbackMotorInfo;

    uint32_t                            inputReportCount;
    const GameInputRawDeviceReportInfo* inputReportInfo;

    uint32_t                            outputReportCount;
    const GameInputRawDeviceReportInfo* outputReportInfo;
};

Members

vendorId
Type: uint16_t

Identifies the vendor of the input device.

productId
Type: uint16_t

Identifies the input device as a product.

revisionNumber
Type: uint16_t

Hardware revision number of the device, if any.

usage
Type: GameInputUsage

Two part index describing the input used.

hardwareVersion
Type: GameInputVersion

Hardware version of the device, if any.

firmwareVersion
Type: GameInputVersion

Firmware version of the device, if any.

deviceId
Type: APP_LOCAL_DEVICE_ID

Device ID of the input device.

deviceRootId
Type: APP_LOCAL_DEVICE_ID

Root ID of the input device.

deviceFamily
Type: GameInputDeviceFamily

Designates the family of input device the input device belongs to.

supportedInput
Type: GameInputKind

Describes the type or types of input the device supports.

supportedRumbleMotors
Type: GameInputRumbleMotors

Describes the accessible rumble motors on the device if there are any.

supportedSystemButtons
Type: GameInputSystemButtons

Describes the available buttons for controlling the system, often outside of a game.

containerId
Type: GUID

Container ID of the input device.

displayName
Type: const char*

Describes the friendly name for the device.

pnpPath
Type: const char*

Describes the plug and play for the device; this path can be used to reference the underlying devices through other APIs.

keyboardInfo
Type: GameInputKeyboardInfo const *

Information about a keyboard input device.

mouseInfo
Type: GameInputMouseInfo const *

Information about a mouse input device.

sensorsInfo
Type: GameInputSensorsInfo const *

Information about sensors on the device.

controllerInfo
Type: GameInputControllerInfo const *

Information about the generic controller input device. The controller represents the raw non-mapped axes, buttons, and switches in a device.

arcadeStickInfo
Type: GameInputArcadeStickInfo const *

Information about an arcade stick input device.

flightStickInfo
Type: GameInputFlightStickInfo const *

Information about a flight stick input device.

gamepadInfo
Type: GameInputGamepadInfo const *

Information about a gamepad input device.

racingWheelInfo
Type: GameInputRacingWheelInfo const *

Information about a racing wheel input device.

forceFeedbackMotorCount
Type: uint32_t

The number of force feedback motors on the input device.

forceFeedbackMotorInfo
Type: GameInputForceFeedbackMotorInfo const *

Information about all of the force feedback motors on a device.

inputReportCount
Type: uint32_t

Number of input reports for the device.

inputReportInfo
Type: GameInputRawDeviceReportInfo const *

Input report info object.

outputReportCount
Type: uint32_t

Number of output reports for the device.

outputReportInfo
Type: GameInputRawDeviceReportInfo const *

Output report.

Remarks

The deviceId is an application-local ID - a 256-bit hash value which uniquely identifies the device. This ID is always the same for a given device, even across runs of an application or reboots of the system, provided it is connected to the same USB port. Application-local ID hashes are, in part, generated with information specific to the calling application and system.

The deviceRootId is another application-local ID which identifies the root device node for composite devices. This allows applications to reason about the relationship of individual devices. For example, some gaming keyboards work around the legacy USB limit of 8 simultaneous keystrokes by exposing themselves as a composite device with multiple keyboard nodes. These are merged together into the "system" keyboard, so this is usually transparent to the user. But when processing per-keyboard input via the GameInput API, understanding this allows applications to avoid improper assumptions (e.g. that a keystroke will always come from a specific device) when mapping functions to keystrokes. The deviceId and deviceRootId are the same if the device is not one of many interfaces on a composite device.

The displayName string contains a "friendly" name for the device. This string is suitable for display in an application's UI, however there is no guarantee that it is localized. This is because the GameInput API searches several locations for this string, and one of the final fallbacks comes from the device's firmware.

The final fields in the GameInputDeviceInfo structure are pointers to variable-sized arrays of information about the device, such as information about force feedback and haptic feedback support. NULL pointers indicate that the corresponding feature is not available or supported by the device. The number of elements in each array is indicated by a corresponding field in the structure (as noted in the SAL annotations).

No one input device will have readable values for all attributes. Some input devices will only have values for relevant attributes. Returned by IGameInputDevice::GetDeviceInfo.

Input API Overview
GameInput
IGameInputDevice::GetDeviceInfo