|
|
|
|
|
|
using System; |
|
|
|
using System.Collections.Generic; |
|
|
|
using System.Runtime.InteropServices; |
|
|
|
using Unity.UIWidgets.async2; |
|
|
|
using Unity.UIWidgets.gestures; |
|
|
|
using Unity.UIWidgets.ui; |
|
|
|
using UnityEngine; |
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
var currentEvent = Event.current; |
|
|
|
var currentEvent = PointerEventConverter.KeyEvent; |
|
|
|
Debug.Log($"event: {currentEvent}"); |
|
|
|
var oldValue = _value; |
|
|
|
|
|
|
|
if (currentEvent != null && currentEvent.type == EventType.KeyDown) { |
|
|
|
|
|
|
_value = _value.insert(new string(ch, 1)); |
|
|
|
} |
|
|
|
} |
|
|
|
else if (!string.IsNullOrEmpty(Input.compositionString)) { |
|
|
|
else if (!string.IsNullOrEmpty(currentEvent.keyCode.ToString())) { |
|
|
|
_value = _value.compose(Input.compositionString); |
|
|
|
Debug.Log($"event:? {currentEvent}"); |
|
|
|
_value = _value.compose(currentEvent.keyCode.ToString()); |
|
|
|
} |
|
|
|
|
|
|
|
currentEvent.Use(); |
|
|
|
|
|
|
if (this.isIMEInput) { |
|
|
|
var isIMEInput = this.isIMEInput; |
|
|
|
Window.instance.run(() => { TextInput._updateEditingState(_client, _value, isIMEInput); }); |
|
|
|
Timer.create(TimeSpan.Zero, () => { |
|
|
|
TextInput._updateEditingState(_client, _value, isIMEInput); |
|
|
|
}); |
|
|
|
Window.instance.run(() => { TextInput._updateEditingState(_client, _value); }); |
|
|
|
Timer.create(TimeSpan.Zero, () => { |
|
|
|
TextInput._updateEditingState(_client, _value); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|