KeyHandler // Typo fix.
This commit is contained in:
parent
dd687df1e8
commit
a53b58b824
|
@ -33,7 +33,7 @@ enum StateType {
|
||||||
case ofDeactivated
|
case ofDeactivated
|
||||||
case ofAssociatedPhrases
|
case ofAssociatedPhrases
|
||||||
case ofEmpty
|
case ofEmpty
|
||||||
case ofEmptyIgnorePreviousState
|
case ofEmptyIgnoringPreviousState
|
||||||
case ofCommitting
|
case ofCommitting
|
||||||
case ofNotEmpty
|
case ofNotEmpty
|
||||||
case ofInputting
|
case ofInputting
|
||||||
|
@ -70,7 +70,7 @@ protocol InputStateProtocol {
|
||||||
/// 組字區內存入任何東西,所以該狀態不受 .NotEmpty 的管轄。
|
/// 組字區內存入任何東西,所以該狀態不受 .NotEmpty 的管轄。
|
||||||
/// - .Empty: 使用者剛剛切換至該輸入法、卻還沒有任何輸入行為。抑或是剛剛敲字遞交給
|
/// - .Empty: 使用者剛剛切換至該輸入法、卻還沒有任何輸入行為。抑或是剛剛敲字遞交給
|
||||||
/// 客體應用、準備新的輸入行為。
|
/// 客體應用、準備新的輸入行為。
|
||||||
/// - .EmptyIgnorePreviousState: 與 Empty 類似,但會扔掉上一個狀態的內容、不將這些
|
/// - .EmptyIgnoringPreviousState: 與 Empty 類似,但會扔掉上一個狀態的內容、不將這些
|
||||||
/// 內容遞交給客體應用。該狀態在處理完畢之後會被立刻切換至 .Empty()。
|
/// 內容遞交給客體應用。該狀態在處理完畢之後會被立刻切換至 .Empty()。
|
||||||
/// - .Committing: 該狀態會承載要遞交出去的內容,讓輸入法控制器處理時代為遞交。
|
/// - .Committing: 該狀態會承載要遞交出去的內容,讓輸入法控制器處理時代為遞交。
|
||||||
/// - .NotEmpty: 非空狀態,是一種狀態大類、用以派生且代表下述諸狀態。
|
/// - .NotEmpty: 非空狀態,是一種狀態大類、用以派生且代表下述諸狀態。
|
||||||
|
@ -106,11 +106,11 @@ enum InputState {
|
||||||
|
|
||||||
// MARK: -
|
// MARK: -
|
||||||
|
|
||||||
/// .EmptyIgnorePreviousState: 與 Empty 類似,
|
/// .EmptyIgnoringPreviousState: 與 Empty 類似,
|
||||||
/// 但會扔掉上一個狀態的內容、不將這些內容遞交給客體應用。
|
/// 但會扔掉上一個狀態的內容、不將這些內容遞交給客體應用。
|
||||||
/// 該狀態在處理完畢之後會被立刻切換至 .Empty()。
|
/// 該狀態在處理完畢之後會被立刻切換至 .Empty()。
|
||||||
class EmptyIgnoringPreviousState: Empty {
|
class EmptyIgnoringPreviousState: Empty {
|
||||||
override public var type: StateType { .ofEmptyIgnorePreviousState }
|
override public var type: StateType { .ofEmptyIgnoringPreviousState }
|
||||||
override var description: String {
|
override var description: String {
|
||||||
"<InputState.EmptyIgnoringPreviousState>"
|
"<InputState.EmptyIgnoringPreviousState>"
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,7 +55,7 @@ extension KeyHandler {
|
||||||
// 提前過濾掉一些不合規的按鍵訊號輸入,免得相關按鍵訊號被送給 Megrez 引發輸入法崩潰。
|
// 提前過濾掉一些不合規的按鍵訊號輸入,免得相關按鍵訊號被送給 Megrez 引發輸入法崩潰。
|
||||||
if input.isInvalid {
|
if input.isInvalid {
|
||||||
// 在「.Empty(IgnoringPreviousState) 與 .Deactivated」狀態下的首次不合規按鍵輸入可以直接放行。
|
// 在「.Empty(IgnoringPreviousState) 與 .Deactivated」狀態下的首次不合規按鍵輸入可以直接放行。
|
||||||
// 因為「.EmptyIgnorePreviousState」會在處理之後被自動轉為「.Empty」,所以不需要單獨判斷。
|
// 因為「.EmptyIgnoringPreviousState」會在處理之後被自動轉為「.Empty」,所以不需要單獨判斷。
|
||||||
if state is InputState.Empty || state is InputState.Deactivated {
|
if state is InputState.Empty || state is InputState.Deactivated {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue