public void SetData(XRKeyboard keyboard, char keyChar, string keyString, System.Action <char, string> keyPressed) { this.keyChar = keyChar; this.keyString = keyString; this.keyPressed = keyPressed; this.secondaryKeys = keyboard.CurrentKeyboard.GetSeconardyKeys(keyChar); this.text.text = keyString; //// TODO [bgish]: Do something with the secondary keys (show them on hover?) }
private void ListenForXRKeyboard() { this.StartCoroutine(Coroutine()); IEnumerator Coroutine() { XRKeyboard xrKeyboard = DialogManager.GetDialog <XRKeyboard>(); while (true) { if (InputFieldTracker.IsInputFieldSelected && xrKeyboard.Dialog.IsHidden) { xrKeyboard.Dialog.Show(); } // NOTE [bgish]: This is important and kinda hacky, we need to call InputFieldTracker.IsInputFieldSelected every // frame if we want to properly track the last known selection of the text input. We only care // though if the keyboard dialog is showing, else we can just check every quarter second. yield return(xrKeyboard.Dialog.IsShowing ? null : WaitForUtil.Seconds(0.25f)); } } }