Merge pull request #331 from Unity-Technologies/zxw/fix_text_input_issue
fix text input bug
This commit is contained in:
Коммит
6dfad58556
|
@ -207,8 +207,8 @@ namespace Unity.UIWidgets.gestures {
|
|||
keyBoardEvent.command = (datum.modifier & (1 << (int) FunctionKey.command)) > 0;
|
||||
keyBoardEvent.control = (datum.modifier & (1 << (int) FunctionKey.control)) > 0;
|
||||
#endif
|
||||
RawKeyboard.instance._handleKeyEvent(keyBoardEvent);
|
||||
TextInput.OnGUI();
|
||||
RawKeyboard.instance._handleKeyEvent(keyBoardEvent);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ using System.Collections.Generic;
|
|||
using Unity.UIWidgets.async;
|
||||
using Unity.UIWidgets.external.simplejson;
|
||||
using Unity.UIWidgets.foundation;
|
||||
using Unity.UIWidgets.gestures;
|
||||
using Unity.UIWidgets.services;
|
||||
using Unity.UIWidgets.ui;
|
||||
using UnityEngine;
|
||||
|
@ -748,9 +749,19 @@ namespace Unity.UIWidgets.service {
|
|||
}
|
||||
}
|
||||
|
||||
internal static void OnGUI() {
|
||||
internal static bool OnGUI() {
|
||||
if (_currentConnection != null && _currentConnection._window == Window.instance) {
|
||||
(keyboardDelegate as TextInputOnGUIListener)?.OnGUI();
|
||||
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
//skip all the key events when no connection is attached
|
||||
while (!PointerEventConverter.KeyEvent.isEmpty()) {
|
||||
PointerEventConverter.KeyEvent.Dequeue();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче