webplayer, GUI TextArea and Backspace key ...

Hi, not sure if anyone else has seen this or if I’m missing something obvious but ,

In my app I have a GUILayout.TextArea as part of my HUD. Everything works fine in the editor, however when running in the web player if I type something into the TextArea and then hit backspace to correct the text the browser picks up the backspace key event and effectively navigates to the previous page, unloading the app - is there a way to stop this ?

Cheers
Garrett

Hi, I’ve narrowed this down to what might be a bug

I’ve created a simple test app with a small script that creates a TextArea on the screen - heres the script …

using UnityEngine;
using System.Collections;

public class testgui : MonoBehaviour {
private string txt = “some test data”;
// Use this for initialization
void Start () {
}
void OnGUI()
{
GUI.SetNextControlName(“hehe”);
txt = GUILayout.TextArea(txt);
GUI.FocusControl(“hehe”);
}
// Update is called once per frame
void Update () {
}
}

The problem appears to be the setting of the focus on the control.

Note: this only occurs for the first time when the app is loaded.
So, if you load the app you’ll see the textarea drawn with the ‘some test data’ string and the cursor correctly focused in the control.
DONT CLICK INTO THE CONTROL
Notice that the cursor keys dont work.
Try typing some data - that will work
Now hit BACKSPACE - the browser (IE8) navigates backwards.

If I take out the focus control code then it works fine - except the user has to click into the textarea of course first.
Note also that clicking into the textarea first in my test app solves the problem

chk it out http://78.137.168.38/testgui.html

Can anyone confim they see it too - if so I’m going to log a bug

Cheers
Garrett

Since you have code that reproduces the error, please log it as a bug anyway. It might be an issue with the browser rather than Unity, but the QA team would prefer to know about it.

cool - i’ve logged it as a bug - and it looks like an IE only issue - firefox doesn’t exhibit the problem

Cheers