Hello everyone.

The Mixed Reality Forums here are no longer being used or maintained.

There are a few other places we would like to direct you to for support, both from Microsoft and from the community.

The first way we want to connect with you is our mixed reality developer program, which you can sign up for at https://aka.ms/IWantMR.

For technical questions, please use Stack Overflow, and tag your questions using either hololens or windows-mixed-reality.

If you want to join in discussions, please do so in the HoloDevelopers Slack, which you can join by going to https://aka.ms/holodevelopers, or in our Microsoft Tech Communities forums at https://techcommunity.microsoft.com/t5/mixed-reality/ct-p/MicrosoftMixedReality.

And always feel free to hit us up on Twitter @MxdRealityDev.
Options

Unity Input Field with HoloLens

cpetercpeter
edited February 2017 in Questions And Answers

So I wrongly assume the Unity InputField UI element would work like it does with every other OS (PC, Android, iOS etc).
I've been trying to figure out to to bring up the Keyboard which I do when building in XAML even with Unity 5.5.1 which I thought was going to change that.
The keyboard will open only after minimizing the app and opening but when I go back to the app none of my text input is ever saved.
Am I missing some component in inspector cause the code I'm using seems to be the same as everyone else. I'd really like to avoid the tediousness that is making a UI Keyboard.

public void OnInputClicked(InputEventData eventData)
{
    Debug.Log("Opening Keyboard for input field.");

    keyboard = TouchScreenKeyboard.Open("", TouchScreenKeyboardType.Default, false, false, false, false);
}

void Update()
{

    if (keyboard != null && keyboard.active == false)
    {
        if (keyboard.done == true)
        {
            keyboardText = keyboard.text;
            Debug.Log("Text input: " + keyboardText);
            keyboard = null;
            relatedInputField.text = keyboardText;
        }
    }
}

Any help would be appreciated.
Using Unity5.5.1 and the Latest Holotoolkit.
(Which I'm surprised Holotoolkit doesn't have anything for text input.)

Tagged:

Best Answer

Answers

Sign In or Register to comment.