Skip to content

Commit ce86185

Browse files
committed
Update IMEHandler.cs
1 parent 088b4b3 commit ce86185

File tree

1 file changed

+7
-14
lines changed

1 file changed

+7
-14
lines changed

ClientGUI/IME/IMEHandler.cs

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,7 @@ public abstract class IMEHandler : IIMEHandler
1313
{
1414
protected class XNATextBoxIMEStatus
1515
{
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;
2817
public Action<char>? HandleChatInput = null;
2918
}
3019

@@ -56,10 +45,13 @@ protected set
5645

5746
public bool CompositionEmpty => string.IsNullOrEmpty(_composition);
5847

48+
public bool IMEEventReceived = false;
49+
5950
private void OnCompositionChanged(string oldValue, string newValue)
6051
{
6152
Debug.WriteLine($"IME: OnCompositionChanged: {newValue.Length - oldValue.Length}");
6253

54+
IMEEventReceived = true;
6355
if (IMEFocus != null)
6456
{
6557
XNATextBoxIMEStatus status = GetOrNewXNATextBoxIMEStatus(IMEFocus);
@@ -104,6 +96,7 @@ protected virtual void OnIMETextInput(char character)
10496
{
10597
Debug.WriteLine($"IME: OnIMETextInput: {character} {(short)character}; IMEFocus is null? {IMEFocus == null}");
10698

99+
IMEEventReceived = true;
107100
if (IMEFocus != null)
108101
{
109102
var status = GetOrNewXNATextBoxIMEStatus(IMEFocus);
@@ -218,8 +211,8 @@ public bool HandleEnterKey(XNATextBox sender)
218211
public bool HandleEscapeKey(XNATextBox sender)
219212
{
220213
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;
223216
}
224217

225218
public void OnTextChanged(XNATextBox sender)

0 commit comments

Comments
 (0)