For the keyboard, when commit a text into input box, IMF will fire "onSurroundingTextChange" event.
However, since the event is caused by IME self.
Keyboard need disgusting the event is fired by IME or by focus changing.
Usually, when keyboard maintains a text before cursor changing history,
when commits a text, update the history stack.
When keyboard receives the "onSurroundingTextChange" event, checks the
bring information whether match the history stack.
If matches, means the event is caused by IME, otherwise it's by focus
changing.
Comment 1 by wuyingbing@chromium.org
, Sep 26