aboutsummaryrefslogtreecommitdiffstats
path: root/java/src
diff options
context:
space:
mode:
authorTadashi G. Takaoka <takaoka@google.com>2010-11-22 22:54:34 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2010-11-22 22:54:34 -0800
commitcc359dddb398f26c412e26906fc120ed5cbf28d7 (patch)
tree55157fb06169fee4e456ee5b52fbdd73676a7c3b /java/src
parent0b60f831922b9341a7ef5d2eba87aa91580d371f (diff)
parent0d0a46da0393c6dd73cccf5e22cb0dd70c99e15a (diff)
downloadlatinime-cc359dddb398f26c412e26906fc120ed5cbf28d7.tar.gz
latinime-cc359dddb398f26c412e26906fc120ed5cbf28d7.tar.xz
latinime-cc359dddb398f26c412e26906fc120ed5cbf28d7.zip
Merge "Fix caps lock release in non-distinct multi touch device"
Diffstat (limited to 'java/src')
-rw-r--r--java/src/com/android/inputmethod/latin/KeyboardSwitcher.java19
1 files changed, 17 insertions, 2 deletions
diff --git a/java/src/com/android/inputmethod/latin/KeyboardSwitcher.java b/java/src/com/android/inputmethod/latin/KeyboardSwitcher.java
index 08ff41b6f..f1f8dc27d 100644
--- a/java/src/com/android/inputmethod/latin/KeyboardSwitcher.java
+++ b/java/src/com/android/inputmethod/latin/KeyboardSwitcher.java
@@ -412,8 +412,17 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha
private void setManualTemporaryUpperCase(boolean shifted) {
LatinKeyboard latinKeyboard = getLatinKeyboard();
- if (latinKeyboard != null && latinKeyboard.setShifted(shifted)) {
- mInputView.invalidateAllKeys();
+ if (latinKeyboard != null) {
+ // On non-distinct multi touch panel device, we should also turn off the shift locked
+ // state when shift key is pressed to go to normal mode.
+ // On the other hand, on distinct multi touch panel device, turning off the shift locked
+ // state with shift key pressing is handled by onReleaseShift().
+ if (!hasDistinctMultitouch() && !shifted && latinKeyboard.isShiftLocked()) {
+ latinKeyboard.setShiftLocked(false);
+ }
+ if (latinKeyboard.setShifted(shifted)) {
+ mInputView.invalidateAllKeys();
+ }
}
}
@@ -424,6 +433,9 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha
}
}
+ /**
+ * Toggle keyboard shift state triggered by user touch event.
+ */
public void toggleShift() {
mInputMethodService.mHandler.cancelUpdateShiftState();
if (DEBUG_STATE)
@@ -463,6 +475,9 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha
}
}
+ /**
+ * Update keyboard shift state triggered by connected EditText status change.
+ */
public void updateShiftState() {
final ShiftKeyState shiftKeyState = mShiftKeyState;
if (DEBUG_STATE)