fix some issues with layouts

compare old and new parsing when debug mode is on
This commit is contained in:
Helium314 2023-12-01 00:08:54 +01:00
parent 6fc558962f
commit cbb1798dc1
14 changed files with 188 additions and 126 deletions

View file

@ -1,7 +1,7 @@
[ [
[ [
{ "$": "shift_state_selector", { "$": "shift_state_selector",
"manualOrLocked": { "label": "q" }, "manualOrLocked": { "label": "Q" },
"default": { "label": "ქ" } "default": { "label": "ქ" }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
@ -9,7 +9,7 @@
"default": { "label": "წ" } "default": { "label": "წ" }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
"manualOrLocked": { "label": "e" }, "manualOrLocked": { "label": "E" },
"default": { "label": "ე" } "default": { "label": "ე" }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
@ -21,29 +21,29 @@
"default": { "label": "ტ" } "default": { "label": "ტ" }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
"manualOrLocked": { "label": "y" }, "manualOrLocked": { "label": "Y" },
"default": { "label": "" } "default": { "label": "" }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
"manualOrLocked": { "label": "u" }, "manualOrLocked": { "label": "U" },
"default": { "label": "უ" } "default": { "label": "უ" }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
"manualOrLocked": { "label": "i" }, "manualOrLocked": { "label": "I" },
"default": { "label": "ი" } "default": { "label": "ი" }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
"manualOrLocked": { "label": "o" }, "manualOrLocked": { "label": "O" },
"default": { "label": "ო" } "default": { "label": "ო" }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
"manualOrLocked": { "label": "p" }, "manualOrLocked": { "label": "P" },
"default": { "label": "პ" } "default": { "label": "პ" }
} }
], ],
[ [
{ "$": "shift_state_selector", { "$": "shift_state_selector",
"manualOrLocked": { "label": "a" }, "manualOrLocked": { "label": "A" },
"default": { "label": "ა" } "default": { "label": "ა" }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
@ -51,19 +51,19 @@
"default": { "label": "ს" } "default": { "label": "ს" }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
"manualOrLocked": { "label": "d" }, "manualOrLocked": { "label": "D" },
"default": { "label": "დ" } "default": { "label": "დ" }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
"manualOrLocked": { "label": "f" }, "manualOrLocked": { "label": "F" },
"default": { "label": "ფ" } "default": { "label": "ფ" }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
"manualOrLocked": { "label": "g" }, "manualOrLocked": { "label": "G" },
"default": { "label": "გ" } "default": { "label": "გ" }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
"manualOrLocked": { "label": "h" }, "manualOrLocked": { "label": "H" },
"default": { "label": "ჰ" } "default": { "label": "ჰ" }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
@ -71,11 +71,11 @@
"default": { "label": "ჯ" } "default": { "label": "ჯ" }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
"manualOrLocked": { "label": "k" }, "manualOrLocked": { "label": "K" },
"default": { "label": "კ" } "default": { "label": "კ" }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
"manualOrLocked": { "label": "l" }, "manualOrLocked": { "label": "L" },
"default": { "label": "ლ" } "default": { "label": "ლ" }
} }
], ],
@ -85,7 +85,7 @@
"default": { "label": "ზ" } "default": { "label": "ზ" }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
"manualOrLocked": { "label": "x" }, "manualOrLocked": { "label": "X" },
"default": { "label": "ხ" } "default": { "label": "ხ" }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
@ -93,19 +93,19 @@
"default": { "label": "ც" } "default": { "label": "ც" }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
"manualOrLocked": { "label": "v" }, "manualOrLocked": { "label": "V" },
"default": { "label": "ვ" } "default": { "label": "ვ" }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
"manualOrLocked": { "label": "b" }, "manualOrLocked": { "label": "B" },
"default": { "label": "ბ" } "default": { "label": "ბ" }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
"manualOrLocked": { "label": "n" }, "manualOrLocked": { "label": "N" },
"default": { "label": "ნ" } "default": { "label": "ნ" }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
"manualOrLocked": { "label": "m" }, "manualOrLocked": { "label": "M" },
"default": { "label": "მ" } "default": { "label": "მ" }
} }
] ]

View file

@ -32,4 +32,3 @@

View file

@ -101,7 +101,7 @@
], ],
[ [
{ "$": "shift_state_selector", { "$": "shift_state_selector",
"manualOrLocked": { "label": "ាំ" }, "manualOrLocked": { "label": "ាំ", "labelFlags": 128 },
"default": { "label": "ា" } "default": { "label": "ា" }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
@ -137,7 +137,7 @@
"default": { "label": "ល" } "default": { "label": "ល" }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
"manualOrLocked": { "label": "ោះ" }, "manualOrLocked": { "label": "ោះ", "labelFlags": 49280 },
"default": { "label": "ើ" } "default": { "label": "ើ" }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
@ -163,7 +163,7 @@
"default": { "label": "ច" } "default": { "label": "ច" }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
"manualOrLocked": { "label": "េះ" }, "manualOrLocked": { "label": "េះ", "labelFlags": 128 },
"default": { "label": "វ" } "default": { "label": "វ" }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
@ -179,15 +179,15 @@
"default": { "label": "ម" } "default": { "label": "ម" }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
"manualOrLocked": { "label": "ុះ" }, "manualOrLocked": { "label": "ុះ", "labelFlags": 128 },
"default": { "label": "ុំ" } "default": { "label": "ុំ", "labelFlags": 128 }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
"manualOrLocked": { "label": "៕" }, "manualOrLocked": { "label": "៕" },
"default": { "label": "។" } "default": { "label": "។" }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
"manualOrLocked": { "label": "\?" }, "manualOrLocked": { "label": "\\?" },
"default": { "label": "៊" } "default": { "label": "៊" }
} }
] ]

View file

@ -155,8 +155,8 @@
"default": { "label": "\u1112", "popup": { "main": { "label": "\u0032" } } } "default": { "label": "\u1112", "popup": { "main": { "label": "\u0032" } } }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
"manualOrLocked": { "label": "\u0032", "popup": { "main": { "label": "\u0022" } } }, "manualOrLocked": { "label": "\u0033", "popup": { "main": { "label": "\u0022" } } },
"default": { "label": "\u1110", "popup": { "relevant": [{ "label": "\u0032" }, { "label": "\u0022" }] } } "default": { "label": "\u1110", "popup": { "relevant": [{ "label": "\u0033" }, { "label": "\u0022" }] } }
} }
] ]
] ]

View file

@ -113,16 +113,16 @@
"default": { "label": "\u110b", "popup": { "main": { "label": "\u0031" } } } "default": { "label": "\u110b", "popup": { "main": { "label": "\u0031" } } }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
"manualOrLocked": { "label": "\u0031" }, "manualOrLocked": { "label": "\u0032" },
"default": { "label": "\u1100", "popup": { "main": { "label": "\u0031" } } } "default": { "label": "\u1100", "popup": { "main": { "label": "\u0032" } } }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
"manualOrLocked": { "label": "\u0033" }, "manualOrLocked": { "label": "\u0033" },
"default": { "label": "\u110c", "popup": { "main": { "label": "\u0033" } } } "default": { "label": "\u110c", "popup": { "main": { "label": "\u0033" } } }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
"manualOrLocked": { "label": "\u0033" }, "manualOrLocked": { "label": "\u0034" },
"default": { "label": "\u1107", "popup": { "main": { "label": "\u0033" } } } "default": { "label": "\u1107", "popup": { "main": { "label": "\u0034" } } }
} }
], ],
[ [

View file

@ -45,13 +45,13 @@
"default": { "label": "ຊ" } "default": { "label": "ຊ" }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
"manualOrLocked": { "label": "ໍ່" }, "manualOrLocked": { "label": "ໍ່", "labelFlags": 128 },
"default": { "label": "ໍ" } "default": { "label": "ໍ" }
} }
], ],
[ [
{ "$": "shift_state_selector", { "$": "shift_state_selector",
"manualOrLocked": { "label": "ົ້" }, "manualOrLocked": { "label": "ົ້", "labelFlags": 128 },
"default": { "label": "ົ" } "default": { "label": "ົ" }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
@ -59,23 +59,23 @@
"default": { "label": "ໄ" } "default": { "label": "ໄ" }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
"manualOrLocked": { "label": "ຳ້" }, "manualOrLocked": { "label": "ຳ້", "labelFlags": 128 },
"default": { "label": "ຳ" } "default": { "label": "ຳ" }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
"manualOrLocked": { "label": "_" }, "manualOrLocked": { "label": "_", "labelFlags": 48 },
"default": { "label": "ພ" } "default": { "label": "ພ" }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
"manualOrLocked": { "label": "+" }, "manualOrLocked": { "label": "+", "labelFlags": 48 },
"default": { "label": "ະ" } "default": { "label": "ະ" }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
"manualOrLocked": { "label": "ິ້" }, "manualOrLocked": { "label": "ິ້", "labelFlags": 128 },
"default": { "label": "ິ" } "default": { "label": "ິ" }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
"manualOrLocked": { "label": "ີ້" }, "manualOrLocked": { "label": "ີ້", "labelFlags": 128 },
"default": { "label": "ີ" } "default": { "label": "ີ" }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
@ -91,33 +91,33 @@
"default": { "label": "ຍ" } "default": { "label": "ຍ" }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
"manualOrLocked": { "label": "ຫຼ" }, "manualOrLocked": { "label": "ຫຼ", "labelFlags": 128 },
"default": { "label": "ບ" } "default": { "label": "ບ" }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
"manualOrLocked": { "label": "”" }, "manualOrLocked": { "label": "”", "labelFlags": 48 },
"default": { "label": "ລ" } "default": { "label": "ລ" }
} }
], ],
[ [
{ "$": "shift_state_selector", { "$": "shift_state_selector",
"manualOrLocked": { "label": "ັ້" }, "manualOrLocked": { "label": "ັ້", "labelFlags": 128 },
"default": { "label": "ັ" } "default": { "label": "ັ" }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
"manualOrLocked": { "label": ";" }, "manualOrLocked": { "label": ";", "labelFlags": 48 },
"default": { "label": "ຫ" } "default": { "label": "ຫ" }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
"manualOrLocked": { "label": "." }, "manualOrLocked": { "label": ".", "labelFlags": 48 },
"default": { "label": "ກ" } "default": { "label": "ກ" }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
"manualOrLocked": { "label": "," }, "manualOrLocked": { "label": ",", "labelFlags": 48 },
"default": { "label": "ດ" } "default": { "label": "ດ" }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
"manualOrLocked": { "label": ":" }, "manualOrLocked": { "label": ":", "labelFlags": 48 },
"default": { "label": "ເ" } "default": { "label": "ເ" }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
@ -129,33 +129,33 @@
"default": { "label": "່" } "default": { "label": "່" }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
"manualOrLocked": { "label": "!" }, "manualOrLocked": { "label": "!", "labelFlags": 48 },
"default": { "label": "າ" } "default": { "label": "າ" }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
"manualOrLocked": { "label": "\?" }, "manualOrLocked": { "label": "\\?", "labelFlags": 48 },
"default": { "label": "ສ" } "default": { "label": "ສ" }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
"manualOrLocked": { "label": "%" }, "manualOrLocked": { "label": "%", "labelFlags": 48 },
"default": { "label": "ວ" } "default": { "label": "ວ" }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
"manualOrLocked": { "label": "=" }, "manualOrLocked": { "label": "=", "labelFlags": 48 },
"default": { "label": "ງ" } "default": { "label": "ງ" }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
"manualOrLocked": { "label": "“" }, "manualOrLocked": { "label": "“", "labelFlags": 48 },
"default": { "label": "“" } "default": { "label": "“", "labelFlags": 48 }
} }
], ],
[ [
{ "$": "shift_state_selector", { "$": "shift_state_selector",
"manualOrLocked": { "label": "₭" }, "manualOrLocked": { "label": "₭", "labelFlags": 48 },
"default": { "label": "ຜ" } "default": { "label": "ຜ" }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
"manualOrLocked": { "label": "(" }, "manualOrLocked": { "label": "(", "labelFlags": 48 },
"default": { "label": "ປ" } "default": { "label": "ປ" }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
@ -163,15 +163,15 @@
"default": { "label": "ແ" } "default": { "label": "ແ" }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
"manualOrLocked": { "label": "\@" }, "manualOrLocked": { "label": "\\@", "labelFlags": 48 },
"default": { "label": "ອ" } "default": { "label": "ອ" }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
"manualOrLocked": { "label": "ຶ້" }, "manualOrLocked": { "label": "ຶ້", "labelFlags": 128 },
"default": { "label": "ຶ" } "default": { "label": "ຶ" }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
"manualOrLocked": { "label": "ື້" }, "manualOrLocked": { "label": "ື້", "labelFlags": 128 },
"default": { "label": "ື" } "default": { "label": "ື" }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
@ -183,11 +183,11 @@
"default": { "label": "ມ" } "default": { "label": "ມ" }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
"manualOrLocked": { "label": "$" }, "manualOrLocked": { "label": "$", "labelFlags": 48 },
"default": { "label": "ໃ" } "default": { "label": "ໃ" }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
"manualOrLocked": { "label": ")" }, "manualOrLocked": { "label": ")", "labelFlags": 48 },
"default": { "label": "ຝ" } "default": { "label": "ຝ" }
} }
] ]

View file

@ -1,11 +1,11 @@
[ [
[ [
{ "$": "shift_state_selector", { "$": "shift_state_selector",
"manualOrLocked": { "label": "त्त" }, "manualOrLocked": { "label": "त्त", "labelFlags": 128 },
"default": { "label": "ट" } "default": { "label": "ट" }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
"manualOrLocked": { "label": "ड्ढ" }, "manualOrLocked": { "label": "ड्ढ", "labelFlags": 128 },
"default": { "label": "ध" } "default": { "label": "ध" }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
@ -13,15 +13,15 @@
"default": { "label": "भ" } "default": { "label": "भ" }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
"manualOrLocked": { "label": "द्व" }, "manualOrLocked": { "label": "द्व", "labelFlags": 128 },
"default": { "label": "च" } "default": { "label": "च" }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
"manualOrLocked": { "label": "ट्ट" }, "manualOrLocked": { "label": "ट्ट", "labelFlags": 128 },
"default": { "label": "त" } "default": { "label": "त" }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
"manualOrLocked": { "label": "ठ्ठ" }, "manualOrLocked": { "label": "ठ्ठ", "labelFlags": 128 },
"default": { "label": "थ" } "default": { "label": "थ" }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
@ -29,7 +29,7 @@
"default": { "label": "ग" } "default": { "label": "ग" }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
"manualOrLocked": { "label": "क्ष" }, "manualOrLocked": { "label": "क्ष", "labelFlags": 128 },
"default": { "label": "ष" } "default": { "label": "ष" }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
@ -51,11 +51,11 @@
"default": { "label": "ब" } "default": { "label": "ब" }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
"manualOrLocked": { "label": "ङ्" }, "manualOrLocked": { "label": "ङ्", "labelFlags": 128 },
"default": { "label": "क" } "default": { "label": "क" }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
"manualOrLocked": { "label": "ड्ड" }, "manualOrLocked": { "label": "ड्ड", "labelFlags": 128 },
"default": { "label": "म" } "default": { "label": "म" }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
@ -63,7 +63,7 @@
"default": { "label": "ा" } "default": { "label": "ा" }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
"manualOrLocked": { "label": "द्द" }, "manualOrLocked": { "label": "द्द", "labelFlags": 128 },
"default": { "label": "न" } "default": { "label": "न" }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
@ -83,7 +83,7 @@
"default": { "label": "ि" } "default": { "label": "ि" }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
"manualOrLocked": { "label": "ट्ठ" }, "manualOrLocked": { "label": "ट्ठ", "labelFlags": 128 },
"default": { "label": "स" } "default": { "label": "स" }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
@ -93,11 +93,11 @@
], ],
[ [
{ "$": "shift_state_selector", { "$": "shift_state_selector",
"manualOrLocked": { "label": "क्" }, "manualOrLocked": { "label": "क्", "labelFlags": 128 },
"default": { "label": "श" } "default": { "label": "श" }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
"manualOrLocked": { "label": "ह्म" }, "manualOrLocked": { "label": "ह्म", "labelFlags": 128 },
"default": { "label": "ह" } "default": { "label": "ह" }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
@ -113,7 +113,7 @@
"default": { "label": "द" } "default": { "label": "द" }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
"manualOrLocked": { "label": "द्य" }, "manualOrLocked": { "label": "द्य", "labelFlags": 128 },
"default": { "label": "ल" } "default": { "label": "ल" }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",

View file

@ -1,16 +1,16 @@
[ [
[ [
{ "$": "shift_state_selector", { "$": "shift_state_selector",
"manualOrLocked": { "label": "+" }, "manualOrLocked": { "label": "+", "labelFlags": 48 },
"default": { "label": "ๅ" } "default": { "label": "ๅ" }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
"manualOrLocked": { "label": "๑" }, "manualOrLocked": { "label": "๑" },
"default": { "label": "/" } "default": { "label": "/", "labelFlags": 48 }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
"manualOrLocked": { "label": "๒" }, "manualOrLocked": { "label": "๒" },
"default": { "label": "_" } "default": { "label": "_", "labelFlags": 48 }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
"manualOrLocked": { "label": "๓" }, "manualOrLocked": { "label": "๓" },
@ -21,12 +21,12 @@
"default": { "label": "ถ" } "default": { "label": "ถ" }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
"manualOrLocked": { "label": " ู|ู" }, "manualOrLocked": { "label": " ู|ู", "labelFlags": 128 },
"default": { "label": " ุ|ุ" } "default": { "label": " ุ|ุ", "labelFlags": 128 }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
"manualOrLocked": { "label": "฿" }, "manualOrLocked": { "label": "฿" },
"default": { "label": " ึ|ึ" } "default": { "label": " ึ|ึ", "labelFlags": 128 }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
"manualOrLocked": { "label": "๕" }, "manualOrLocked": { "label": "๕" },
@ -55,7 +55,7 @@
"default": { "label": "ๆ" } "default": { "label": "ๆ" }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
"manualOrLocked": { "label": "\"" }, "manualOrLocked": { "label": "\"", "labelFlags": 48 },
"default": { "label": "ไ" } "default": { "label": "ไ" }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
@ -71,12 +71,12 @@
"default": { "label": "ะ" } "default": { "label": "ะ" }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
"manualOrLocked": { "label": " ํ|ํ" }, "manualOrLocked": { "label": " ํ|ํ", "labelFlags": 128 },
"default": { "label": " ั|ั" } "default": { "label": " ั|ั", "labelFlags": 128 }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
"manualOrLocked": { "label": " ๊|๊" }, "manualOrLocked": { "label": " ๊|๊", "labelFlags": 128 },
"default": { "label": " ี|ี" } "default": { "label": " ี|ี", "labelFlags": 128 }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
"manualOrLocked": { "label": "ณ" }, "manualOrLocked": { "label": "ณ" },
@ -95,7 +95,7 @@
"default": { "label": "บ" } "default": { "label": "บ" }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
"manualOrLocked": { "label": "," }, "manualOrLocked": { "label": ",", "labelFlags": 48 },
"default": { "label": "ล" } "default": { "label": "ล" }
} }
], ],
@ -121,12 +121,12 @@
"default": { "label": "เ" } "default": { "label": "เ" }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
"manualOrLocked": { "label": " ็|็" }, "manualOrLocked": { "label": " ็|็", "labelFlags": 128 },
"default": { "label": " ้|้" } "default": { "label": " ้|้", "labelFlags": 128 }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
"manualOrLocked": { "label": " ๋|๋" }, "manualOrLocked": { "label": " ๋|๋", "labelFlags": 128 },
"default": { "label": " ่|่" } "default": { "label": " ่|่", "labelFlags": 128 }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
"manualOrLocked": { "label": "ษ" }, "manualOrLocked": { "label": "ษ" },
@ -141,17 +141,21 @@
"default": { "label": "ว" } "default": { "label": "ว" }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
"manualOrLocked": { "label": "." }, "manualOrLocked": { "label": ".", "labelFlags": 48 },
"default": { "label": "ง" } "default": { "label": "ง" }
},
{ "$": "shift_state_selector",
"manualOrLocked": { "label": "ฅ" },
"default": { "label": "ฃ" }
} }
], ],
[ [
{ "$": "shift_state_selector", { "$": "shift_state_selector",
"manualOrLocked": { "label": "(" }, "manualOrLocked": { "label": "(", "labelFlags": 48 },
"default": { "label": "ผ" } "default": { "label": "ผ" }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
"manualOrLocked": { "label": ")" }, "manualOrLocked": { "label": ")", "labelFlags": 48 },
"default": { "label": "ป" } "default": { "label": "ป" }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
@ -163,15 +167,15 @@
"default": { "label": "อ" } "default": { "label": "อ" }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
"manualOrLocked": { "label": " ฺ|ฺ" }, "manualOrLocked": { "label": " ฺ|ฺ", "labelFlags": 128 },
"default": { "label": " ิ|ิ" } "default": { "label": " ิ|ิ", "labelFlags": 128 }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
"manualOrLocked": { "label": " ์|์" }, "manualOrLocked": { "label": " ์|์", "labelFlags": 128 },
"default": { "label": " ื|ื" } "default": { "label": " ื|ื", "labelFlags": 128 }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",
"manualOrLocked": { "label": "\?" }, "manualOrLocked": { "label": "\\?", "labelFlags": 48 },
"default": { "label": "ท" } "default": { "label": "ท" }
}, },
{ "$": "shift_state_selector", { "$": "shift_state_selector",

View file

@ -23,7 +23,7 @@
{ "label": "k", "popup": { "main": { "label": "(" } } }, { "label": "k", "popup": { "main": { "label": "(" } } },
{ "label": "l", "popup": { "main": { "label": ")" } } }, { "label": "l", "popup": { "main": { "label": ")" } } },
{ "label": "gʻ", "labelFlags": 128 }, { "label": "gʻ", "labelFlags": 128 },
{ "label": "'" } { "label": "ʼ" }
], ],
[ [
{ "label": "z", "popup": { "main": { "label": "*" } } }, { "label": "z", "popup": { "main": { "label": "*" } } },

View file

@ -957,15 +957,15 @@ public class Key implements Comparable<Key> {
// params that remains constant // params that remains constant
public final int mCode; public final int mCode;
@Nullable public final String mLabel; @Nullable public final String mLabel;
@Nullable final String mHintLabel; @Nullable public final String mHintLabel;
final int mLabelFlags; public final int mLabelFlags;
final int mIconId; public final int mIconId;
public final MoreKeySpec[] mMoreKeys; public final MoreKeySpec[] mMoreKeys;
final int mMoreKeysColumnAndFlags; public final int mMoreKeysColumnAndFlags;
public final int mBackgroundType; public final int mBackgroundType;
final int mActionFlags; public final int mActionFlags;
@Nullable final KeyVisualAttributes mKeyVisualAttributes; @Nullable public final KeyVisualAttributes mKeyVisualAttributes;
@Nullable final OptionalAttributes mOptionalAttributes; @Nullable public final OptionalAttributes mOptionalAttributes;
public final boolean mEnabled; public final boolean mEnabled;
public static KeyParams newSpacer(final TypedArray keyAttr, final KeyStyle keyStyle, public static KeyParams newSpacer(final TypedArray keyAttr, final KeyStyle keyStyle,

View file

@ -64,14 +64,14 @@ open class KeyboardBuilder<KP : KeyboardParams>(protected val mContext: Context,
// todo: further plan // todo: further plan
// migrate other languages/layouts to this style // migrate other languages/layouts to this style
// missing layouts: nepali_romanized, nepali_traditional // add a few individual key label flags: hindi_compact -> dammit... one key and there is need for json, marathi -> same
// add a few individual key label flags: khmer, lao, thai, hindi_compact, marathi, nepali (both) // thai and lao number rows... they should probably have none, can't do it generically
// that has nine letters in first row -> needs 0 extra (check layout) // so handle it like korean
// moreKeys for bangla and hindi layouts are completely mixed up -> maybe need to use layoutMoreKeys... but that's not nice // languageMoreKeys for bengali and hindi layouts are completely mixed up -> maybe need to use layoutMoreKeys... but that's not nice
// integrated number rows should be removed / ignored when migrating, row will be added differently // test whether the layouts really are the same
// test the zwnj key // comparing params with both parsers looks good, see list of detected differences below
// test whether the layouts really are the same (screenshots for everything added, compare old and new parser) // still need to check moreKeys, there will be many more differences that might just be minor
// first try creating the keyParams with both parsers, and compare results, print differences // write down a list of differences, ask users to open issues if they don't like them
// some keyboard_layout_set have supportedScript that is enum synced with script id in ScriptUtils // some keyboard_layout_set have supportedScript that is enum synced with script id in ScriptUtils
// that's one more reason for using language tags... // that's one more reason for using language tags...
// but currently it's still read from xml outside the keyboard parser, so that's fine for now // but currently it's still read from xml outside the keyboard parser, so that's fine for now
@ -84,6 +84,7 @@ open class KeyboardBuilder<KP : KeyboardParams>(protected val mContext: Context,
// (later): setting which moreKeys to prefer (default: symbol or important language, always symbol, always language) // (later): setting which moreKeys to prefer (default: symbol or important language, always symbol, always language)
// (later): setting whether to show duplicate moreKeys (describe properly what it actually does) // (later): setting whether to show duplicate moreKeys (describe properly what it actually does)
// and have some setting to enable configuring this per locale (in language settings -> potentially should not be a dialog any more but a fragment?) // and have some setting to enable configuring this per locale (in language settings -> potentially should not be a dialog any more but a fragment?)
// label flags are horrible to "decompile" when viewing a layout
// migrate pcqwerty to this style // migrate pcqwerty to this style
// this will be more complicated... // this will be more complicated...
// linked shift keys might be easy // linked shift keys might be easy
@ -170,11 +171,62 @@ open class KeyboardBuilder<KP : KeyboardParams>(protected val mContext: Context,
fun loadFromXml(xmlId: Int, id: KeyboardId): KeyboardBuilder<KP> { fun loadFromXml(xmlId: Int, id: KeyboardId): KeyboardBuilder<KP> {
if (Settings.getInstance().current.mUseNewKeyboardParsing if (Settings.getInstance().current.mUseNewKeyboardParsing
// && id.mElementId != KeyboardId.ELEMENT_ALPHABET_MANUAL_SHIFTED && id.mElementId != KeyboardId.ELEMENT_SYMBOLS_SHIFTED
&& this::class == KeyboardBuilder::class // otherwise this will apply to moreKeys and moreSuggestions, and then some parameters are off && this::class == KeyboardBuilder::class // otherwise this will apply to moreKeys and moreSuggestions, and then some parameters are off
) { ) {
if (loadFromAssets(id) != null) if (loadFromAssets(id) != null) {
if (!DebugFlags.DEBUG_ENABLED)
return this
// comparison of old and new parser below, remove once testing is complete
val keysInRowsFromXml = XmlKeyboardParser(xmlId, mParams, mContext).use { keyboardParser ->
keyboardParser.parseKeyboard()
}
if (keysInRowsFromXml.size != keysInRows.size) {
Log.w(TAG, "different sizes: ${keysInRows.size} vs ${keysInRowsFromXml.size}")
return this
}
keysInRowsFromXml.forEachIndexed { index, xmlRow ->
val row = keysInRows[index].filter { !it.isSpacer }
val xmlRow2 = xmlRow.filter { !it.isSpacer }
if (row.size != xmlRow2.size) {
Log.w(TAG, "different row sizes in row ${index + 1}")
return@forEachIndexed
}
xmlRow2.forEachIndexed { index1, xmlParams ->
// todo: compare moreKeys (and if different, check whether it's just the order)
// also check holo, there might be different default parameters
// and compare tablet layouts (how to best force it for both parsers?)
val keyParams = row[index1]
// bangla (india) has different period & symbols label (should it really be latin?)
// maybe need separate key text files for _IN and _BD
// hindi compact has a key with different label flags (marathi too? maybe i overlooked)
// lao has some sort of split number row, should be considered (how to deal with it?)
// thai also has this, leads to differences in hint labels and moreKeys
if (keyParams.mLabel != xmlParams.mLabel)
// currency keys (shift symbol) arranged differently
// obviously number row differences
Log.w(TAG, "label different: ${keyParams.mLabel} vs ${xmlParams.mLabel}")
if (keyParams.mCode != xmlParams.mCode)
Log.w(TAG, "code different: ${keyParams.mCode} vs ${xmlParams.mCode}")
if (keyParams.mIconId != xmlParams.mIconId)
Log.w(TAG, "icon different: ${keyParams.mIconId} vs ${xmlParams.mIconId}")
if (keyParams.mHintLabel != xmlParams.mHintLabel)
// extra and number keys are the difference so far
// persian has small difference
// khmer has some difference
// urdu has a lot of difference
Log.w(TAG, "hint label different: ${keyParams.mHintLabel} vs ${xmlParams.mHintLabel}")
if (keyParams.mLabelFlags != xmlParams.mLabelFlags && keyParams.mCode != 10)
// in symbol layout
// my version has disableHintLabel for all
// original has LABEL_FLAGS_HAS_POPUP_HINT on < > in shift symbol (but there is no popup)
// armenian, arabic, bangla,... and many with "symbols" original shift and delete have LABEL_FLAGS_FONT_NORMAL, mine not (but my period has)
// malayalam delete also has LABEL_FLAGS_AUTO_X_SCALE, mine not
// tamil & telugu my delete has LABEL_FLAGS_AUTO_X_SCALE, original not
Log.w(TAG, "label flags different for ${keyParams.mLabel} / ${keyParams.mCode}: ${keyParams.mLabelFlags.toString(16)} vs ${xmlParams.mLabelFlags.toString(16)}")
}
}
return this return this
}
} }
mParams.mId = id mParams.mId = id
// loading a keyboard should set default params like mParams.readAttributes(mContext, attrs); // loading a keyboard should set default params like mParams.readAttributes(mContext, attrs);

View file

@ -7,8 +7,6 @@ import android.view.inputmethod.EditorInfo
import android.widget.Toast import android.widget.Toast
import org.dslul.openboard.inputmethod.keyboard.Key import org.dslul.openboard.inputmethod.keyboard.Key
import org.dslul.openboard.inputmethod.keyboard.Key.KeyParams import org.dslul.openboard.inputmethod.keyboard.Key.KeyParams
import org.dslul.openboard.inputmethod.keyboard.Key.LABEL_FLAGS_AUTO_X_SCALE
import org.dslul.openboard.inputmethod.keyboard.Key.LABEL_FLAGS_FONT_NORMAL
import org.dslul.openboard.inputmethod.keyboard.KeyboardId import org.dslul.openboard.inputmethod.keyboard.KeyboardId
import org.dslul.openboard.inputmethod.keyboard.KeyboardTheme import org.dslul.openboard.inputmethod.keyboard.KeyboardTheme
import org.dslul.openboard.inputmethod.keyboard.internal.KeyboardIconsSet import org.dslul.openboard.inputmethod.keyboard.internal.KeyboardIconsSet
@ -298,7 +296,10 @@ abstract class KeyboardParser(private val params: KeyboardParams, private val co
label ?: params.mLocaleKeyTexts.labelPeriod, label ?: params.mLocaleKeyTexts.labelPeriod,
params, params,
width, width,
Key.LABEL_FLAGS_HAS_POPUP_HINT or Key.LABEL_FLAGS_HAS_SHIFTED_LETTER_HINT or defaultLabelFlags, // todo (later): check what LABEL_FLAGS_HAS_SHIFTED_LETTER_HINT does, maybe remove the flag here Key.LABEL_FLAGS_HAS_POPUP_HINT
// todo (later): check what LABEL_FLAGS_HAS_SHIFTED_LETTER_HINT does, maybe remove the flag here
or if (params.mId.isAlphabetKeyboard) Key.LABEL_FLAGS_HAS_SHIFTED_LETTER_HINT else 0
or defaultLabelFlags,
if (label?.first()?.isLetter() == true) Key.BACKGROUND_TYPE_NORMAL if (label?.first()?.isLetter() == true) Key.BACKGROUND_TYPE_NORMAL
else Key.BACKGROUND_TYPE_FUNCTIONAL, else Key.BACKGROUND_TYPE_FUNCTIONAL,
moreKeys?.let { getPunctuationMoreKeys() + it } ?: getPunctuationMoreKeys() moreKeys?.let { getPunctuationMoreKeys() + it } ?: getPunctuationMoreKeys()
@ -319,6 +320,7 @@ abstract class KeyboardParser(private val params: KeyboardParams, private val co
or Key.LABEL_FLAGS_AUTO_X_SCALE or Key.LABEL_FLAGS_AUTO_X_SCALE
or Key.LABEL_FLAGS_FOLLOW_KEY_LABEL_RATIO or Key.LABEL_FLAGS_FOLLOW_KEY_LABEL_RATIO
or Key.LABEL_FLAGS_FOLLOW_FUNCTIONAL_TEXT_COLOR or Key.LABEL_FLAGS_FOLLOW_FUNCTIONAL_TEXT_COLOR
or Key.LABEL_FLAGS_HAS_POPUP_HINT
or KeyboardTheme.getThemeActionAndEmojiKeyLabelFlags(params.mThemeId), or KeyboardTheme.getThemeActionAndEmojiKeyLabelFlags(params.mThemeId),
Key.BACKGROUND_TYPE_ACTION, Key.BACKGROUND_TYPE_ACTION,
getActionKeyMoreKeys() getActionKeyMoreKeys()
@ -335,7 +337,7 @@ abstract class KeyboardParser(private val params: KeyboardParams, private val co
"${getShiftLabel()}|!code/key_shift", "${getShiftLabel()}|!code/key_shift",
params, params,
width, width,
Key.LABEL_FLAGS_PRESERVE_CASE, Key.LABEL_FLAGS_PRESERVE_CASE or if (!params.mId.isAlphabetKeyboard) Key.LABEL_FLAGS_FOLLOW_FUNCTIONAL_TEXT_COLOR else 0,
// todo (later): possibly the whole stickOn/Off stuff can be removed, currently it should only have a very slight effect in holo // todo (later): possibly the whole stickOn/Off stuff can be removed, currently it should only have a very slight effect in holo
if (params.mId.mElementId == KeyboardId.ELEMENT_ALPHABET_SHIFT_LOCK_SHIFTED || params.mId.mElementId == KeyboardId.ELEMENT_ALPHABET_SHIFT_LOCKED) if (params.mId.mElementId == KeyboardId.ELEMENT_ALPHABET_SHIFT_LOCK_SHIFTED || params.mId.mElementId == KeyboardId.ELEMENT_ALPHABET_SHIFT_LOCKED)
Key.BACKGROUND_TYPE_STICKY_ON Key.BACKGROUND_TYPE_STICKY_ON
@ -580,8 +582,8 @@ abstract class KeyboardParser(private val params: KeyboardParams, private val co
// currently it's spread out everywhere... method.xml, locale_and_extra_value_to_keyboard_layout_set_map, getKeyboardLayoutNameForLocale, ... // currently it's spread out everywhere... method.xml, locale_and_extra_value_to_keyboard_layout_set_map, getKeyboardLayoutNameForLocale, ...
protected fun getSimpleLayoutName(layoutName: String, params: KeyboardParams) = when (layoutName) { protected fun getSimpleLayoutName(layoutName: String, params: KeyboardParams) = when (layoutName) {
"swiss", "german", "serbian_qwertz" -> "qwertz" "swiss", "german", "serbian_qwertz" -> "qwertz"
"nordic", "spanish" -> "qwerty" "nordic", "spanish" -> if (params.mId.locale.language == "eo") "eo" else "qwerty"
"south_slavic", "east_slavic" -> params.mId.locale.language // layouts split per language now, much less convoluted "south_slavic", "east_slavic" -> params.mId.locale.language // layouts are split per language now, much less convoluted
else -> layoutName else -> layoutName
} }
@ -595,8 +597,8 @@ abstract class KeyboardParser(private val params: KeyboardParams, private val co
val labelFlags = if (!params.mId.isAlphabetKeyboard) 0 else when (name) { val labelFlags = if (!params.mId.isAlphabetKeyboard) 0 else when (name) {
"armenian_phonetic", "arabic", "arabic_pc", "bengali", "bengali_akkhor", "bengali_unijoy", "armenian_phonetic", "arabic", "arabic_pc", "bengali", "bengali_akkhor", "bengali_unijoy",
"farsi", "hindi", "hindi_compact", "lao", "marathi", "nepali_romanized", "nepali_traditional", "farsi", "hindi", "hindi_compact", "lao", "marathi", "nepali_romanized", "nepali_traditional",
"thai", "urdu" -> LABEL_FLAGS_FONT_NORMAL "thai", "urdu" -> Key.LABEL_FLAGS_FONT_NORMAL
"kannada", "khmer", "malayalam", "sinhala", "tamil", "telugu" -> LABEL_FLAGS_FONT_NORMAL or LABEL_FLAGS_AUTO_X_SCALE "kannada", "khmer", "malayalam", "sinhala", "tamil", "telugu" -> Key.LABEL_FLAGS_FONT_NORMAL or Key.LABEL_FLAGS_AUTO_X_SCALE
else -> 0 else -> 0
} }
// only for alphabet, but some exceptions for shift layouts // only for alphabet, but some exceptions for shift layouts
@ -614,7 +616,7 @@ abstract class KeyboardParser(private val params: KeyboardParams, private val co
R.array.touch_position_correction_data_default R.array.touch_position_correction_data_default
else R.array.touch_position_correction_data_holo else R.array.touch_position_correction_data_holo
val hasZwnjKey = params.mId.locale.language in listOf("fa", "ne", "kn", "te") // determine from language, user might have custom layout val hasZwnjKey = params.mId.locale.language in listOf("fa", "ne", "kn", "te") // determine from language, user might have custom layout
val hasShiftKey = name !in listOf("hindi_compact", "arabic", "arabic_pc", "hebrew", "kannada", "malayalam", "marathi", "farsi", "tamil", "telugu") val hasShiftKey = name !in listOf("hindi_compact", "bengali", "arabic", "arabic_pc", "hebrew", "kannada", "malayalam", "marathi", "farsi", "tamil", "telugu")
return LayoutInfos(labelFlags, enableProximityCharsCorrection, allowRedundantMoreKeys, touchPositionCorrectionData, hasZwnjKey, hasShiftKey) return LayoutInfos(labelFlags, enableProximityCharsCorrection, allowRedundantMoreKeys, touchPositionCorrectionData, hasZwnjKey, hasShiftKey)
} }
} }

View file

@ -24,7 +24,8 @@ class SimpleKeyboardParser(private val params: KeyboardParams, private val conte
override fun parseCoreLayout(layoutContent: String): MutableList<List<KeyData>> { override fun parseCoreLayout(layoutContent: String): MutableList<List<KeyData>> {
val rowStrings = layoutContent.replace("\r\n", "\n").split("\n\n") val rowStrings = layoutContent.replace("\r\n", "\n").split("\n\n")
return rowStrings.mapIndexedTo(mutableListOf()) { i, row -> return rowStrings.mapIndexedNotNullTo(mutableListOf()) { i, row ->
if (row.isBlank()) return@mapIndexedNotNullTo null
if (addExtraKeys) if (addExtraKeys)
getExtraKeys(i)?.let { parseRow(row) + it } ?: parseRow(row) getExtraKeys(i)?.let { parseRow(row) + it } ?: parseRow(row)
else else

View file

@ -8,6 +8,7 @@ package org.dslul.openboard.inputmethod.keyboard.internal.keyboard_parser.floris
import kotlinx.serialization.SerialName import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable import kotlinx.serialization.Serializable
import kotlinx.serialization.Transient import kotlinx.serialization.Transient
import org.dslul.openboard.inputmethod.keyboard.Key
import org.dslul.openboard.inputmethod.keyboard.internal.KeyboardParams import org.dslul.openboard.inputmethod.keyboard.internal.KeyboardParams
// taken from FlorisBoard, small modifications (see also KeyData) // taken from FlorisBoard, small modifications (see also KeyData)
@ -42,7 +43,9 @@ class TextKeyData(
// } // }
// } // }
if (label.startsWith("$$$")) { // currency key if (label.startsWith("$$$")) { // currency key
if (label == "$$$") return params.mLocaleKeyTexts.currencyKey.let { it.first.toTextKey(it.second.toList()) } if (label == "$$$")
return params.mLocaleKeyTexts.currencyKey
.let { it.first.toTextKey(it.second.toList(), labelFlags = Key.LABEL_FLAGS_FOLLOW_KEY_LETTER_RATIO) } // the flag is to match old parser, but why for main currency key, but not for others?
val n = label.substringAfter("$$$").toIntOrNull() val n = label.substringAfter("$$$").toIntOrNull()
if (n != null && n <= 4) if (n != null && n <= 4)
return params.mLocaleKeyTexts.currencyKey.second[n - 1].toTextKey() return params.mLocaleKeyTexts.currencyKey.second[n - 1].toTextKey()
@ -141,9 +144,10 @@ class MultiTextKeyData(
} }
} }
fun String.toTextKey(moreKeys: Collection<String>? = null): TextKeyData = fun String.toTextKey(moreKeys: Collection<String>? = null, labelFlags: Int = 0): TextKeyData =
TextKeyData( TextKeyData(
label = this, label = this,
labelFlags = labelFlags,
popup = moreKeys popup = moreKeys
?.let { keys -> PopupSet(null, keys.map { it.toTextKey() }) } ?.let { keys -> PopupSet(null, keys.map { it.toTextKey() }) }
?: PopupSet() ?: PopupSet()