Unity/UniRx/モバイルキーボード取得
提供: 初心者エンジニアの簡易メモ
android端末にbluetoothキーボードで入力。
private IObservable<TouchScreenKeyboard> touchScreenKeyboardOnDoneAsObservable; void Start() { touchScreenKeyboardOnDoneAsObservable = Observable.EveryUpdate() .Select(_ => TouchScreenKeyboard.Open("", TouchScreenKeyboardType.NamePhonePad, false, false, false)) .Where(_ => _ != null) .Where(_ => TouchScreenKeyboard.isSupported); // .Where(_ => _.status == TouchScreenKeyboard.Status.Done); .AddTo(gameObject); touchScreenKeyboardOnDoneAsObservable .Subscribe(touchScreenKeyboard => GameObject.Find("DebugText").GetComponent<Text>().text = touchScreenKeyboard.text // Debug.Log(touchScreenKeyboard.text) ) .AddTo(gameObject);