Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit aa721c47 authored by Tadashi G. Takaoka's avatar Tadashi G. Takaoka
Browse files

Add "enabled" as an attribute of Key in Keyboard xml

If the key is marked as "enabled=false", the key will not respond to be pressed.

Bug: 3384942
Change-Id: I1ea82d9f3dfa5a9916ff3bbc736ea7e6c77426ae
parent b32f1b60
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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">
+2 −1
Original line number Diff line number Diff line
@@ -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;