No capitalization for inputs from the symbols keyboard. bug: 2220892

Change-Id: I832e855e8882c0ccbc48505acce5b605761cd93a
main
Ken Wakasa 2010-06-30 12:38:41 +09:00
parent f5d9b3d4e4
commit 40c86618c1
4 changed files with 22 additions and 2 deletions

View File

@ -1138,7 +1138,10 @@ public class LatinIME extends InputMethodService
|| keyCodes[0] > Character.MAX_CODE_POINT) {
return;
}
primaryCode = new String(keyCodes, 0, 1).toUpperCase().charAt(0);
primaryCode = keyCodes[0];
if (mKeyboardSwitcher.isAlphabetMode()) {
primaryCode = Character.toUpperCase(primaryCode);
}
}
if (mPredicting) {
if (mKeyboardSwitcher.getInputView().isShifted() && mComposing.length() == 0) {

View File

@ -274,6 +274,10 @@ public class LatinKeyboard extends Keyboard {
}
}
/* package */ boolean isAlphaKeyboard() {
return mIsAlphaKeyboard;
}
public void setExtension(int resId) {
mExtensionResId = resId;
}

View File

@ -590,7 +590,7 @@ public class LatinKeyboardBaseView extends View implements View.OnClickListener
dismissPopupKeyboard();
}
private CharSequence adjustCase(CharSequence label) {
protected CharSequence adjustCase(CharSequence label) {
if (mKeyboard.isShifted() && label != null && label.length() < 3
&& Character.isLowerCase(label.charAt(0))) {
label = label.toString().toUpperCase();

View File

@ -111,6 +111,19 @@ public class LatinKeyboardView extends LatinKeyboardBaseView {
}
}
@Override
protected CharSequence adjustCase(CharSequence label) {
Keyboard keyboard = getKeyboard();
if (keyboard.isShifted()
&& keyboard instanceof LatinKeyboard
&& ((LatinKeyboard) keyboard).isAlphaKeyboard()
&& label != null && label.length() < 3
&& Character.isLowerCase(label.charAt(0))) {
label = label.toString().toUpperCase();
}
return label;
}
/**
* This function checks to see if we need to handle any sudden jumps in the pointer location
* that could be due to a multi-touch being treated as a move by the firmware or hardware.