For player input, Google Play Games on PC relies on a mouse and keyboard rather than a touchscreen. This places your game into "input compatibility mode" by default. This means that when you press the left mouse button, your game is given a touch event. When designing your mouse and keyboard experience, focus on building the best user experience for desktop or laptop users.
To get started, go to Android app input compatibility for Chromebooks.
Best practices
We recommend these best practices for designing and building player interactions:
- All targets should be clickable with a mouse.
- All scrollable surfaces scroll on mouse wheel events.
- Highlight clickable surfaces when hovered, and use your best judgment to improve UI discovery without overwhelming the user.
- Provide hotkeys for users to quickly bring up controls.
- Replace touch-based controls, for example, thumb joysticks or on-screen buttons with mouse-based controls and hotkeys.
- For actions in your mobile game that require multi-touch gestures, ensure the same actions are supported with a keyboard or mouse control. For example, using the scroll wheel of the mouse to replace a two-finger pinch.
For additional details and best practices, check our guide on how to optimize apps on ChromeOS.
Tutorials & user education
In some cases, users can benefit from in-game tutorials that teach them the controls to the game, in addition to being able to view the mouse and keyboard controls. We recommend to:
- Include in-game tutorials and educational features with the correct controls for mouse and keyboard.
- Remove tutorials relevant to touch-based controls for the PC version of your game.
Game controllers
You can enhance the user experience in your game by letting players use game controllers. The Android framework provides APIs to detect and process user input from game controllers.
For many gamers, game controllers are the preferred way to play games because it provides more precise control over character movements and attacks. To add this feature for your Google Play Games title, check out this guide on how to add Controller support for your game.
When players physically connect or wirelessly pair a game controller to their Android-powered devices, the system auto-detects the controller as an input device. If you support game controllers in your game, it's your responsibility to make sure that your game responds to controllers consistently across devices that run on different versions of Android. This lets your game reach a wider audience. Your players can enjoy a seamless gameplay experience with their controllers even when they switch or upgrade their Android devices.
While most games are designed to support a single user per Android device, it's also possible to support multiple users with game controllers that are connected simultaneously on the same Android device.
Input SDK
The Input SDK provides a unified interface that allows players to view and change the mouse and keyboard bindings for any game they wish to play on Google Play Games on PC. At any point during gameplay, a player can open the Google Play Games on PC overlay as seen in this screenshot:
This SDK is required for games that use keyboards on Google Play Games on PC because Android mobile games are designed around a touchscreen for player input.
The Input SDK is an important element to keep the players engaged with the game on different platforms. The experience afforded by a mouse and keyboard is different from touchscreens. When you integrate your game with the Input SDK, you’ll enable players to remap the default controls in Google Play Games on PC.
For a more immersive experience, you can take more advantage of the remapping feature offered by Google Play Games on PC by setting different scheme controls for your menus, main game and minigames, or by updating your UI to match your user's custom control maps. You can disable or enable remapping for individual keys or groups of keys, or decide what keys are allowed to be remapped in your game.
To help build the best PC experience possible for your games, go to Input SDK’s best practices and restrictions of remapping.
Keyboard remapping
A feature that’s now integrated into the new version of Input SDK is called Keyboard remapping. With this feature, you can now choose to allow Google Play Games on PC to handle keyboard remapping with minimal work.
With the use of Input SDK, Google Play Games on PC can support keyboard control remapping based on the key bindings your game provides. This is optional and can be entirely disabled. For example, you may wish to provide your own keyboard remapping interface.
For each user, Google Play Games on PC stores remapped controls locally. This enables control persistence across gaming sessions. This information is stored on disk only for the PC platform and doesn’t impact the mobile experience. Control data is deleted after the user uninstalls or re-installs Google Play Games on PC. This data isn't persistent across multiple PC devices.