@@ -13,18 +13,7 @@ public abstract class IMEHandler : IIMEHandler
13
13
{
14
14
protected class XNATextBoxIMEStatus
15
15
{
16
- private bool _lastActionIMEChatInput = true ;
17
- public bool LastActionIMEChatInput
18
- {
19
- get => _lastActionIMEChatInput ;
20
- set
21
- {
22
- _lastActionIMEChatInput = value ;
23
- HasEverBeenReceivedIMEChatInput |= value ;
24
- }
25
- }
26
-
27
- public bool HasEverBeenReceivedIMEChatInput { get ; private set ; } = false ;
16
+ public bool LastActionIMEChatInput = true ;
28
17
public Action < char > ? HandleChatInput = null ;
29
18
}
30
19
@@ -56,10 +45,13 @@ protected set
56
45
57
46
public bool CompositionEmpty => string . IsNullOrEmpty ( _composition ) ;
58
47
48
+ public bool IMEEventReceived = false ;
49
+
59
50
private void OnCompositionChanged ( string oldValue , string newValue )
60
51
{
61
52
Debug . WriteLine ( $ "IME: OnCompositionChanged: { newValue . Length - oldValue . Length } ") ;
62
53
54
+ IMEEventReceived = true ;
63
55
if ( IMEFocus != null )
64
56
{
65
57
XNATextBoxIMEStatus status = GetOrNewXNATextBoxIMEStatus ( IMEFocus ) ;
@@ -104,6 +96,7 @@ protected virtual void OnIMETextInput(char character)
104
96
{
105
97
Debug . WriteLine ( $ "IME: OnIMETextInput: { character } { ( short ) character } ; IMEFocus is null? { IMEFocus == null } ") ;
106
98
99
+ IMEEventReceived = true ;
107
100
if ( IMEFocus != null )
108
101
{
109
102
var status = GetOrNewXNATextBoxIMEStatus ( IMEFocus ) ;
@@ -218,8 +211,8 @@ public bool HandleEnterKey(XNATextBox sender)
218
211
public bool HandleEscapeKey ( XNATextBox sender )
219
212
{
220
213
XNATextBoxIMEStatus status = GetOrNewXNATextBoxIMEStatus ( sender ) ;
221
- Debug . WriteLine ( $ "IME: HandleEscapeKey: handled: { status . HasEverBeenReceivedIMEChatInput } ") ;
222
- return status . HasEverBeenReceivedIMEChatInput ;
214
+ Debug . WriteLine ( $ "IME: HandleEscapeKey: handled: { IMEEventReceived } ") ;
215
+ return IMEEventReceived ;
223
216
}
224
217
225
218
public void OnTextChanged ( XNATextBox sender )
0 commit comments