forked from extern/Unexpected-Keyboard
Remove the 'edgekeys' attribute
This commit is contained in:
parent
a6fe5cae00
commit
c56ad425f6
@ -38,8 +38,8 @@
|
|||||||
<row height="0.95">
|
<row height="0.95">
|
||||||
<key width="1.8" key0="ctrl" key2="loc meta" key4="switch_numeric"/>
|
<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="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="4.0" key0="space" key7="switch_second" key8="0"/>
|
||||||
<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.8" key0="enter" key3="action"/>
|
<key width="1.8" key0="enter" key3="action"/>
|
||||||
</row>
|
</row>
|
||||||
</keyboard>
|
</keyboard>
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<row height="0.95">
|
<row height="0.95">
|
||||||
<key width="1.7" key0="ctrl" key1="loc switch_greekmath" key2="loc meta" key4="switch_numeric"/>
|
<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="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="4.4" key0="space" key7="switch_second" key5="left" key6="right" slider="true"/>
|
||||||
<key width="1.1" key1="up" key2="right" key3="left" key4="down" edgekeys="true"/>
|
<key width="1.1" key7="up" key6="right" key5="left" key8="down"/>
|
||||||
<key width="1.7" key0="enter" key2="action"/>
|
<key width="1.7" key0="enter" key2="action"/>
|
||||||
</row>
|
</row>
|
||||||
|
@ -41,7 +41,7 @@
|
|||||||
<key width="1.2" key0="fn"/>
|
<key width="1.2" key0="fn"/>
|
||||||
<key width="2.8" key0="space" key1="superscript" key3="subscript"/>
|
<key width="2.8" key0="space" key1="superscript" key3="subscript"/>
|
||||||
<key width="1.2" key0="0" key2="."/>
|
<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"/>
|
<key width="1.2" key0="enter" key1="=" key2="action"/>
|
||||||
</row>
|
</row>
|
||||||
</keyboard>
|
</keyboard>
|
||||||
|
@ -41,8 +41,8 @@
|
|||||||
<row height="0.95">
|
<row height="0.95">
|
||||||
<key width="1.8" key0="ctrl" key2="loc meta" key4="switch_numeric"/>
|
<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="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="4.0" key0="space" key7="switch_second"/>
|
||||||
<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 key0="j" key4=";"/>
|
<key key0="j" key4=";"/>
|
||||||
<key width="1.8" key0="enter" key2="action"/>
|
<key width="1.8" key0="enter" key2="action"/>
|
||||||
</row>
|
</row>
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
<key width="0.75" key0="tab" key2="|" key4="\\"/>
|
<key width="0.75" key0="tab" key2="|" key4="\\"/>
|
||||||
<key width="0.75" key0=")" key2="]" key4="}"/>
|
<key width="0.75" key0=")" key2="]" key4="}"/>
|
||||||
<key key0="4" key1="box" key3="arrows"/>
|
<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 key0="6"/>
|
||||||
<key width="0.75" key0="+" key1="Σ" key2="$"/>
|
<key width="0.75" key0="+" key1="Σ" key2="$"/>
|
||||||
<key width="0.75" key0="-" key1="^"/>
|
<key width="0.75" key0="-" key1="^"/>
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
<row>
|
<row>
|
||||||
<key shift="1.0" key0="*" key1="switch_text" key3="switch_numeric"/>
|
<key shift="1.0" key0="*" key1="switch_text" key3="switch_numeric"/>
|
||||||
<key key0="0" key3="+" key4="space"/>
|
<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"/>
|
<key key0="enter" key2="action"/>
|
||||||
</row>
|
</row>
|
||||||
</keyboard>
|
</keyboard>
|
||||||
|
@ -319,13 +319,10 @@ class KeyboardData
|
|||||||
ks[8] = Corner.parse_of_attr(parser, "key8");
|
ks[8] = Corner.parse_of_attr(parser, "key8");
|
||||||
float width = attribute_float(parser, "width", 1f);
|
float width = attribute_float(parser, "width", 1f);
|
||||||
float shift = attribute_float(parser, "shift", 0.f);
|
float shift = attribute_float(parser, "shift", 0.f);
|
||||||
boolean edgekeys = attribute_bool(parser, "edgekeys", false);
|
|
||||||
boolean slider = attribute_bool(parser, "slider", false);
|
boolean slider = attribute_bool(parser, "slider", false);
|
||||||
String indication = parser.getAttributeValue(null, "indication");
|
String indication = parser.getAttributeValue(null, "indication");
|
||||||
while (parser.next() != XmlPullParser.END_TAG)
|
while (parser.next() != XmlPullParser.END_TAG)
|
||||||
continue ;
|
continue ;
|
||||||
if (edgekeys)
|
|
||||||
ks = rearange_edgekeys(ks);
|
|
||||||
return new Key(ks, width, shift, slider, indication);
|
return new Key(ks, width, shift, slider, indication);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -375,36 +372,6 @@ class KeyboardData
|
|||||||
return false;
|
return false;
|
||||||
return kv.equals(keys[i].kv);
|
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
|
public static final class Corner
|
||||||
|
Loading…
Reference in New Issue
Block a user