Enter composing mode and working when cursor is in the middle of a word.
Description
Revisions and Commits
R8 Sim-Sik Android Input Method Engine | |||
R8:0a03d195f6c8 test cases for in-word composing | |||
R8:076e3df299ca add in-word composing |
Event Timeline
Input state: unchanged
Tailing text
Input state + tailing text = display state,
for correction, suggestion
Composing text + tailing text = composing region
Issue: tonal mark
Scenario 1: tonal mark moves backward
lê_ng > delete > l_n̂g (from l_ng)
Scenario 2: tonal mark moves forward
li_ú > input "A" > liá_u (from lia_ú)
p_n̄g > input "o" > pō_ng (from po_n̄g)
Plan B
Composing state:
separated from input state
for input composing (append, delete)
Composing cursor:
after the last grapheme of composing state
Plan B
initComposing:
Parsed into input state and composing state
Composing is subset of input state, before cursor,
without tone
updateComposingText:
Composing cursor is lengh of text of composing state,
possibility with or without tone.
inputComposing:
Using composing state to edit/delete.
Recreate input state.
updateView refactory:
Fields for actions:
- ComposingCorrection: not in used now
- SelectionEnd and DeleteAfter: combined together to delete selection
- DeleteBefore: it is used to:
- delete characters before cursor in non-text mode
- delete characters before cursor in text, non-composing mode
- delete characters before cursor in text, composing mode, and composing not started In other words, it is used to delete characters before cursor without composing region
- CommitText:
- In non-text mode, it is used to commit character and text before cursor
- In text, non-composing mode, it is used to commit character before cursor
- In text, composing mode, it is used to:
- commit text before cursor without composing region
- commit text before changed composing region
- commit composing text then reset composing state
- commit text then discard composing region when correction text is clicked
- commit text then discard composing region when candidate text is clicked
- It is also used to commit special symbols before cursor
- ComposingText: it is used to update text composing region after state update
- ComposingCursor: it is used to update cursor inside composing region after state update
- ComposingStart/End: it is used to update composing region after parsing
- After input started
- After switch back from ASCII keyboard
- After cursor/selection update
- After delete characters before cursor without composing region
- After deleting with composing state updated
- After inserting with composing state updated
updateView refactory: (continued)
Order for actions:
a.
- SelectionEnd (with SelectionStart)
- DeleteAfter
b. DeleteBefore (could be 1)
The order for a and b is not important.
c. CommitText (so it will not be deleted by DeleteBefore)
d. ComposingStart/End: was affected by DeleteBefore, CommitText
e. ComposingText
f. ComposingCursor