Compartilhar via


GameInputReadingCallback

Title defined callback for the new reading arrived event.

Syntax

void GameInputReadingCallback(  
         GameInputCallbackToken callbackToken,  
         void* context,  
         IGameInputReading* reading,  
         bool hasOverrunOccurred  
)  

Parameters

callbackToken   _In_
Type: GameInputCallbackToken

The callback token identifying the callback.
Token returned by IGameInput::RegisterReadingCallback.

context   _In_
Type: void*

Title defined context.

reading   _In_
Type: IGameInputReading*

The new reading.

hasOverrunOccurred   _In_
Type: bool

Boolean indicating whether an overrun has occurred. An overrun occurrence means the callback dispensing thread has not run for .5 seconds, which has caused reading callback to be skipped or lost as a result.

Return value

Type: void

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 reading callback registered with IGameInput::RegisterReadingCallback. It will define the function that is called whenever a desired reading is received from an input device.

An overrun is unlikely to occur when GameInput is using the default dispatcher thread. However if an app takes manual control of dispatching, using the IGameInput:CreateDispatcher function, and then fails to pump the queue for an extended period of time an overrun can occur.

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::RegisterReadingCallback