Hi
I’m working on multitouch apps.
These apps are running one multitouch device under Windows 10
I don’t have any physical keyboard one these device so i need a virtual keyboard.
I tried this solution : http://answers.unity3d.com/answers/1134812/view.html
But the keyboard is really slow and give options to leave my application.
So i start to create my own keyboard.
So i create a UIPanel, and buttons for letters
This is working well
Then i tried to add a backspace button and here start my problem :
I can’t erase a character from the input field
when i press my backspace touch i call a function where i do this :
field.GetComponentInChildren<InputField>().text.Remove(field.GetComponentInChildren<InputField>().text.Length, 1);
field is my inputfield gameObject
But i have this error :
ArgumentOutOfRangeException:
startIndex + count > this.length
Parameter name: count
System.String.Remove (Int32
startIndex, Int32 count) (at
/Users/builduser/buildslave/mono/build/mcs/class/corlib/System/String.cs:1747)
Keyboard.addInput () (at
Assets/Scripts/Keyboard.cs:23)
UnityEngine.Events.InvokableCall.Invoke
(System.Object args) (at
C:/buildslave/unity/build/Runtime/Export/UnityEvent.cs:153)
UnityEngine.Events.InvokableCallList.Invoke
(System.Object parameters) (at
C:/buildslave/unity/build/Runtime/Export/UnityEvent.cs:630)
UnityEngine.Events.UnityEventBase.Invoke
(System.Object parameters) (at
C:/buildslave/unity/build/Runtime/Export/UnityEvent.cs:765)
UnityEngine.Events.UnityEvent.Invoke
() (at
C:/buildslave/unity/build/Runtime/Export/UnityEvent_0.cs:53)
UnityEngine.UI.Button.Press () (at
C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/Button.cs:35)
UnityEngine.UI.Button.OnPointerClick
(UnityEngine.EventSystems.PointerEventData
eventData) (at
C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/Button.cs:44)
UnityEngine.EventSystems.ExecuteEvents.Execute
(IPointerClickHandler handler,
UnityEngine.EventSystems.BaseEventData
eventData) (at
C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/EventSystem/ExecuteEvents.cs:52)
UnityEngine.EventSystems.ExecuteEvents.Execute[IPointerClickHandler]
(UnityEngine.GameObject target,
UnityEngine.EventSystems.BaseEventData
eventData,
UnityEngine.EventSystems.EventFunction1 functor) (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/EventSystem/ExecuteEvents.cs:269) UnityEngine.EventSystems.ExecuteEvents:Execute(GameObject, BaseEventData, EventFunction1)
TouchScript.Behaviors.TouchScriptInputModule:endPointer(PointerEventData)
(at
Assets/TouchScript/Scripts/Behaviors/TouchScriptInputModule.cs:343)
TouchScript.Behaviors.TouchScriptInputModule:processEnded(TouchPoint)
(at
Assets/TouchScript/Scripts/Behaviors/TouchScriptInputModule.cs:463)
TouchScript.Behaviors.TouchScriptInputModule:touchesEndedHandler(Object,
TouchEventArgs) (at
Assets/TouchScript/Scripts/Behaviors/TouchScriptInputModule.cs:579)
TouchScript.Utils.EventHandlerExtensions:InvokeHandleExceptions(EventHandler1, Object, TouchEventArgs) (at Assets/TouchScript/Scripts/Utils/EventHandlerExtensions.cs:28) TouchScript.TouchManagerInstance:updateEnded(List1)
(at
Assets/TouchScript/Scripts/TouchManagerInstance.cs:699)
TouchScript.TouchManagerInstance:updateTouches()
(at
Assets/TouchScript/Scripts/TouchManagerInstance.cs:787)
TouchScript.TouchManagerInstance:Update()
(at
Assets/TouchScript/Scripts/TouchManagerInstance.cs:541)
Then i tried to use a temp string where i remove one character but the string in my inputfield does not change.