Click-through your widget

Game Bar supports the ability for users to enable click-through on pinned widgets. Click-through ensure that all mouse activity will go through a pinned widget and straight to the underlying game or application. For some scenarios this is preferable; as an example real-time strategy games often require the user to interact with all parts of the game, and thus having a pinned widget intercept a click is detrimental to the game experience. In other scenarios such as an FPS style game, the cursor is generally in the middle of the screen, and the games view changes with mouse movement.

Adding support for click-through

All widgets support click through by default if they have enabled the PinningSupported property in their widgets definition.

Considerations for click-through

Depending on your widget functionality you may want to consider changes to your widgets UI when in a pinned and click-through enabled state. Some widgets may have controls that would be misleading to a user when in this state as a user would not be able to set focus, nor interact with those controls; to them it may appear that this widget is broken.

Example Scenario

A chat widget typically has an input box, this input box would be misleading to the user when in the click-through state, as a user would not be able to set focus, nor interact with it to chat with others.

A possible solution is be to disable or hide the input box when the widget shifts into a pinned and click-through enabled mode. This can be determined by looking at the following XboxGameBarWidget properties:

  • XboxGameBarWidget:GameBarDisplayMode should be GameBarDisplayMode:PinnedOnly
  • XboxGameBarWidget:Pinned should be true
  • XboxGameBarWidget:ClickThroughEnabled should be true

By listening to XboxGameBarWidget:GameBarDisplayModeChanged events the widget can evaluate these condition and determine whether the input box should be hidden or not.