diff options
author | 2010-09-06 06:47:03 -0700 | |
---|---|---|
committer | 2010-09-06 06:47:03 -0700 | |
commit | 920c507cd305e388b79b795801b22f5d022bb963 (patch) | |
tree | 2a36ea40de60ae6c010c02aad04797f83abd86d5 /java/src/com/android/inputmethod/latin/KeyboardSwitcher.java | |
parent | 470a0c9e7191e0bb803e1decea93060d3c122a9c (diff) | |
parent | efe7abe03dce1779ce76e175d0fe9422d2f8eaad (diff) | |
download | latinime-920c507cd305e388b79b795801b22f5d022bb963.tar.gz latinime-920c507cd305e388b79b795801b22f5d022bb963.tar.xz latinime-920c507cd305e388b79b795801b22f5d022bb963.zip |
am efe7abe0: am 12659d4c: Fix ALT key light behavior
Merge commit 'efe7abe03dce1779ce76e175d0fe9422d2f8eaad'
* commit 'efe7abe03dce1779ce76e175d0fe9422d2f8eaad':
Fix ALT key light behavior
Diffstat (limited to 'java/src/com/android/inputmethod/latin/KeyboardSwitcher.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/KeyboardSwitcher.java | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/java/src/com/android/inputmethod/latin/KeyboardSwitcher.java b/java/src/com/android/inputmethod/latin/KeyboardSwitcher.java index 3fb74b238..284b29305 100644 --- a/java/src/com/android/inputmethod/latin/KeyboardSwitcher.java +++ b/java/src/com/android/inputmethod/latin/KeyboardSwitcher.java @@ -16,10 +16,6 @@ package com.android.inputmethod.latin; -import java.util.HashMap; -import java.util.Locale; -import java.util.Map; - import android.content.Context; import android.content.SharedPreferences; import android.content.res.Configuration; @@ -27,6 +23,10 @@ import android.content.res.Resources; import android.preference.PreferenceManager; import android.view.InflateException; +import java.util.HashMap; +import java.util.Locale; +import java.util.Map; + public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceChangeListener { public static final int MODE_NONE = 0; @@ -197,8 +197,7 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha } mHasVoice = enableVoice; mVoiceOnPrimary = voiceOnPrimary; - setKeyboardMode(mMode, mImeOptions, mHasVoice, - mIsSymbols); + setKeyboardMode(mMode, mImeOptions, mHasVoice, mIsSymbols); } boolean hasVoiceButton(boolean isSymbols) { @@ -338,19 +337,23 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha void toggleShift() { if (mCurrentId.equals(mSymbolsId)) { - LatinKeyboard symbolsKeyboard = getKeyboard(mSymbolsId); LatinKeyboard symbolsShiftedKeyboard = getKeyboard(mSymbolsShiftedId); - symbolsKeyboard.setShifted(true); mCurrentId = mSymbolsShiftedId; mInputView.setKeyboard(symbolsShiftedKeyboard); - symbolsShiftedKeyboard.setShifted(true); + // Symbol shifted keyboard has an ALT key that has a caps lock style indicator. To + // enable the indicator, we need to call enableShiftLock() and setShiftLocked(true). + // Thus we can keep the ALT key's Key.on value true while LatinKey.onRelease() is + // called. + symbolsShiftedKeyboard.enableShiftLock(); + symbolsShiftedKeyboard.setShiftLocked(true); symbolsShiftedKeyboard.setImeOptions(mContext.getResources(), mMode, mImeOptions); } else if (mCurrentId.equals(mSymbolsShiftedId)) { LatinKeyboard symbolsKeyboard = getKeyboard(mSymbolsId); - LatinKeyboard symbolsShiftedKeyboard = getKeyboard(mSymbolsShiftedId); - symbolsShiftedKeyboard.setShifted(false); mCurrentId = mSymbolsId; mInputView.setKeyboard(symbolsKeyboard); + // Symbol keyboard has an ALT key that has a caps lock style indicator. To disable the + // indicator, we need to call enableShiftLock() and setShiftLocked(false). + symbolsKeyboard.enableShiftLock(); symbolsKeyboard.setShifted(false); symbolsKeyboard.setImeOptions(mContext.getResources(), mMode, mImeOptions); } |