diff options
author | Android (Google) Code Review <android-gerrit@google.com> | 2009-06-29 17:13:49 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2009-06-29 17:13:49 -0700 |
commit | 22e8cbc32bd642bcb3e9b6f161ec662bcf45ff70 (patch) | |
tree | 945fb40056c686be4a02add5b4bc69714ad91359 /core | |
parent | 27a8e07e4a10d3754c696cf5b0d947b7bdaea187 (diff) | |
parent | 86d56cca9ce23b0f4814418d7c71ec11ea9fd278 (diff) | |
download | frameworks_base-22e8cbc32bd642bcb3e9b6f161ec662bcf45ff70.zip frameworks_base-22e8cbc32bd642bcb3e9b6f161ec662bcf45ff70.tar.gz frameworks_base-22e8cbc32bd642bcb3e9b6f161ec662bcf45ff70.tar.bz2 |
Merge change 5656 into donut
* changes:
Generate key events for actions sent to generic input connections.
Diffstat (limited to 'core')
-rw-r--r-- | core/java/android/view/inputmethod/BaseInputConnection.java | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/core/java/android/view/inputmethod/BaseInputConnection.java b/core/java/android/view/inputmethod/BaseInputConnection.java index 9a0f467..7393737 100644 --- a/core/java/android/view/inputmethod/BaseInputConnection.java +++ b/core/java/android/view/inputmethod/BaseInputConnection.java @@ -340,10 +340,19 @@ public class BaseInputConnection implements InputConnection { } /** - * The default implementation does nothing. + * The default implementation turns this into the enter key. */ public boolean performEditorAction(int actionCode) { - return false; + long eventTime = SystemClock.uptimeMillis(); + sendKeyEvent(new KeyEvent(eventTime, eventTime, + KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_ENTER, 0, 0, 0, 0, + KeyEvent.FLAG_SOFT_KEYBOARD | KeyEvent.FLAG_KEEP_TOUCH_MODE + | KeyEvent.FLAG_EDITOR_ACTION)); + sendKeyEvent(new KeyEvent(SystemClock.uptimeMillis(), eventTime, + KeyEvent.ACTION_UP, KeyEvent.KEYCODE_ENTER, 0, 0, 0, 0, + KeyEvent.FLAG_SOFT_KEYBOARD | KeyEvent.FLAG_KEEP_TOUCH_MODE + | KeyEvent.FLAG_EDITOR_ACTION)); + return true; } /** |