From the docs, I can see that the input context will send one of the following methods to the text view.
insertText:replacementRange:
setMarkedText:selectedRange:replacementRange:
doCommandBySelector:
In my testcase, when enabled an input method, keyDown
can trigger setMarkedText:selectedRange:replacementRange
, but if I keep deleting markedText
until the last character, then the input method will be deactivated without triggering any methods above.
Is there anything like a hook for the deactivation, so that I can do something immediately once input method deactivated?