Dealing with Controller Loss
Dealing with Controller Loss
Having a controller associated to a user is critical for most games. When the
game loses all such controllers for a user (e.g., the battery is dead) the
standard approach for a single player game is to pause it and show a dialog
asking the user to please turn on a controller.
Using the XUserFindControllerForUserWithUiAsync
function, games can improve on this experience. This functions takes an XUserHandle
as input and will show a dialog:
<<Gamer>>, you need a controller for this game.
Press and hold A to confirm the controller you would like to use
Once the user confirms their controller, the game can call
XUserFindControllerForUserWithUiResult
to get the APP_LOCAL_DEVICE_ID of the chosen controller. More importantly, that
controller is now associated to that user. If that user then hits the nexus button,
the XBOX Guide will show that user’s information in the Guide.
Note that the player can cancel out of this dialog without selecting a controller, and the title should handle this cancellation appropriately. For example, a title could repeatedly call XUserFindControllerForUserWithUiAsync to force a selection, or it could return to the title screen since there is no longer a user/controller mapping, or some other behavior which makes sense for the title.
Also note that, with this process, users can get associated to controllers that were previously associated to other users in the game. This is by design.
Anytime the association between a user and controller changes, there will be a
XUserDeviceAssociationChangedCallback.
As a note, this event will also fire with the successful pairing of user to controller
that came from calling
XUserFindControllerForUserWithUiAsync.
Last modified on August 20, 2026
Related topics
XUserFindControllerForUserWithUiAsyncXUserFindControllerForUserWithUiResultUsersUser identity and XUser APIs in the GDKBest practices for handling offline play