From ae9c2fa626309115d7cface25b656ecee5936fab Mon Sep 17 00:00:00 2001 From: Jules Aguillon Date: Tue, 4 Feb 2025 16:46:49 +0100 Subject: [PATCH] check_layout.py: Adjust Shift, Tab and Esc checks --- check_layout.output | 34 +++++++++++++++------------------- check_layout.py | 8 +++++--- 2 files changed, 20 insertions(+), 22 deletions(-) diff --git a/check_layout.output b/check_layout.output index b81c8b8..4950d2d 100644 --- a/check_layout.output +++ b/check_layout.output @@ -3,8 +3,7 @@ Layout includes some ASCII punctuation but not all, missing: !, ", ', +, -, /, : 1 warnings # arab_hamvaj_tly Layout includes some ASCII punctuation but not all, missing: ", %, ', ,, /, ;, <, =, >, ?, [, \, ], _, `, {, |, } -Layout doesn't define some important keys, missing: loc esc -2 warnings +1 warnings # arab_pc Layout includes some ASCII punctuation but not all, missing: !, ', +, ;, ?, \, | 1 warnings @@ -13,8 +12,7 @@ Layout includes some ASCII punctuation but not all, missing: ", %, ', +, ,, ;, < 1 warnings # arab_pc_ckb_fa Layout includes some ASCII punctuation but not all, missing: ", #, $, %, &, ', ,, /, ;, ?, @, \, ^, `, |, ~ -Layout doesn't define some important keys, missing: loc esc, loc tab -2 warnings +1 warnings # arab_pc_hindu Layout includes some ASCII punctuation but not all, missing: !, ', +, ;, ?, \, | 1 warnings @@ -45,18 +43,15 @@ Layout includes some ASCII punctuation but not all, missing: $, &, *, ., /, <, > Layout includes some ASCII punctuation but not all, missing: ~ 1 warnings # cyrl_yqukeng_tj -Layout doesn't define some important keys, missing: loc esc, loc tab These keys are now added automatically, unexpected: f11_placeholder, f12_placeholder -2 warnings +1 warnings # cyrl_yxukeng_os Layout includes some ASCII punctuation but not all, missing: ", #, $, &, ', @, [, ], ~ -Layout doesn't define some important keys, missing: loc esc, loc tab These keys are now added automatically, unexpected: f11_placeholder, f12_placeholder -3 warnings +2 warnings # deva_alt Layout includes some ASCII punctuation but not all, missing: #, $, %, &, ', (, ), +, ., /, :, <, =, >, [, \, ], ^, _, `, {, |, }, ~ -Layout doesn't define some important keys, missing: loc esc, loc tab -2 warnings +1 warnings # deva_inscript Duplicate keys: । Layout includes some ASCII punctuation but not all, missing: ", $, ', ^, _, `, | @@ -75,8 +70,7 @@ Duplicate keys: ; Duplicate keys: ટ, ડ 1 warnings # hang_dubeolsik_kr -Layout doesn't define some important keys, missing: loc esc, loc tab -1 warnings +0 warnings # hebr_1_il Layout includes some ASCII punctuation but not all, missing: (, ), <, >, [, ], {, } 1 warnings @@ -85,23 +79,25 @@ Layout includes some ASCII punctuation but not all, missing: (, ), <, >, [, ], { 1 warnings # kann_kannada Layout includes some ASCII punctuation but not all, missing: #, $, %, (, ), *, +, /, <, =, >, [, \, ], ^, `, {, |, }, ~ -Layout doesn't define some important keys, missing: loc esc, loc tab -2 warnings +1 warnings # latn_azerty_be 0 warnings # latn_azerty_fr 0 warnings # latn_bepo_fr -0 warnings +Missing important key, missing: loc capslock +1 warnings # latn_bone -Layout doesn't define some important keys, missing: loc esc, loc tab +Missing important key, missing: loc capslock +Missing programming keys, missing: loc esc, loc tab Layout redefines the bottom row but some important keys are missing, missing: cursor_left, cursor_right, loc compose, loc end, loc home, loc page_down, loc page_up, loc switch_clipboard, loc switch_greekmath, loc voice_typing, switch_backward -2 warnings +3 warnings # latn_colemak Some keys contain whitespaces, unexpected: ́ 1 warnings # latn_dvorak -0 warnings +Missing important key, missing: loc capslock +1 warnings # latn_neo2 Layout redefines the bottom row but some important keys are missing, missing: loc switch_clipboard 1 warnings @@ -152,7 +148,7 @@ Duplicate keys: !, ', ,, -, ., ? 0 warnings # latn_qwerty_tly Duplicate keys: a, c, j, q -Layout doesn't define some important keys, missing: loc esc, loc tab +Missing programming keys, missing: loc esc, loc tab 2 warnings # latn_qwerty_tr 0 warnings diff --git a/check_layout.py b/check_layout.py index dc4644a..500b10b 100644 --- a/check_layout.py +++ b/check_layout.py @@ -73,9 +73,7 @@ def check_layout(layout): if len(dup) > 0: warn("Duplicate keys: " + key_list_str(dup)) missing_some_of(keys, "~!@#$%^&*(){}`[]=\\-_;:/.,?<>'\"+|", "ASCII punctuation") missing_some_of(keys, "0123456789", "digits") - missing_required(keys, - ["loc esc", "loc tab", "backspace", "delete"], - "Layout doesn't define some important keys") + missing_required(keys, ["backspace", "delete"], "Layout doesn't define some important keys") unexpected_keys(keys, ["copy", "paste", "cut", "selectAll", "shareText", "pasteAsPlainText", "undo", "redo" ], @@ -89,6 +87,10 @@ def check_layout(layout): unexpected_keys(keys, filter(lambda k: k.strip()!=k, keys), "Some keys contain whitespaces") unexpected_keys(keys, ["f11_placeholder", "f12_placeholder"], "These keys are now added automatically") + if root.get("script", "latin") == "latin": + missing_required(keys, ["shift", "loc capslock"], "Missing important key") + missing_required(keys, ["loc esc", "loc tab"], "Missing programming keys") + _, bottom_row_keys, _ = parse_row("res/xml/bottom_row.xml") if root.get("bottom_row") == "false":