diff options
Diffstat (limited to 'java/src/com/android/inputmethod/latin/LatinIME.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/LatinIME.java | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index 35f43124d..6a858fe99 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -30,7 +30,6 @@ import com.android.inputmethod.keyboard.KeyboardSwitcher; import com.android.inputmethod.keyboard.KeyboardView; import com.android.inputmethod.keyboard.LatinKeyboard; import com.android.inputmethod.keyboard.LatinKeyboardView; -import com.android.inputmethod.latin.Utils.RingCharBuffer; import android.app.AlertDialog; import android.content.BroadcastReceiver; @@ -1174,10 +1173,8 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar if (primaryCode != Keyboard.CODE_ENTER) { mJustAddedAutoSpace = false; } - RingCharBuffer.getInstance().push((char)primaryCode, x, y); - LatinImeLogger.logOnInputChar(); if (isWordSeparator(primaryCode)) { - handleSeparator(primaryCode); + handleSeparator(primaryCode, x, y); } else { handleCharacter(primaryCode, keyCodes, x, y); } @@ -1357,10 +1354,10 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar } switcher.updateShiftState(); if (LatinIME.PERF_DEBUG) measureCps(); - TextEntryState.typedCharacter((char) code, isWordSeparator(code)); + TextEntryState.typedCharacter((char) code, isWordSeparator(code), x, y); } - private void handleSeparator(int primaryCode) { + private void handleSeparator(int primaryCode, int x, int y) { mVoiceProxy.handleSeparator(); // Should dismiss the "Touch again to save" message when handling separator @@ -1381,7 +1378,7 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar // in Italian dov' should not be expanded to dove' because the elision // requires the last vowel to be removed. if (mAutoCorrectOn && primaryCode != '\'') { - pickedDefault = pickDefaultSuggestion(); + pickedDefault = pickDefaultSuggestion(primaryCode); // Picked the suggestion by the space key. We consider this // as "added an auto space". if (primaryCode == Keyboard.CODE_SPACE) { @@ -1403,7 +1400,7 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar reswapPeriodAndSpace(); } - TextEntryState.typedCharacter((char) primaryCode, true); + TextEntryState.typedCharacter((char) primaryCode, true, x, y); if (TextEntryState.isPunctuationAfterAccepted() && primaryCode != Keyboard.CODE_ENTER) { swapPunctuationAndSpace(); } else if (isSuggestionsRequested() && primaryCode == Keyboard.CODE_SPACE) { @@ -1592,14 +1589,14 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar setCandidatesViewShown(isCandidateStripVisible()); } - private boolean pickDefaultSuggestion() { + private boolean pickDefaultSuggestion(int separatorCode) { // Complete any pending candidate query first if (mHandler.hasPendingUpdateSuggestions()) { mHandler.cancelUpdateSuggestions(); updateSuggestions(); } if (mBestWord != null && mBestWord.length() > 0) { - TextEntryState.acceptedDefault(mWord.getTypedWord(), mBestWord); + TextEntryState.acceptedDefault(mWord.getTypedWord(), mBestWord, separatorCode); mJustAccepted = true; pickSuggestion(mBestWord); // Add the word to the auto dictionary if it's not a known word @@ -1688,7 +1685,8 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar // Fool the state watcher so that a subsequent backspace will not do a revert, unless // we just did a correction, in which case we need to stay in // TextEntryState.State.PICKED_SUGGESTION state. - TextEntryState.typedCharacter((char) Keyboard.CODE_SPACE, true); + TextEntryState.typedCharacter((char) Keyboard.CODE_SPACE, true, + WordComposer.NOT_A_COORDINATE, WordComposer.NOT_A_COORDINATE); setPunctuationSuggestions(); } else if (!showingAddToDictionaryHint) { // If we're not showing the "Touch again to save", then show corrections again. @@ -1895,7 +1893,8 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar ic.commitText(mComposing, 1); TextEntryState.acceptedTyped(mComposing); ic.commitText(punctuation, 1); - TextEntryState.typedCharacter(punctuation.charAt(0), true); + TextEntryState.typedCharacter(punctuation.charAt(0), true, + WordComposer.NOT_A_COORDINATE, WordComposer.NOT_A_COORDINATE); // Clear composing text mComposing.setLength(0); } else { |