diff options
author | 2010-11-16 01:47:39 -0800 | |
---|---|---|
committer | 2010-11-16 01:47:39 -0800 | |
commit | 889691eca1ad991a85fb721deb37ecba6a913762 (patch) | |
tree | 04c3c38ff7b58adf6b83f4af759725d7bb80d1e6 /java/src/com/android/inputmethod/latin/KeyboardSwitcher.java | |
parent | d7641636db8fe91d9847ac79f5f431963e876ec3 (diff) | |
download | latinime-889691eca1ad991a85fb721deb37ecba6a913762.tar.gz latinime-889691eca1ad991a85fb721deb37ecba6a913762.tar.xz latinime-889691eca1ad991a85fb721deb37ecba6a913762.zip |
Refactor shift key state into KeyboardSwitcher
Change-Id: If484d3d7e7a0794ee7fc88f0771229d6f90db466
Diffstat (limited to 'java/src/com/android/inputmethod/latin/KeyboardSwitcher.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/KeyboardSwitcher.java | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/java/src/com/android/inputmethod/latin/KeyboardSwitcher.java b/java/src/com/android/inputmethod/latin/KeyboardSwitcher.java index fdcf0ad4e..fce0e34fe 100644 --- a/java/src/com/android/inputmethod/latin/KeyboardSwitcher.java +++ b/java/src/com/android/inputmethod/latin/KeyboardSwitcher.java @@ -75,7 +75,9 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha private final LatinIME mInputMethodService; private final LanguageSwitcher mLanguageSwitcher; + private ShiftKeyState mShiftState = new ShiftKeyState(); private ModifierKeyState mSymbolKeyState = new ModifierKeyState(); + private KeyboardId mSymbolsId; private KeyboardId mSymbolsShiftedId; @@ -383,6 +385,30 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha mInputView.setShiftLocked(shiftLocked); } + public void onPressShift() { + mShiftState.onPress(); + } + + public void onPressShiftOnShifted() { + mShiftState.onPressOnShifted(); + } + + public void onReleaseShift() { + mShiftState.onRelease(); + } + + public boolean isShiftMomentary() { + return mShiftState.isMomentary(); + } + + public boolean isShiftPressingOnShifted() { + return mShiftState.isPressingOnShifted(); + } + + public boolean isShiftIgnoring() { + return mShiftState.isIgnoring(); + } + public void onPressSymbol() { mSymbolKeyState.onPress(); } @@ -396,7 +422,7 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha } public void onOtherKeyPressed() { - // TODO: shift key state will be handled too. + mShiftState.onOtherKeyPressed(); mSymbolKeyState.onOtherKeyPressed(); } |