aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/LatinIME.java
diff options
context:
space:
mode:
authorTadashi G. Takaoka <takaoka@google.com>2010-11-13 00:16:34 -0800
committerTadashi G. Takaoka <takaoka@google.com>2010-11-18 19:32:59 -0800
commitf27364600c742509b48857e6b8f17312033e0dc7 (patch)
treea07e3d98753fac073d34a643957204beaadcd4c4 /java/src/com/android/inputmethod/latin/LatinIME.java
parent1d2d3228a393b3c562226936e3523eed4894def4 (diff)
downloadlatinime-f27364600c742509b48857e6b8f17312033e0dc7.tar.gz
latinime-f27364600c742509b48857e6b8f17312033e0dc7.tar.xz
latinime-f27364600c742509b48857e6b8f17312033e0dc7.zip
Implement both automatic and manual temporary upper cases
With this change, - Shift and Shift lock state of keyboard is maintained by LatinKeyboard.ShiftState. - Shift key state is maintained by ShiftKeyState object in KeyboardSwitcher. - LatinIME informs KeyboardSwitcher that shift key press, release and long press and KeyboardSwitcher determines which state LatinKeyboard and ShiftLeyState should be. Bug: 3193390 Change-Id: I948ef26fda512eb1cb0ebddc89d322c4f4f4d670
Diffstat (limited to 'java/src/com/android/inputmethod/latin/LatinIME.java')
-rw-r--r--java/src/com/android/inputmethod/latin/LatinIME.java10
1 files changed, 6 insertions, 4 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index 295a03be3..307021a37 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -1004,7 +1004,8 @@ public class LatinIME extends InputMethodService
return true;
}
// Enable shift key and DPAD to do selections
- if (mKeyboardSwitcher.isInputViewShown() && mKeyboardSwitcher.isShifted()) {
+ if (mKeyboardSwitcher.isInputViewShown()
+ && mKeyboardSwitcher.isShiftedOrShiftLocked()) {
event = new KeyEvent(event.getDownTime(), event.getEventTime(),
event.getAction(), event.getKeyCode(), event.getRepeatCount(),
event.getDeviceId(), event.getScanCode(),
@@ -1373,7 +1374,7 @@ public class LatinIME extends InputMethodService
}
}
KeyboardSwitcher switcher = mKeyboardSwitcher;
- if (switcher.isShifted()) {
+ if (switcher.isShiftedOrShiftLocked()) {
if (keyCodes == null || keyCodes[0] < Character.MIN_CODE_POINT
|| keyCodes[0] > Character.MAX_CODE_POINT) {
return;
@@ -1392,7 +1393,8 @@ public class LatinIME extends InputMethodService
}
}
if (mPredicting) {
- if (mComposing.length() == 0 && switcher.isAlphabetMode() && switcher.isShifted()) {
+ if (mComposing.length() == 0 && switcher.isAlphabetMode()
+ && switcher.isShiftedOrShiftLocked()) {
mWord.setFirstCharCapitalized(true);
}
mComposing.append((char) primaryCode);
@@ -1677,7 +1679,7 @@ public class LatinIME extends InputMethodService
final List<CharSequence> nBest = new ArrayList<CharSequence>();
KeyboardSwitcher switcher = mKeyboardSwitcher;
boolean capitalizeFirstWord = preferCapitalization()
- || (switcher.isAlphabetMode() && switcher.isShifted());
+ || (switcher.isAlphabetMode() && switcher.isShiftedOrShiftLocked());
for (String c : mVoiceResults.candidates) {
if (capitalizeFirstWord) {
c = Character.toUpperCase(c.charAt(0)) + c.substring(1, c.length());