IGameInput::GetCurrentReading
Retrieves the most recent reading from the input stream that matches a caller-supplied filter.Syntax
Parameters
inputKind _In_Type: GameInputKind One of the enumeration values that designates the type of input device being used such as a controller, keyboard, mouse, or gamepad. Enumeration values can be combined to designate multiple types of input. When multiple input kinds are specified, any readings that contain at least one of the input kinds will be matched and returned. device _In_opt_
Type: IGameInputDevice* An optional filter that returns readings from a specific device. reading _COM_Outptr_
Type: IGameInputReading** The input reading to be returned. Returns
NULL on failure.
Return value
Type: HRESULT Function result.Remarks
This function is used to initially access the input stream. You may use this function with theGetNextReading and GetPreviousReading methods to walk the input stream without missing inputs. Alternatively, you may continue to call GetCurrentReading to keep getting the most current reading if your game can permit some missing input.
The following code example demonstrates how to poll for the current gamepad state.
Requirements
Input API OverviewIGameInput_GetNextReading
IGameInput_GetPreviousReading
IGameInput
