aboutsummaryrefslogtreecommitdiffstats
path: root/java
diff options
context:
space:
mode:
Diffstat (limited to 'java')
-rw-r--r--java/res/values/attrs.xml2
-rw-r--r--java/src/com/android/inputmethod/keyboard/Key.java3
2 files changed, 4 insertions, 1 deletions
diff --git a/java/res/values/attrs.xml b/java/res/values/attrs.xml
index 9759e0eb6..b6d5fdc62 100644
--- a/java/res/values/attrs.xml
+++ b/java/res/values/attrs.xml
@@ -140,6 +140,8 @@
<attr name="keyStyle" format="string" />
<!-- Shift key icon for shifted state -->
<attr name="shiftedIcon" format="reference" />
+ <!-- The key is enabled and responds on press. -->
+ <attr name="enabled" format="boolean" />
</declare-styleable>
<declare-styleable name="Keyboard_Row">
diff --git a/java/src/com/android/inputmethod/keyboard/Key.java b/java/src/com/android/inputmethod/keyboard/Key.java
index 23886ad97..7396f0518 100644
--- a/java/src/com/android/inputmethod/keyboard/Key.java
+++ b/java/src/com/android/inputmethod/keyboard/Key.java
@@ -95,7 +95,7 @@ public class Key {
public boolean mPressed;
/** If this is a sticky key, is it on? */
public boolean mOn;
- /** Key is enabled or not. */
+ /** Key is enabled and responds on press */
public boolean mEnabled = true;
private final static int[] KEY_STATE_NORMAL_ON = {
@@ -226,6 +226,7 @@ public class Key {
mRepeatable = style.getBoolean(keyAttr, R.styleable.Keyboard_Key_isRepeatable, false);
mModifier = style.getBoolean(keyAttr, R.styleable.Keyboard_Key_isModifier, false);
mSticky = style.getBoolean(keyAttr, R.styleable.Keyboard_Key_isSticky, false);
+ mEnabled = style.getBoolean(keyAttr, R.styleable.Keyboard_Key_enabled, true);
mEdgeFlags = style.getFlag(keyAttr, R.styleable.Keyboard_Key_keyEdgeFlags, 0)
| row.mRowEdgeFlags;