InputHandler // Extend Shift+Command+[] for candidate states.
This commit is contained in:
parent
97d2c94754
commit
5a96c264f3
|
@ -195,6 +195,24 @@ extension InputHandler {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// MARK: - Flipping pages by using modified bracket keys (when they are not occupied).
|
||||||
|
|
||||||
|
// Shift+Command+[] 被 Chrome 系瀏覽器佔用,所以改用 Ctrl。
|
||||||
|
revolveCandidateWithBrackets: if input.modifierFlags == [.control, .command] {
|
||||||
|
if !state.isCandidateContainer { break revolveCandidateWithBrackets }
|
||||||
|
// 此處 JIS 鍵盤判定無法用於螢幕鍵盤。所以,螢幕鍵盤的場合,系統會依照 US 鍵盤的判定方案。
|
||||||
|
let isJIS: Bool = KBGetLayoutType(Int16(LMGetKbdType())) == kKeyboardJIS
|
||||||
|
switch (input.keyCode, isJIS) {
|
||||||
|
case (30, true), (33, false):
|
||||||
|
_ = ctlCandidate.highlightPreviousCandidate() ? {}() : delegate.callError("8B144DCD")
|
||||||
|
return true
|
||||||
|
case (42, true), (30, false):
|
||||||
|
_ = ctlCandidate.highlightNextCandidate() ? {}() : delegate.callError("D2ABB507")
|
||||||
|
return true
|
||||||
|
default: break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// MARK: - Flipping pages by using symbol menu keys (when they are not occupied).
|
// MARK: - Flipping pages by using symbol menu keys (when they are not occupied).
|
||||||
|
|
||||||
if input.isSymbolMenuPhysicalKey {
|
if input.isSymbolMenuPhysicalKey {
|
||||||
|
|
|
@ -128,6 +128,22 @@ extension InputHandler {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Shift+Command+[] 被 Chrome 系瀏覽器佔用,所以改用 Ctrl。
|
||||||
|
revolveCandidateWithBrackets: if event.modifierFlags == [.control, .command] {
|
||||||
|
if !delegate.state.isCandidateContainer { break revolveCandidateWithBrackets }
|
||||||
|
// 此處 JIS 鍵盤判定無法用於螢幕鍵盤。所以,螢幕鍵盤的場合,系統會依照 US 鍵盤的判定方案。
|
||||||
|
let isJIS: Bool = KBGetLayoutType(Int16(LMGetKbdType())) == kKeyboardJIS
|
||||||
|
switch (event.keyCode, isJIS) {
|
||||||
|
case (30, true), (33, false):
|
||||||
|
_ = imkC.highlightPreviousCandidate() ? {}() : delegate.callError("8B144DCD")
|
||||||
|
return true
|
||||||
|
case (42, true), (30, false):
|
||||||
|
_ = imkC.highlightNextCandidate() ? {}() : delegate.callError("D2ABB507")
|
||||||
|
return true
|
||||||
|
default: break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if prefs.useSCPCTypingMode, !event.isReservedKey {
|
if prefs.useSCPCTypingMode, !event.isReservedKey {
|
||||||
return handleInput(event: event)
|
return handleInput(event: event)
|
||||||
}
|
}
|
||||||
|
|
|
@ -140,10 +140,8 @@ extension InputHandler {
|
||||||
// 此處 JIS 鍵盤判定無法用於螢幕鍵盤。所以,螢幕鍵盤的場合,系統會依照 US 鍵盤的判定方案。
|
// 此處 JIS 鍵盤判定無法用於螢幕鍵盤。所以,螢幕鍵盤的場合,系統會依照 US 鍵盤的判定方案。
|
||||||
let isJIS: Bool = KBGetLayoutType(Int16(LMGetKbdType())) == kKeyboardJIS
|
let isJIS: Bool = KBGetLayoutType(Int16(LMGetKbdType())) == kKeyboardJIS
|
||||||
switch (input.keyCode, isJIS) {
|
switch (input.keyCode, isJIS) {
|
||||||
case (30, true): return revolveCandidate(reverseOrder: true)
|
case (30, true), (33, false): return revolveCandidate(reverseOrder: true)
|
||||||
case (42, true): return revolveCandidate(reverseOrder: false)
|
case (42, true), (30, false): return revolveCandidate(reverseOrder: false)
|
||||||
case (33, false): return revolveCandidate(reverseOrder: true)
|
|
||||||
case (30, false): return revolveCandidate(reverseOrder: false)
|
|
||||||
default: break
|
default: break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue