diff options
| author | Jules Aguillon | 2023-03-05 20:08:56 +0100 |
|---|---|---|
| committer | Jules Aguillon | 2023-03-05 20:08:56 +0100 |
| commit | c56ad425f671d07e505cf0e63985abf8499635cc (patch) | |
| tree | dd42655dc3fb2b649ecb60ded5fbd741d6228d78 | |
| parent | a6fe5cae00c58365d3ca261783cc745006b2f117 (diff) | |
| download | unexpected-keyboard-c56ad425f671d07e505cf0e63985abf8499635cc.tar.gz unexpected-keyboard-c56ad425f671d07e505cf0e63985abf8499635cc.zip | |
Remove the 'edgekeys' attribute
| -rw-r--r-- | res/xml/bone.xml | 4 | ||||
| -rw-r--r-- | res/xml/bottom_row.xml | 4 | ||||
| -rw-r--r-- | res/xml/greekmath.xml | 2 | ||||
| -rw-r--r-- | res/xml/neo2.xml | 4 | ||||
| -rw-r--r-- | res/xml/numeric.xml | 2 | ||||
| -rw-r--r-- | res/xml/pin.xml | 2 | ||||
| -rw-r--r-- | srcs/juloo.keyboard2/KeyboardData.java | 33 |
7 files changed, 9 insertions, 42 deletions
diff --git a/res/xml/bone.xml b/res/xml/bone.xml index b6488ee..692ccb1 100644 --- a/res/xml/bone.xml +++ b/res/xml/bone.xml @@ -38,8 +38,8 @@ <row height="0.95"> <key width="1.8" key0="ctrl" key2="loc meta" key4="switch_numeric"/> <key width="1.2" key0="fn" key1="loc alt" key2="change_method" key3="switch_emoji" key4="config"/> - <key width="4.0" key0="space" key1="switch_second" key2="0" edgekeys="true"/> - <key width="1.2" key1="up" key2="right" key3="left" key4="down" edgekeys="true"/> + <key width="4.0" key0="space" key7="switch_second" key8="0"/> + <key width="1.2" key7="up" key6="right" key5="left" key8="down"/> <key width="1.8" key0="enter" key3="action"/> </row> </keyboard> diff --git a/res/xml/bottom_row.xml b/res/xml/bottom_row.xml index 6ad3d84..93ce287 100644 --- a/res/xml/bottom_row.xml +++ b/res/xml/bottom_row.xml @@ -2,7 +2,7 @@ <row height="0.95"> <key width="1.7" key0="ctrl" key1="loc switch_greekmath" key2="loc meta" key4="switch_numeric"/> <key width="1.1" key0="fn" key1="loc alt" key2="change_method" key3="switch_emoji" key4="config"/> - <key width="4.4" key0="space" key1="switch_second" key3="left" key2="right" edgekeys="true" slider="true"/> - <key width="1.1" key1="up" key2="right" key3="left" key4="down" edgekeys="true"/> + <key width="4.4" key0="space" key7="switch_second" key5="left" key6="right" slider="true"/> + <key width="1.1" key7="up" key6="right" key5="left" key8="down"/> <key width="1.7" key0="enter" key2="action"/> </row> diff --git a/res/xml/greekmath.xml b/res/xml/greekmath.xml index dd3ba3a..d6a98d9 100644 --- a/res/xml/greekmath.xml +++ b/res/xml/greekmath.xml @@ -41,7 +41,7 @@ <key width="1.2" key0="fn"/> <key width="2.8" key0="space" key1="superscript" key3="subscript"/> <key width="1.2" key0="0" key2="."/> - <key width="1.2" key1="up" key2="right" key3="left" key4="down" edgekeys="true"/> + <key width="1.2" key7="up" key6="right" key5="left" key8="down"/> <key width="1.2" key0="enter" key1="=" key2="action"/> </row> </keyboard> diff --git a/res/xml/neo2.xml b/res/xml/neo2.xml index 5bffb3c..c409fec 100644 --- a/res/xml/neo2.xml +++ b/res/xml/neo2.xml @@ -41,8 +41,8 @@ <row height="0.95"> <key width="1.8" key0="ctrl" key2="loc meta" key4="switch_numeric"/> <key width="1.2" key0="fn" key1="loc alt" key2="change_method" key3="switch_emoji" key4="config"/> - <key width="4.0" key0="space" key1="switch_second" edgekeys="true"/> - <key width="1.2" key1="up" key2="right" key3="left" key4="down" edgekeys="true"/> + <key width="4.0" key0="space" key7="switch_second"/> + <key width="1.2" key7="up" key6="right" key5="left" key8="down"/> <key key0="j" key4=";"/> <key width="1.8" key0="enter" key2="action"/> </row> diff --git a/res/xml/numeric.xml b/res/xml/numeric.xml index b64331e..8824773 100644 --- a/res/xml/numeric.xml +++ b/res/xml/numeric.xml @@ -13,7 +13,7 @@ <key width="0.75" key0="tab" key2="|" key4="\\"/> <key width="0.75" key0=")" key2="]" key4="}"/> <key key0="4" key1="box" key3="arrows"/> - <key key0="5" key1="up" key2="right" key3="left" key4="down" edgekeys="true"/> + <key key0="5" key7="up" key6="right" key5="left" key8="down"/> <key key0="6"/> <key width="0.75" key0="+" key1="Σ" key2="$"/> <key width="0.75" key0="-" key1="^"/> diff --git a/res/xml/pin.xml b/res/xml/pin.xml index 9a8f75d..8456a72 100644 --- a/res/xml/pin.xml +++ b/res/xml/pin.xml @@ -21,7 +21,7 @@ <row> <key shift="1.0" key0="*" key1="switch_text" key3="switch_numeric"/> <key key0="0" key3="+" key4="space"/> - <key key0="\#" key1="up" key2="right" key3="left" key4="down" edgekeys="true"/> + <key key0="\#" key7="up" key6="right" key5="left" key8="down"/> <key key0="enter" key2="action"/> </row> </keyboard> diff --git a/srcs/juloo.keyboard2/KeyboardData.java b/srcs/juloo.keyboard2/KeyboardData.java index aa215db..945e6ee 100644 --- a/srcs/juloo.keyboard2/KeyboardData.java +++ b/srcs/juloo.keyboard2/KeyboardData.java @@ -319,13 +319,10 @@ class KeyboardData ks[8] = Corner.parse_of_attr(parser, "key8"); float width = attribute_float(parser, "width", 1f); float shift = attribute_float(parser, "shift", 0.f); - boolean edgekeys = attribute_bool(parser, "edgekeys", false); boolean slider = attribute_bool(parser, "slider", false); String indication = parser.getAttributeValue(null, "indication"); while (parser.next() != XmlPullParser.END_TAG) continue ; - if (edgekeys) - ks = rearange_edgekeys(ks); return new Key(ks, width, shift, slider, indication); } @@ -375,36 +372,6 @@ class KeyboardData return false; return kv.equals(keys[i].kv); } - - /** Transform the key index for edgekeys. - * This option is no longer useful but is used by some layouts. - * 1 7 2 5 1 7 - * 5 0 6 → 3 0 2 - * 3 8 4 8 4 6 - */ - static Corner[] rearange_edgekeys(Corner[] ks) - { - Corner[] edge_ks = new Corner[ks.length]; - for (int i = 0; i < ks.length; i++) - edge_ks[edgekey_index(i)] = ks[i]; - return edge_ks; - } - - static int edgekey_index(int i) - { - switch (i) - { - case 5: return 1; - case 1: return 7; - case 7: return 2; - case 3: return 5; - case 2: return 6; - case 8: return 3; - case 4: return 8; - case 6: return 4; - default: return i; - } - } } public static final class Corner |
