From 0b831ba2aaf7baf7be402f2245b225a04c28fada Mon Sep 17 00:00:00 2001 From: "Tadashi G. Takaoka" Date: Tue, 8 May 2012 13:10:57 +0900 Subject: [PATCH] Tab key preforms next action when EditorInfo.IME_ACTION_NEXT is specified Bug: 6435484 Change-Id: Iccca7d1b770c547efae0b5e5931cebd910083d40 --- java/src/com/android/inputmethod/latin/InputAttributes.java | 3 +++ java/src/com/android/inputmethod/latin/LatinIME.java | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/java/src/com/android/inputmethod/latin/InputAttributes.java b/java/src/com/android/inputmethod/latin/InputAttributes.java index 9c32f947c..229ae2f3c 100644 --- a/java/src/com/android/inputmethod/latin/InputAttributes.java +++ b/java/src/com/android/inputmethod/latin/InputAttributes.java @@ -29,6 +29,7 @@ public class InputAttributes { final public boolean mInputTypeNoAutoCorrect; final public boolean mIsSettingsSuggestionStripOn; final public boolean mApplicationSpecifiedCompletionOn; + final public int mEditorAction; public InputAttributes(final EditorInfo editorInfo, final boolean isFullscreenMode) { final int inputType = null != editorInfo ? editorInfo.inputType : 0; @@ -91,6 +92,8 @@ public class InputAttributes { mApplicationSpecifiedCompletionOn = flagAutoComplete && isFullscreenMode; } + mEditorAction = (editorInfo == null) ? EditorInfo.IME_ACTION_UNSPECIFIED + : editorInfo.imeOptions & EditorInfo.IME_MASK_ACTION; } @SuppressWarnings("unused") diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index 7232a4883..796d4ac79 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -1257,6 +1257,11 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen handleLanguageSwitchKey(); break; default: + if (primaryCode == Keyboard.CODE_TAB + && mInputAttributes.mEditorAction == EditorInfo.IME_ACTION_NEXT) { + performEditorAction(EditorInfo.IME_ACTION_NEXT); + break; + } mSpaceState = SPACE_STATE_NONE; if (mSettingsValues.isWordSeparator(primaryCode)) { didAutoCorrect = handleSeparator(primaryCode, x, y, spaceState);