Docked behavior of a handheld
Some handhelds are played when docked. While there isn’t an API to check if the handheld is docked, a docked device might have an external display attached. You can check for an external display by using the EnumDisplayDevices and EnumDisplaySettings APIs. When a handheld device is docked, use these methods to check for attached external displays:- Check for additional gamepads. The handheld’s built-in gamepad is always available, but the user might also connect additional gamepads.
- Check the screen sizes of attached displays.
- Virtual keyboard recommendations remain because the gamepad is still the primary input mechanism.
- Some players might connect a mouse and keyboard, just like they do on consoles.
Guaranteed input
While various gaming handhelds might have additional input options, handheld devices have the following inputs.- A, B, X, and Y buttons
- Left bumper and right bumper
- Left trigger and right trigger
- Left thumbstick and right thumbstick
- D-pad
- Menu button
- View button
Power
To check if the handheld device uses AC power instead of the battery, call the GetSystemPowerStatus function. It shows whether the device uses AC power and provides a summary of the battery charge state (high, low, critical, or charging). Consider how your game affects the device’s battery life, because the power your game requires isn’t always obvious. Possible power savings recommendations in the XBOX Sustainability Toolkit can also apply to handhelds. Maximize power savings by:- Enabling VSync to give the GPU more idle time and reduce power use.
- Lowering the internal rendering resolution and applying an upscale pass.
- Reducing the frame rate to save power. Note: A lower frame rate can affect gameplay.
- Stopping world rendering when full-screen menus or UI elements appear, or when the game is paused.
- Pausing the game when input idle is detected and the player is inactive.
Screen dimensions
While different gaming handhelds have varying screen resolutions, you can rely on the following standards:- The diagonal screen size is at least 7 inches (17.8 cm).
- The screen has an aspect ratio of either 16:9 or 16:10.
Handheld experience best practices samples
For more insights about building and optimizing your game for handheld devices, Microsoft released two samples: a native C++ sample and a Unity managed C# sample. Both provide a similar set of best practices for how to use APIs to manage your game’s handheld experience.- Determine if a device is a handheld.
- Determine if a device is running on battery power, charging, or using external power.
- Look up device-specific properties, including integrated display properties.
- Handle DPI changes and scale UI accordingly.
- Use virtual keyboards for text entry.
- Look up network devices and types.
- Determine network and Bluetooth® connectivity.
- Handle input from the gamepad, keyboard, and mouse.
- Determine the input modality. For example, identifying the most recently used input device.
- Native C++ Sample: C++ Sample on GitHub.
- Unity Managed C# Sample: Unity Managed C# Sample on GitHub.
