Partager via


GameInputDeviceCallback

Title defined call back for device connected and disconnected events. This function is registered with IGameInput::RegisterDeviceCallback. This function is triggered by the conditions set from the registration function.

Syntax

void GameInputDeviceCallback(  
         GameInputCallbackToken callbackToken,  
         void* context,  
         IGameInputDevice* device,  
         uint64_t timestamp,  
         GameInputDeviceStatus currentStatus,  
         GameInputDeviceStatus previousStatus  
)  

Parameters

callbackToken   _In_
Type: GameInputCallbackToken

Callback token for the registered function. Token returned by IGameInput::RegisterDeviceCallback.

context   _In_
Type: void*

The context passed to IGameInput::RegisterDeviceCallback.

device   _In_
Type: IGameInputDevice*

Device which triggered the callback.

timestamp   _In_
Type: uint64_t

Microsecond timestamp denoting when the status change occurred.

currentStatus   _In_
Type: GameInputDeviceStatus

Current connection and input status of the device.

previousStatus   _In_
Type: GameInputDeviceStatus

Previous connection and input status of the device.

Return value

Type: void

No return type.

Remarks

This function's definition is determined by the developer, but the parameters of that function must match in order for the callback to occur. This function is used to define the GameInput device callback registered with IGameInput::RegisterDeviceCallback. It will define the function that is called whenever a desired device state change is detected.

Requirements

Header: GameInput.h

Library: xgameruntime.lib

Supported platforms: Windows, Xbox One family consoles and Xbox Series consoles

See also

Input API Overview
GameInput
IGameInput::RegisterDeviceCallback