KeyHandler // Let invalid input pass when the state is Empty.
This commit is contained in:
parent
4dc17d8a2c
commit
dedc8770cf
|
@ -48,6 +48,12 @@ extension KeyHandler {
|
||||||
|
|
||||||
// 提前過濾掉一些不合規的按鍵訊號輸入,免得相關按鍵訊號被送給 Megrez 引發輸入法崩潰。
|
// 提前過濾掉一些不合規的按鍵訊號輸入,免得相關按鍵訊號被送給 Megrez 引發輸入法崩潰。
|
||||||
if input.isInvalidInput {
|
if input.isInvalidInput {
|
||||||
|
// 在「.Empty(IgnoringPreviousState) 與 .Deactivated」狀態下的首次不合規按鍵輸入可以直接放行。
|
||||||
|
if state is InputState.Empty || state is InputState.Deactivated
|
||||||
|
|| state is InputState.EmptyIgnoringPreviousState
|
||||||
|
{
|
||||||
|
return false
|
||||||
|
}
|
||||||
IME.prtDebugIntel("550BCF7B: KeyHandler just refused an invalid input.")
|
IME.prtDebugIntel("550BCF7B: KeyHandler just refused an invalid input.")
|
||||||
errorCallback()
|
errorCallback()
|
||||||
stateCallback(state)
|
stateCallback(state)
|
||||||
|
|
Loading…
Reference in New Issue