タッチスクリーンを使用する Android アプリケーションとは異なり、ChromeOS デバイスの多くはラップトップ (あるいはラップトップモードのあるデバイス) です。そのため、ChromeOS 用のアプリケーションをビルドする場合は、マウス、タッチパッド、キーボードからの入力を処理する必要があります。Player 設定 の ChromeOS Input Emulation (メニュー: File > Build Settings > Player Settings > Other Settings) で、アプリケーションが ChromeOS デバイスでユーザー入力を処理する方法を指定できます。
タッチスクリーン入力をエミュレートするために、ChromeOS はマウスやタッチパッドの左クリック入力を画面タップに自動変換します。結果として、電話やタブレット用に開発された Android アプリケーションがデフォルトで ChromeOS デバイスで動作するようになります。
重要: サポートされているのは左クリックとキーボード入力のみです。それ以外の入力は無視されます。
デフォルトではこの動作は Player 設定 ChromeOS Input Emulation で有効にできます。
マウスとタッチパッドの入力をサポートするには、ChromeOS Input Emulation の設定を無効にしてください。このオプションを無効にすると、アプリケーションは、以下のマウスおよびタッチパッド入力を変換せずに受信します。
この設定を無効にする場合は、マウスとタッチパッドの入力を処理するための Unity 入力コードの記述も必要になります。この入力コードには、カーソル位置の読み取り方法、マウスとタッチパッドのクリックの処理方法、スクロールイベントの読み取り方法に関する情報を含める必要があります。入力コードの記述に関する情報は、API スクリプトリファレンスの Input を参照してください。
ノート: Android と ChromeOS はカスタムカーソルをサポートしています。カーソルをカスタマイズするには Cursor.SetCustomCursor を参照してください。
Android では、入力フィールドやテキストフィールドが選択されると必ずスクリーンキーボード (仮想キーボード) が表示され、ユーザーはこれを使用してテキストを入力できます。ChromeOS では、ハードウェアキーボードが使用可能な状態になっている場合にはスクリーンキーボードは不要であり表示もされません。ハードウェアキーボードがない場合には、スクリーンキーボードが表示されます。この動作は、Player 設定 ChromeOS Input Emulation の影響を受けません。
ノート: Android アプリケーションがユーザーに TouchScreenKeyboard を開くように促すプロンプトを出す場合は、ChromeOS 上でも同様に動作します。
Unity は、ホバー機能をサポートするために正確なマウス位置を必要とします。ChromeOS Input Emulation モードでは正確なマウス情報が利用できません。このため、アプリケーションでホバー機能をサポートするには ChromeOS Input Emulation の設定を無効にする必要があります。
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.