I've spent way too much time on this, so I finally am resorting to the forums. I did try to resolve this myself first :p
I have a UIInput that is disabled. When a user pressed the enter key, it enabled the UIInput and associated widget for adding text. Works fine.
I would like to be able to press a different key, have the UIInput be enabled, and that key already be in the input field. Sounds simple. I would like this character to
not be highlighted, because that's what happens every time at the moment. If it's highlighted, the next character you type just deletes it, and well, it's like it was never there.
Here's what I've been trying, in various forms. I looked at what pressing the right/left arrow keys do, and I fail to see the magic of what I'm missing. Assistance would be appreciated.
else if (!inputChat.gameObject.activeSelf && Input.GetKeyUp(KeyCode.Slash))
{
inputChat.gameObject.SetActive(true);
inputChat.isSelected = true;
inputChat.value = "/";
inputChat.cursorPosition = 1;
inputChat.selectionStart = 1;
inputChat.selectionEnd = 1;
inputChat.UpdateLabel();
}
So I've tried different order of what's above, messing around with it... and well, enough trial and error, here I am at the forums. Like I said, it works fine except the character is highlighted when it's added.
Thanks,
Alex