「Unity/UniRx/モバイルキーボード取得」の版間の差分
提供: 初心者エンジニアの簡易メモ
(→参考) |
|||
行10: | 行10: | ||
.Select(_ => TouchScreenKeyboard.Open("", TouchScreenKeyboardType.NamePhonePad, false, false, false)) | .Select(_ => TouchScreenKeyboard.Open("", TouchScreenKeyboardType.NamePhonePad, false, false, false)) | ||
.Where(_ => _ != null) | .Where(_ => _ != null) | ||
− | .Where(_ => TouchScreenKeyboard.isSupported) | + | .Where(_ => TouchScreenKeyboard.isSupported); |
− | .Where(_ => _.status == TouchScreenKeyboard.Status.Done); | + | // .Where(_ => _.status == TouchScreenKeyboard.Status.Done); |
touchScreenKeyboardOnDoneAsObservable | touchScreenKeyboardOnDoneAsObservable |
2022年1月3日 (月) 08:21時点における版
(未完成:DebugTextに表示されず・・。失敗)
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); touchScreenKeyboardOnDoneAsObservable .Subscribe(touchScreenKeyboard => GameObject.Find("DebugText").GetComponent<Text>().text = touchScreenKeyboard.text // Debug.Log(touchScreenKeyboard.text) ) .AddTo(gameObject);