Hi all,
I had the same issue and got something working using the hotfix posted by marasto.
First, instead of declaring
private string lastInputEvents = System.String.Empty;
I had to declare it as
private static string lastInputEvents = System.String.Empty;
(otherwise I had an error
"An object reference is required to access non-static member `UICamera.lastInputEvents`")
I was also getting multiple deletes using the Unity Editor, so I put the
#if UNITY_WEBPLAYER ... #endif section of code (in the OnGUI function) in an
if condition to check if the runtime platform is the OSX Web Player. OnGUI() now looks like :
void OnGUI ()
{
#if UNITY_EDITOR
if (debug && lastHit.collider != null)
{
GUILayout.Label("Last Hit: " + NGUITools.GetHierarchy(lastHit.collider.gameObject).Replace("\"", ""));
}
#endif
#if UNITY_WEBPLAYER
if(Application.platform == RuntimePlatform.OSXWebPlayer)
{
if(inputHasFocus && (Input.imeCompositionMode != IMECompositionMode.Off)) {
//get last reported input
if(Event.current.isKey ) {
if(Event.current.keyCode == KeyCode.Backspace) {
//CHECK IF BACKSPACE IS ALREADY IN THE INPUT STRING
if(Input.inputString.LastIndexOf('\b') == -1) {
//backspace or delete not reported so add the backspace char for the next update
lastInputEvents += '\b';
}
}
}
}
}
#endif
}
It's working like a charm now !