onsurroundingtextchange is enough. You'll have textBeforeCursor and textAfterCursor on the inputcontext to do predictive text (also works when inputcontext activates).