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

Commit c2f627a8 authored by Steve Kondik's avatar Steve Kondik
Browse files

input: Fix keymapping and handle www/com key.

The keymappings derived when setting up for Espresso were
incorrect and causing problems on other keyboards like Vision. Corrected
this, and also added handling for the www/com key on Vision.

Change-Id: I4303c60498469a24f5ce2b4397b6cf822ac81f67
parent 8c337cf7
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -106,6 +106,12 @@ public class QwertyKeyListener extends BaseKeyListener {
            return true;
        }

        if (i == KeyCharacterMap.DOT_WWW_INPUT || i == KeyCharacterMap.DOT_COM_INPUT) {
            content.replace(selStart, selEnd, selStart == 0 ? "www." : ".com");
            adjustMetaAfterKeypress(content);
            return true;
        }

        if (i == KeyCharacterMap.HEX_INPUT) {
            int start;

+11 −1
Original line number Diff line number Diff line
@@ -58,6 +58,16 @@ public class KeyCharacterMap
     */
    public static final char PICKER_DIALOG_INPUT = '\uEF01';

    /**
     * Private use character denoting a .com suffix
     */
    public static final char DOT_COM_INPUT = '\uEF03';

    /**
     * Private use character denoting a www. prefix
     */
    public static final char DOT_WWW_INPUT = '\uEF04';

    private static Object sLock = new Object();
    private static SparseArray<WeakReference<KeyCharacterMap>> sInstances
        = new SparseArray<WeakReference<KeyCharacterMap>>();
+5 −5
Original line number Diff line number Diff line
@@ -341,11 +341,11 @@ public class KeyEvent extends InputEvent implements Parcelable {
    public static final int KEYCODE_FUNC_7          = 98;
    public static final int KEYCODE_FUNC_8          = 99;
    public static final int KEYCODE_QUECHAR         = 100;
    public static final int KEYCODE_USER1           = 101;
    public static final int KEYCODE_USER2           = 102;
    public static final int KEYCODE_USER3           = 103;
    public static final int KEYCODE_USER4           = 104;
    public static final int KEYCODE_USER5           = 105;
    public static final int KEYCODE_USER1           = 92;
    public static final int KEYCODE_USER2           = 93;
    public static final int KEYCODE_USER3           = 94;
    public static final int KEYCODE_USER4           = 95;
    public static final int KEYCODE_USER5           = 96;

    // NOTE: If you add a new keycode here you must also add it to:
    //  isSystem()
+6 −6
Original line number Diff line number Diff line
@@ -934,7 +934,7 @@
        <enum name="KEYCODE_MEDIA_REWIND" value="89" />
        <enum name="KEYCODE_MEDIA_FAST_FORWARD" value="90" />
        <enum name="KEYCODE_MUTE" value="91" />
        <enum name="KEYCODE_PAGE_UP" value="92" />
        enum name="KEYCODE_PAGE_UP" value="92" />
        <enum name="KEYCODE_PAGE_DOWN" value="93" />
        <enum name="KEYCODE_PICTSYMBOLS" value="94" />
        <enum name="KEYCODE_SWITCH_CHARSET" value="95" />
@@ -962,11 +962,11 @@
        <enum name="KEYCODE_FUNC_7" value="98" />
        <enum name="KEYCODE_FUNC_8" value="99" />
        <enum name="KEYCODE_QUECHAR" value="100" />
        <enum name="KEYCODE_USER1" value="101" />
        <enum name="KEYCODE_USER2" value="102" />
        <enum name="KEYCODE_USER3" value="103" />
        <enum name="KEYCODE_USER4" value="104" />
        <enum name="KEYCODE_USER5" value="105" />
        <enum name="KEYCODE_USER1" value="92" />
        <enum name="KEYCODE_USER2" value="93" />
        <enum name="KEYCODE_USER3" value="94" />
        <enum name="KEYCODE_USER4" value="95" />
        <enum name="KEYCODE_USER5" value="96" />
    </attr>

    <!-- ***************************************************************** -->
+15 −14
Original line number Diff line number Diff line
@@ -135,20 +135,21 @@ static const KeycodeLabel KEYCODES[] = {
    { "BUTTON_START", 108 },
    { "BUTTON_SELECT", 109 },
    { "BUTTON_MODE", 110 },
    { "FUNC_1", 92 },
    { "FUNC_2", 93 },
    { "FUNC_3", 94 },
    { "FUNC_4", 95 },
    { "FUNC_5", 96 },
    { "FUNC_6", 97 },
    { "FUNC_7", 98 },
    { "FUNC_8", 99 },
    { "QUECHAR", 100 },
    { "USER1", 101 },
    { "USER2", 102 },
    { "USER3", 103 },
    { "USER4", 104 },
    { "USER5", 105 },
    { "USER1", 92 },
    { "USER2", 93 },
    { "USER3", 94 },
    { "USER4", 95 },
    { "USER5", 96 },
    { "FUNC_1", 97 },
    { "FUNC_2", 98 },
    { "FUNC_3", 99 },
    { "FUNC_4", 100 },
    { "FUNC_5", 101 },
    { "FUNC_6", 102 },
    { "FUNC_7", 103 },
    { "FUNC_8", 104 },
    { "QUECHAR", 105 },
    { "BTN_MOUSE", 106 },

    // NOTE: If you add a new keycode here you must also add it to several other files.
    //       Refer to frameworks/base/core/java/android/view/KeyEvent.java for the full list.