入力サポート
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
このトピックでは、PC 版 Google Play Games でユーザー入力を処理する場合の設計上の考慮事項とおすすめの方法について説明します。
PC 版 Google Play Games では、プレーヤー入力にマウスとキーボードを使用し、タッチスクリーンは使用しません。マウスとキーボードのエクスペリエンスを設計する際は、デスクトップ パソコンまたはノートパソコンのユーザーに対して最適なユーザー エクスペリエンスを構築することに注力します。設計を開始するには、Chromebook での Android アプリの入力互換性に関するガイドをご覧ください。
プレーヤーのインタラクションの設計と構築は、以下の方法に沿って行うことをおすすめします。
- すべてのターゲットをマウスでクリックできるようにする。
- スクロールできるすべてのサーフェスをマウスホイール イベントでスクロールできるようにする。
- クリック可能なサーフェスにカーソルを合わせるとハイライトでそれが強調されるようにする。また、UI の設計を慎重に行い、識別しやすく、ユーザーを困惑させない UI を作成する。
- ユーザーがコントロールをすばやく表示できるよう、ホットキーを提供する。
- タッチベースのコントロール(親指での十字キー操作や画面上のボタンなど)をマウスベースのコントロールやホットキーに置き換える。
- モバイルゲームでマルチタッチ ジェスチャーを必要とする操作の場合は、キーボードやマウスのコントロールでも同じ操作が可能であることを確認する(たとえば、2 本指によるピンチ操作の代わりにマウスのスクロール ホイールを使用する)。
詳細とおすすめの方法については、ChromeOS Android アプリをマウスおよびキーボード用に最適化するをご覧ください。
国際化に関する考慮事項
海外のユーザーを対象としたゲームを設計する場合は、ゲームでサポートされている各言語にキーボード レイアウトを設定して、ゲームをテストすることが重要です。これを行わないと、ゲーム内チャットなどの機能が使用できなくなる可能性があります。入力ロケールはシステム設定で変更できます。変更は PC 版 Google Play Games に自動的に適用されます。モバイルでは、仮想キーボードからテキストを受け取っているため、エンジンの多くの問題が隠されている可能性があります。パソコンでよく発生する問題は次のとおりです。
- 「代替グラフィック」(AltGr)キーコードの処理が正しくない。多くのロケールでは、アクセントなどの発音区別符号や、地域通貨グリフなどのロケール固有の特殊記号を入力するために使用されます。
- 「入力方法拡張機能」(IME)入力の処理が正しく行われません。この方法は、ユーザーが複数のキーストロークを 1 つの文字に結合できるようにすることで、ラテン文字以外のアルファベットをサポートするために一般的に使用されます。
GameTextInput
と EditText
は、国際キーボード レイアウトと入力方法をすでに認識しています。
多くのゲームに共通する操作と、デベロッパーが PC 版 Google Play Games で使用する一般的な実装の一覧を次に示します。
- テキスト入力フィールドでメッセージの送信、またはテキストの送信を行うには、Enter キーを使用します。
- メニューとダイアログは、Esc キーでキャンセルできる必要があります。
- ストーリーの要素とダイアログ ボックスを進めるには、Enter キーを使用します。
- テキストを縦方向にスクロールするには、スクロール ホイールを使用します。
- ズームインまたはズームアウトするには、スクロール ホイールを使用します(特にモバイルビルドで 2 本指によるピンチ操作を使用する場合)。
- 通常はクリックとドラッグのモーションを使用する地図を操作するには、W、A、S、D を使用します。
これらの操作は一般的ですが、Input SDK を使用してプレーヤーに明示的に提示し、適切に見つけられるようにする必要があります。
互換性モード
PC 版 Google Play Games は、デフォルトでゲームを「入力互換モード」に設定します。つまり、マウスの左ボタンを押すと、ゲームでタッチイベントが発生します。詳しくは、マウス入力に関するガイドをご覧ください。
チュートリアルとユーザー向け情報
マウスとキーボードのコントロールを表示できるようにするだけでなく、ゲーム内チュートリアルでゲームの操作方法を学べるようにすると、ユーザーのメリットになることがあります。マウスとキーボードの正しい操作方法を示すゲーム内チュートリアルやトレーニング機能を含めることと、PC 版ゲームのタッチベースの操作に関連するチュートリアルを削除することをおすすめします。
このページのコンテンツやコードサンプルは、コンテンツ ライセンスに記載のライセンスに従います。Java および OpenJDK は Oracle および関連会社の商標または登録商標です。
最終更新日 2025-07-27 UTC。
[null,null,["最終更新日 2025-07-27 UTC。"],[],[],null,["# Input support\n\nThis topic covers design considerations and best practices for handling user\ninput in Google Play Games on PC.\n\nGoogle Play Games on PC relies on a mouse and keyboard for player input rather\nthan a touchscreen. When designing your mouse and keyboard experience, focus on\nbuilding the best user experience for desktop or laptop PC users. To get\nstarted, see our guide on\n[Android app input compatibility for Chromebooks](/topic/arc/input-compatibility).\n\nBest practices\n--------------\n\nWe recommend the following best practices for designing and building player\ninteractions.\n\n- All targets should be clickable with a mouse.\n- All scrollable surfaces scroll on mouse wheel events.\n- Highlight clickable surfaces when hovered, and use your best judgment to improve UI discovery without overwhelming the user.\n- Provide hotkeys for users to quickly bring up controls.\n- Replace touch-based controls (for example, thumb joysticks or on-screen buttons) with mouse-based controls and hotkeys.\n- 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).\n\nFor additional details and best practices, see our guide on\n[optimizing your ChromeOS Android app for mouse and keyboard](/topic/arc/optimizing#keyboard).\n\n### Internationalization considerations\n\nWhen designing a game for an international audience, it is important that you\ntest your game with your keyboard layout set to each language supported by your\ngame. Failure to do so may block players from using features such as in-game\nchat. You can change your input locale\n[in your system settings](https://support.microsoft.com/en-us/windows/manage-the-input-and-display-language-settings-in-windows-12a10cb4-8626-9b77-0ccb-5013e0c7c7a2)\nand the changes will apply automatically to Google Play Games on PC. On\nmobile, many issues in your engine may be hidden by the fact that you're\nreceiving text from a virtual keyboard. Common issues on PC include:\n\n- Incorrect handling of \"alternative graphic\" (AltGr) keycodes. In many locales this is used to type diacritical marks such as accents or special locale-specific symbols such as regional currency glyphs.\n- Incorrect handling of [\"input method extension\" (IME)](/reference/android/view/inputmethod/InputMethodManager) inputs. This method is commonly used to support non-Latin alphabets by allowing users to combine several keystrokes into a single character.\n\n[`GameTextInput`](/games/agdk/add-support-for-text-input) and\n[`EditText`](/reference/android/widget/EditText) are already aware of\ninternational keyboard layouts and input methods.\n\n### Recommended input mappings\n\nThe following list includes actions many games have in common, and the typical\nimplementation developers use on Google Play Games on PC:\n\n- Use the enter key to send messages or submit text in text entry fields.\n- Menus and dialogs should be cancellable with the escape key.\n- Use the enter key to progress through story elements and dialog boxes.\n- Use the scroll wheel to scroll text vertically.\n- Use the scroll wheel to zoom in or out, especially if you use a two-finger pinch in your mobile build.\n- Use W, A, S, and D navigate around a map that you'd normally use a click and drag motion on.\n\nEven though these actions are common, you should still explicitly present them\nto the player with the [Input SDK](/games/playgames/input-sdk) to make sure they're\nproperly discoverable.\n\nCompatibility mode\n------------------\n\nGoogle Play Games on PC places your game into \"input compatibility mode\" by\ndefault. This means that when you press the left mouse button, your game is\ngiven a touch event. See the [mouse input](/games/playgames/input-mouse) guide for more\ninformation.\n\nTutorials and user education\n----------------------------\n\nIn some cases, users can benefit from in-game tutorials that teach them the\ncontrols to the game, in addition to being able to view the mouse and keyboard\ncontrols. We recommend including in-game tutorials and educational features with\nthe correct controls for mouse and keyboard, and removing tutorials relevant to\ntouch-based controls for the PC version of your game."]]