aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/accessibility/KeyCodeDescriptionMapper.java
diff options
context:
space:
mode:
authorTadashi G. Takaoka <takaoka@google.com>2012-01-26 18:03:30 +0900
committerTadashi G. Takaoka <takaoka@google.com>2012-01-31 12:55:45 +0900
commitca2f051cc173acc3bce384ebfe08068564bc8e07 (patch)
treee6521ddbe372710fd703dac4574552e8b7e96e3c /java/src/com/android/inputmethod/accessibility/KeyCodeDescriptionMapper.java
parent3b0f2bf169c23ea94c5a0adb275ce41b5c34ea83 (diff)
downloadlatinime-ca2f051cc173acc3bce384ebfe08068564bc8e07.tar.gz
latinime-ca2f051cc173acc3bce384ebfe08068564bc8e07.tar.xz
latinime-ca2f051cc173acc3bce384ebfe08068564bc8e07.zip
Auto generate various shift states alphabet keyboard automatically
If any shift state variants of alphabet keyboard layout is not specified in KeyboardSet.Element, it will be automatically generated from base alphabet keyboard definition. This change also * Eliminates KeyboardShiftState object from Keyboard. * Removes various set shift state methods from Keyboard. * Removes KeyboardSet.Element.elementAutoGenerate attribute. * Separates "sticky" Key.backgroundType to "stickyOff" and "stickyOn" * Add preserveCase flag to smiley, .com, and labeled special keys. * Rename KeyboardShiftState class to AlphabetShiftState. * Rename some attributes from *UppercaseLetter* to *ShiftedLetterHint*. * Introduce shiftedLetterActivated to Key.keyLabelFlags Change-Id: I01a0a8efeeaa76820ae728a5bdfa8d02b6ce74b7
Diffstat (limited to 'java/src/com/android/inputmethod/accessibility/KeyCodeDescriptionMapper.java')
-rw-r--r--java/src/com/android/inputmethod/accessibility/KeyCodeDescriptionMapper.java21
1 files changed, 1 insertions, 20 deletions
diff --git a/java/src/com/android/inputmethod/accessibility/KeyCodeDescriptionMapper.java b/java/src/com/android/inputmethod/accessibility/KeyCodeDescriptionMapper.java
index efaf58fc2..3b4149d7f 100644
--- a/java/src/com/android/inputmethod/accessibility/KeyCodeDescriptionMapper.java
+++ b/java/src/com/android/inputmethod/accessibility/KeyCodeDescriptionMapper.java
@@ -176,25 +176,6 @@ public class KeyCodeDescriptionMapper {
}
/**
- * Returns the keycode for the specified key given the current keyboard
- * state.
- *
- * @param keyboard The keyboard on which the key resides.
- * @param key The key from which to obtain a key code.
- * @return the key code for the specified key
- */
- private int getCorrectKeyCode(Keyboard keyboard, Key key) {
- // If keyboard is in manual temporary upper case state and key has
- // manual temporary uppercase letter as key hint letter, alternate
- // character code should be sent.
- if (keyboard.isManualTemporaryUpperCase() && key.hasUppercaseLetter()
- && !TextUtils.isEmpty(key.mHintLabel)) {
- return key.mHintLabel.charAt(0);
- }
- return key.mCode;
- }
-
- /**
* Returns a localized character sequence describing what will happen when
* the specified key is pressed based on its key code.
* <p>
@@ -217,7 +198,7 @@ public class KeyCodeDescriptionMapper {
*/
private CharSequence getDescriptionForKeyCode(Context context, Keyboard keyboard, Key key,
boolean shouldObscure) {
- final int code = getCorrectKeyCode(keyboard, key);
+ final int code = key.mCode;
if (keyboard.isShiftLocked() && mShiftLockedKeyCodeMap.containsKey(code)) {
return context.getString(mShiftLockedKeyCodeMap.get(code));