InputHandler // Bring cursor jump to the marking mode.
* Certain models of ThinkPad USB Keyboard don't support Alt+Shift+→, hence the choice of Command key as the alternative modifier key for this function.
This commit is contained in:
parent
c5b3083b48
commit
03913cb71c
|
@ -195,9 +195,13 @@ extension InputHandler {
|
|||
// Shift + Left
|
||||
if input.isCursorBackward, input.isShiftHold {
|
||||
if compositor.marker > 0 {
|
||||
compositor.marker -= 1
|
||||
if isCursorCuttingChar(isMarker: true) {
|
||||
if input.isCommandHold || input.isOptionHold {
|
||||
compositor.jumpCursorBySpan(to: .rear, isMarker: true)
|
||||
} else {
|
||||
compositor.marker -= 1
|
||||
if isCursorCuttingChar(isMarker: true) {
|
||||
compositor.jumpCursorBySpan(to: .rear, isMarker: true)
|
||||
}
|
||||
}
|
||||
var marking = IMEState.ofMarking(
|
||||
displayTextSegments: state.displayTextSegments,
|
||||
|
@ -216,9 +220,13 @@ extension InputHandler {
|
|||
// Shift + Right
|
||||
if input.isCursorForward, input.isShiftHold {
|
||||
if compositor.marker < compositor.length {
|
||||
compositor.marker += 1
|
||||
if isCursorCuttingChar(isMarker: true) {
|
||||
if input.isCommandHold || input.isOptionHold {
|
||||
compositor.jumpCursorBySpan(to: .front, isMarker: true)
|
||||
} else {
|
||||
compositor.marker += 1
|
||||
if isCursorCuttingChar(isMarker: true) {
|
||||
compositor.jumpCursorBySpan(to: .front, isMarker: true)
|
||||
}
|
||||
}
|
||||
var marking = IMEState.ofMarking(
|
||||
displayTextSegments: state.displayTextSegments,
|
||||
|
@ -644,9 +652,14 @@ extension InputHandler {
|
|||
if input.isShiftHold {
|
||||
// Shift + Right
|
||||
if compositor.cursor < compositor.length {
|
||||
compositor.marker = compositor.cursor + 1
|
||||
if isCursorCuttingChar(isMarker: true) {
|
||||
compositor.marker = compositor.cursor
|
||||
if input.isCommandHold || input.isOptionHold {
|
||||
compositor.jumpCursorBySpan(to: .front, isMarker: true)
|
||||
} else {
|
||||
compositor.marker += 1
|
||||
if isCursorCuttingChar(isMarker: true) {
|
||||
compositor.jumpCursorBySpan(to: .front, isMarker: true)
|
||||
}
|
||||
}
|
||||
var marking = IMEState.ofMarking(
|
||||
displayTextSegments: compositor.walkedNodes.values,
|
||||
|
@ -659,7 +672,7 @@ extension InputHandler {
|
|||
} else {
|
||||
delegate.callError("BB7F6DB9")
|
||||
}
|
||||
} else if input.isOptionHold {
|
||||
} else if input.isOptionHold, !input.isShiftHold {
|
||||
if input.isControlHold {
|
||||
return handleEnd()
|
||||
}
|
||||
|
@ -703,9 +716,14 @@ extension InputHandler {
|
|||
if input.isShiftHold {
|
||||
// Shift + left
|
||||
if compositor.cursor > 0 {
|
||||
compositor.marker = compositor.cursor - 1
|
||||
if isCursorCuttingChar(isMarker: true) {
|
||||
compositor.marker = compositor.cursor
|
||||
if input.isCommandHold || input.isOptionHold {
|
||||
compositor.jumpCursorBySpan(to: .rear, isMarker: true)
|
||||
} else {
|
||||
compositor.marker -= 1
|
||||
if isCursorCuttingChar(isMarker: true) {
|
||||
compositor.jumpCursorBySpan(to: .rear, isMarker: true)
|
||||
}
|
||||
}
|
||||
var marking = IMEState.ofMarking(
|
||||
displayTextSegments: compositor.walkedNodes.values,
|
||||
|
@ -718,7 +736,7 @@ extension InputHandler {
|
|||
} else {
|
||||
delegate.callError("D326DEA3")
|
||||
}
|
||||
} else if input.isOptionHold {
|
||||
} else if input.isOptionHold, !input.isShiftHold {
|
||||
if input.isControlHold { return handleHome() }
|
||||
// 游標跳轉動作無論怎樣都會執行,但如果出了執行失敗的結果的話則觸發報錯流程。
|
||||
if !compositor.jumpCursorBySpan(to: .rear) {
|
||||
|
|
Loading…
Reference in New Issue