diff options
Diffstat (limited to 'core/java/android/inputmethodservice/AbstractInputMethodService.java')
| -rw-r--r-- | core/java/android/inputmethodservice/AbstractInputMethodService.java | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/core/java/android/inputmethodservice/AbstractInputMethodService.java b/core/java/android/inputmethodservice/AbstractInputMethodService.java index 27af0135cc05..3c3182accc8e 100644 --- a/core/java/android/inputmethodservice/AbstractInputMethodService.java +++ b/core/java/android/inputmethodservice/AbstractInputMethodService.java @@ -149,6 +149,17 @@ public abstract class AbstractInputMethodService extends Service callback.finishedEvent(seq, handled); } } + + /** + * Take care of dispatching incoming generic motion events to the appropriate + * callbacks on the service, and tell the client when this is done. + */ + public void dispatchGenericMotionEvent(int seq, MotionEvent event, EventCallback callback) { + boolean handled = onGenericMotionEvent(event); + if (callback != null) { + callback.finishedEvent(seq, handled); + } + } } /** @@ -189,7 +200,25 @@ public abstract class AbstractInputMethodService extends Service return new IInputMethodWrapper(this, mInputMethod); } + /** + * Implement this to handle trackball events on your input method. + * + * @param event The motion event being received. + * @return True if the event was handled in this function, false otherwise. + * @see View#onTrackballEvent + */ public boolean onTrackballEvent(MotionEvent event) { return false; } + + /** + * Implement this to handle generic motion events on your input method. + * + * @param event The motion event being received. + * @return True if the event was handled in this function, false otherwise. + * @see View#onGenericMotionEvent + */ + public boolean onGenericMotionEvent(MotionEvent event) { + return false; + } } |
