Skip to main content
Retrieves the number of contacts on a touch surface in an input reading.

Syntax

Parameters

surfaceIndex   _In_
Type: uint32_t
Index of the touch surface. Must be less than the value returned by IGameInputDevice::GetTouchSurfaceCount.

Return value

Type: uint32_t The number of contacts on the touch surface in this reading. Returns 0 if the reading doesn’t contain touch data or if surfaceIndex isn’t a valid surface index.

Remarks

Use this method to size the array that’s passed to IGameInputReading::GetTouchSurfaceState. Calling GetTouchSurfaceState with a null contact array also returns the number of contacts. To allocate an array that’s large enough for any reading, use the maxContactCount member of GameInputTouchSurfaceInfo. Readings that contain touch data include GameInputKindTouch in IGameInputReading::GetInputKind.
Touch support depends on the device and the platform.

Requirements

Header: GameInput.h Library: gameinput.lib Supported platforms: Windows, XBOX One family consoles and XBOX Series consoles

See also

Overview of GameInput
IGameInputReading
IGameInputReading::GetTouchSurfaceState
IGameInputDevice::GetTouchSurfaceInfo
GameInputTouchContact

Version History

Last modified on November 5, 2026