Partager via


IGameInput::SetFocusPolicy

Sets the focus policy for a game's input devices.

Syntax

void SetFocusPolicy(  
         GameInputFocusPolicy policy  
)  

Parameters

policy   _In_
Type: GameInputFocusPolicy

The focus policy to be set.

Return value

Type: void

No return.

Remarks

The IGameInput::SetFocusPolicy method sets the focus policy for a game's input devices. The focus policy determines whether the input devices provide input based on the focus of the game. Focus refers to whether the game is selected as the main focus or if it is currently running in the background while another application has focus. For intermediate and advanced use-cases of the GameInput API, see Advanced GameInput topics.

Focus policy only applies on Windows.

Requirements

Header: GameInput.h

Library: gameinput.lib

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

See also

Overview of GameInput
GameInputFocusPolicy
IGameInput