summaryrefslogtreecommitdiff
path: root/java/src/com/android/inputmethod/keyboard/Key.java
diff options
context:
space:
mode:
authorTadashi G. Takaoka <takaoka@google.com>2011-11-30 17:54:58 +0900
committerTadashi G. Takaoka <takaoka@google.com>2011-11-30 20:06:47 +0900
commit2013bab89ca2f82589f99d98d9cf3b41ea5aac65 (patch)
tree07f759fd0814c52163a02915aefe007f5d357b2a /java/src/com/android/inputmethod/keyboard/Key.java
parent70b8934f0e919b8a85067c6b5bc09471888cf666 (diff)
Add Key.altCode attribute
* Registering alternate code and while key is typing. * Showing press/release graphics of the key that has the above altenate code. * Showing press/release graphics of all shift keys. * Renaming Key.ignoreWhileTyping to Key.altCodeWhileTyping. Bug: 5639503 Change-Id: I67fb45bae76284a1f0deb6fd12ae5fb781d06cc3
Diffstat (limited to 'java/src/com/android/inputmethod/keyboard/Key.java')
-rw-r--r--java/src/com/android/inputmethod/keyboard/Key.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/java/src/com/android/inputmethod/keyboard/Key.java b/java/src/com/android/inputmethod/keyboard/Key.java
index 84f2be585..b2b68f0ad 100644
--- a/java/src/com/android/inputmethod/keyboard/Key.java
+++ b/java/src/com/android/inputmethod/keyboard/Key.java
@@ -46,6 +46,7 @@ public class Key {
* The key code (unicode or custom code) that this key generates.
*/
public final int mCode;
+ public final int mAltCode;
/** Label to display */
public final CharSequence mLabel;
@@ -108,7 +109,7 @@ public class Key {
private final int mActionFlags;
private static final int ACTION_FLAGS_IS_REPEATABLE = 0x01;
private static final int ACTION_FLAGS_NO_KEY_PREVIEW = 0x02;
- private static final int ACTION_FLAGS_IGNORE_WHILE_TYPING = 0x04;
+ private static final int ACTION_FLAGS_ALT_CODE_WHILE_TYPING = 0x04;
/** The current pressed state of this key */
private boolean mPressed;
@@ -191,6 +192,7 @@ public class Key {
mLabel = label;
mOutputText = outputText;
mCode = code;
+ mAltCode = Keyboard.CODE_DUMMY;
mIcon = icon;
// Horizontal gap is divided equally to both sides of the key.
mX = x + mHorizontalGap / 2;
@@ -290,6 +292,8 @@ public class Key {
} else {
mCode = Keyboard.CODE_DUMMY;
}
+ mAltCode = style.getInt(keyAttr,
+ R.styleable.Keyboard_Key_altCode, Keyboard.CODE_DUMMY);
keyAttr.recycle();
}
@@ -334,8 +338,8 @@ public class Key {
return (mActionFlags & ACTION_FLAGS_NO_KEY_PREVIEW) != 0;
}
- public boolean ignoreWhileTyping() {
- return (mActionFlags & ACTION_FLAGS_IGNORE_WHILE_TYPING) != 0;
+ public boolean altCodeWhileTyping() {
+ return (mActionFlags & ACTION_FLAGS_ALT_CODE_WHILE_TYPING) != 0;
}
public Typeface selectTypeface(Typeface defaultTypeface) {