diff options
| author | Victoria Lease <violets@google.com> | 2012-08-24 13:46:02 -0700 |
|---|---|---|
| committer | Victoria Lease <violets@google.com> | 2012-09-10 14:01:42 -0700 |
| commit | b38070caa5143ab9fd1883e0c7c879533a480bc7 (patch) | |
| tree | ffbed34eefd1fd81a028e1a14820d48953252b29 /core/java/android/inputmethodservice/InputMethodService.java | |
| parent | 37ee53420ce47860807eb8eaeb454c12fa46797b (diff) | |
IME support for trackball and generic motion events
Trackball and generic motion events now pass through the IME in case
it would like to handle them before passing them on to the view
hierarchy.
While I was at it, I also...
...fixed the documentation on InputMethodService.onKeyUp()
...added documentation to InputMethodService.onTrackballEvent()
...added trackball and generic motion events to the "input" command
...fixed input consistency verification involving ACTION_OUTSIDE
Bug: 7050005
Change-Id: I40ab68df4a9542af6df25de6ec2ec500e4c02902
Diffstat (limited to 'core/java/android/inputmethodservice/InputMethodService.java')
| -rw-r--r-- | core/java/android/inputmethodservice/InputMethodService.java | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/core/java/android/inputmethodservice/InputMethodService.java b/core/java/android/inputmethodservice/InputMethodService.java index d5b9edcc5588..cf3b802b6a42 100644 --- a/core/java/android/inputmethodservice/InputMethodService.java +++ b/core/java/android/inputmethodservice/InputMethodService.java @@ -1773,7 +1773,7 @@ public class InputMethodService extends AbstractInputMethodService { * Override this to intercept special key multiple events before they are * processed by the * application. If you return true, the application will not itself - * process the event. If you return true, the normal application processing + * process the event. If you return false, the normal application processing * will occur as if the IME had not seen the event at all. * * <p>The default implementation always returns false, except when @@ -1788,7 +1788,7 @@ public class InputMethodService extends AbstractInputMethodService { /** * Override this to intercept key up events before they are processed by the * application. If you return true, the application will not itself - * process the event. If you return true, the normal application processing + * process the event. If you return false, the normal application processing * will occur as if the IME had not seen the event at all. * * <p>The default implementation intercepts {@link KeyEvent#KEYCODE_BACK @@ -1806,8 +1806,29 @@ public class InputMethodService extends AbstractInputMethodService { return doMovementKey(keyCode, event, MOVEMENT_UP); } + /** + * Override this to intercept trackball motion events before they are + * processed by the application. + * If you return true, the application will not itself process the event. + * If you return false, the normal application processing will occur as if + * the IME had not seen the event at all. + */ @Override public boolean onTrackballEvent(MotionEvent event) { + if (DEBUG) Log.v(TAG, "onTrackballEvent: " + event); + return false; + } + + /** + * Override this to intercept generic motion events before they are + * processed by the application. + * If you return true, the application will not itself process the event. + * If you return false, the normal application processing will occur as if + * the IME had not seen the event at all. + */ + @Override + public boolean onGenericMotionEvent(MotionEvent event) { + if (DEBUG) Log.v(TAG, "onGenericMotionEvent(): event " + event); return false; } |
