How can an input method raise an updateCursor event?

we are introducing a custom input service, and we are interested in receiving cursor update events. The documentation of InputMethodSession updateCursor () says: "This method is called when the cursor location of the target input field has changed in its window. This is usually not called, but report only when requested by the input method .

How can an input method request this event?

Thanks in advance,

Andrew

+3
source share
2 answers

It seems that this is not implemented. In the implementation, the TextViewcall updateCursordepends on InputMethodManager.isWatchingCursor, which is successfully determined as follows:

/**
 * Returns true if the current input method wants to watch the location
 * of the input editor cursor in its window.
 */
public boolean isWatchingCursor(View view) {
    return false;
}

, onUpdateSelection, , Rect.

+3

Source: https://habr.com/ru/post/1774046/


All Articles