Skip to content

Commit

Permalink
Fix layouts containing empty keys
Browse files Browse the repository at this point in the history
This results in a key being the empty string and do not trigger an
error:

    key1="\"

Layouts are fixed and check_layout now checks for this case.
  • Loading branch information
Julow committed Jan 9, 2024
1 parent b319356 commit 329a35e
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
7 changes: 3 additions & 4 deletions check_layout.output
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Layout includes some ASCII punctuation but not all, missing: #, $, %, &, ', (, )
Layout doesn't define some important keys, missing: esc, f11_placeholder, f12_placeholder, tab
2 warnings
# deva_inscript
Duplicate keys: ,
Duplicate keys: ।
Layout includes some ASCII punctuation but not all, missing: ", $, ', ^, _, `, |
Layout doesn't define some important keys, missing: f11_placeholder, f12_placeholder
3 warnings
Expand Down Expand Up @@ -95,8 +95,7 @@ Layout doesn't define some important keys, missing: f11_placeholder, f12_placeho
# latn_qwerty_us
0 warnings
# latn_qwerty_vi
Layout includes some ASCII punctuation but not all, missing: \
1 warnings
0 warnings
# latn_qwertz
0 warnings
# latn_qwertz_cz
Expand All @@ -113,7 +112,7 @@ Layout doesn't define some important keys, missing: f11_placeholder, f12_placeho
# latn_qwertz_hu
0 warnings
# latn_qwertz_sk
Layout includes some ASCII punctuation but not all, missing: \, `
Layout includes some ASCII punctuation but not all, missing: `
Layout doesn't define some important keys, missing: f11_placeholder, f12_placeholder
2 warnings
# urdu_phonetic_ur
Expand Down
1 change: 1 addition & 0 deletions check_layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ def check_layout(layout):
[ "f1", "f2", "f3", "f4", "f5", "f6", "f7", "f8", "f9",
"f10", "f11", "f12" ],
"Layout contains function keys")
unexpected_keys(keys, [""], "Layout contains empty strings")

bottom_row_keys = [
"ctrl", "fn", "switch_numeric", "change_method", "switch_emoji",
Expand Down
4 changes: 2 additions & 2 deletions res/xml/deva_inscript.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
<key shift="0.1" key0="" key1="" key2="" key3="\#" key4="*"/>
<key key0="" key1="" key2="" key3="" key4="\@"/>
<key key0="" key1="" key2="" key3="" key4="%"/>
<key key0="" key1="" key2="" key3=":" key4="&amp;"/>
<key key0="" key1="" key2="" key3=";" key4="."/>
<key key0="" key2="" key3=":" key4="&amp;"/>
<key key0="" key2="" key3=";" key4="."/>
<key key0="" key1="" key2="" key3="!" key4=","/>
<key key0="" key1="" key2="" key3="\?" key4=""/>
<key shift="0.1" width="1.4" key0="backspace" key2="delete"/>
Expand Down
2 changes: 1 addition & 1 deletion res/xml/latn_qwerty_vi.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<key key0="h" key2="=" key3="+"/>
<key key0="j" key1="accent_dot_below" key3="{" key4="}"/>
<key key0="k" key3="[" key4="]"/>
<key key0="l" key2="|" key3="\"/>
<key key0="l" key2="|" key3="\\"/>
</row>
<row>
<key width="1.5" key0="shift" key2="loc capslock"/>
Expand Down
2 changes: 1 addition & 1 deletion res/xml/latn_qwertz_sk.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<key key0="u" key1="7" key2="ü" key3="ú" key4="ů"/>
<key key0="i" key1="8" key3="í"/>
<key key0="o" key1="9" key2="ö" key3="ó" key4="ô"/>
<key key0="p" key1="0" key2="=" key3="\" key4="/"/>
<key key0="p" key1="0" key2="=" key3="\\" key4="/"/>
</row>
<row>
<key key0="a" key1="tab" key3="á" key4="ä"/>
Expand Down

0 comments on commit 329a35e

Please sign in to comment.