Fix caps lock release in non-distinct multi touch device
Bug: 3221869 Change-Id: I7c5d407c465f22945cba37e42683345913b43accmain
parent
04448c2978
commit
0d0a46da03
|
@ -412,10 +412,19 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha
|
|||
|
||||
private void setManualTemporaryUpperCase(boolean shifted) {
|
||||
LatinKeyboard latinKeyboard = getLatinKeyboard();
|
||||
if (latinKeyboard != null && latinKeyboard.setShifted(shifted)) {
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void setShiftLocked(boolean shiftLocked) {
|
||||
LatinKeyboard latinKeyboard = getLatinKeyboard();
|
||||
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue