Share via


GameBar.IsInputRedirectedChanged Event

Definition

Occurs when input is redirected to Game bar or input is restored to the game.

After the user invokes Game bar, input may be redirected to Game bar while the player interacts with it. Games that are no longer receiving input will typically want to pause gameplay or present an idle state. While paused or idle, a best practice is to continue rendering the current frame or scene, so that the recording is smooth and seamless if the player begins recording or is already recording. Multiplayer games might choose to continue gameplay rather than to pause.

Tip

This event can be raised on background (non-UI) threads. You may need to post an event to the UI thread to perform UI actions.

Use IsInputRedirected to determine whether input is currently redirected to Game bar.

// Register
static event_token IsInputRedirectedChanged(EventHandler<IInspectable> const& handler) const;

// Revoke with event_token
static void IsInputRedirectedChanged(event_token const* cookie) const;

// Revoke with event_revoker
static GameBar::IsInputRedirectedChanged_revoker IsInputRedirectedChanged(auto_revoke_t, EventHandler<IInspectable> const& handler) const;
public static event System.EventHandler<object> IsInputRedirectedChanged;
function onIsInputRedirectedChanged(eventArgs) { /* Your code */ }
Windows.Gaming.UI.GameBar.addEventListener("isinputredirectedchanged", onIsInputRedirectedChanged);
Windows.Gaming.UI.GameBar.removeEventListener("isinputredirectedchanged", onIsInputRedirectedChanged);
- or -
Windows.Gaming.UI.GameBar.onisinputredirectedchanged = onIsInputRedirectedChanged;
Public Shared Custom Event IsInputRedirectedChanged As EventHandler(Of Object) 

Event Type

Applies to

See also