diff options
author | 2012-01-26 18:03:30 +0900 | |
---|---|---|
committer | 2012-01-31 12:55:45 +0900 | |
commit | ca2f051cc173acc3bce384ebfe08068564bc8e07 (patch) | |
tree | e6521ddbe372710fd703dac4574552e8b7e96e3c /java/src/com/android/inputmethod/latin/LatinIME.java | |
parent | 3b0f2bf169c23ea94c5a0adb275ce41b5c34ea83 (diff) | |
download | latinime-ca2f051cc173acc3bce384ebfe08068564bc8e07.tar.gz latinime-ca2f051cc173acc3bce384ebfe08068564bc8e07.tar.xz latinime-ca2f051cc173acc3bce384ebfe08068564bc8e07.zip |
Auto generate various shift states alphabet keyboard automatically
If any shift state variants of alphabet keyboard layout is not
specified in KeyboardSet.Element, it will be automatically generated
from base alphabet keyboard definition.
This change also
* Eliminates KeyboardShiftState object from Keyboard.
* Removes various set shift state methods from Keyboard.
* Removes KeyboardSet.Element.elementAutoGenerate attribute.
* Separates "sticky" Key.backgroundType to "stickyOff" and "stickyOn"
* Add preserveCase flag to smiley, .com, and labeled special keys.
* Rename KeyboardShiftState class to AlphabetShiftState.
* Rename some attributes from *UppercaseLetter* to *ShiftedLetterHint*.
* Introduce shiftedLetterActivated to Key.keyLabelFlags
Change-Id: I01a0a8efeeaa76820ae728a5bdfa8d02b6ce74b7
Diffstat (limited to 'java/src/com/android/inputmethod/latin/LatinIME.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/LatinIME.java | 32 |
1 files changed, 5 insertions, 27 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index 2e7e82637..0d6395d97 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -1470,13 +1470,12 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar if (ic == null) return; - // True if keyboard is in either chording shift or manual temporary upper case mode. - final boolean isManualTemporaryUpperCase = mKeyboardSwitcher.isManualTemporaryUpperCase(); - if (EditorInfoCompatUtils.hasFlagNavigateNext(imeOptions) - && !isManualTemporaryUpperCase) { + final Keyboard keyboard = mKeyboardSwitcher.getKeyboard(); + // True if keyboard is in either shift chording or manual shifted state. + final boolean isManualShifted = (keyboard != null && keyboard.isManualShifted()); + if (EditorInfoCompatUtils.hasFlagNavigateNext(imeOptions) && !isManualShifted) { EditorInfoCompatUtils.performEditorActionNext(ic); - } else if (EditorInfoCompatUtils.hasFlagNavigatePrevious(imeOptions) - && isManualTemporaryUpperCase) { + } else if (EditorInfoCompatUtils.hasFlagNavigatePrevious(imeOptions) && isManualShifted) { EditorInfoCompatUtils.performEditorActionPrevious(ic); } } @@ -1518,27 +1517,6 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar mComposingStateManager.onFinishComposingText(); } } - final KeyboardSwitcher switcher = mKeyboardSwitcher; - if (switcher.isShiftedOrShiftLocked()) { - if (keyCodes == null || keyCodes[0] < Character.MIN_CODE_POINT - || keyCodes[0] > Character.MAX_CODE_POINT) { - return; - } - code = keyCodes[0]; - if (switcher.isAlphabetMode() && Character.isLowerCase(code)) { - // In some locales, such as Turkish, Character.toUpperCase() may return a wrong - // character because it doesn't take care of locale. - final String upperCaseString = new String(new int[] {code}, 0, 1) - .toUpperCase(mSubtypeSwitcher.getInputLocale()); - if (upperCaseString.codePointCount(0, upperCaseString.length()) == 1) { - code = upperCaseString.codePointAt(0); - } else { - // Some keys, such as [eszett], have upper case as multi-characters. - onTextInput(upperCaseString); - return; - } - } - } if (isComposingWord) { mWordComposer.add(code, keyCodes, x, y); if (ic != null) { |