keyboard: Add/document "leftOffset" optional property on OSK keys

This optional property defines the offset the a key should have
relative to the previous key (on its left) or the start of the
column if it is the first key. If this property is not
present, the key will be placed with no relative offset.

This for example allows keymaps to explicitly define the padding
of the rows that are not "full" relative to other rows, without
guesswork in the code. It is used for this purpose in the
keymaps/levels/rows that needed it.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3162>
This commit is contained in:
Carlos Garnacho 2024-01-26 13:07:00 +01:00
parent a93858b862
commit d1aa2acef1
61 changed files with 216 additions and 43 deletions

View File

@ -55,6 +55,12 @@ it has the following structure:
- keyval (String): Hexadecimal keyval to emit as - keyval (String): Hexadecimal keyval to emit as
emulated key presses. Committed strings are emulated key presses. Committed strings are
preferred. preferred.
- leftOffset (Double): If set, the left offset of
this key, relative to the key immediately to the
left, or the start of the row. If not set, the key
will be implicitly located at the right of the
previous key in the row. Multiples of 0.5 are
accepted.
- width (Double): Relative width of the key in the - width (Double): Relative width of the key in the
row. 1 is for a square key. Multiples of 0.5 are row. 1 is for a square key. Multiples of 0.5 are
accepted. accepted.

View File

@ -121,6 +121,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"ա" "ա"
] ]
@ -384,6 +385,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"Ա" "Ա"
] ]
@ -604,6 +606,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"@" "@"
] ]
@ -868,6 +871,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"£" "£"
] ]
@ -1048,4 +1052,4 @@
], ],
"locale": "hy", "locale": "hy",
"name": "Armenian" "name": "Armenian"
} }

View File

@ -151,6 +151,7 @@
], ],
[ [
{ {
"leftOffset": 1,
"strings": [ "strings": [
"ذ" "ذ"
] ]
@ -335,6 +336,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"@" "@"
] ]
@ -603,6 +605,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"£" "£"
] ]
@ -790,4 +793,4 @@
], ],
"locale": "ar", "locale": "ar",
"name": "Arabic" "name": "Arabic"
} }

View File

@ -81,6 +81,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"a", "a",
"ä", "ä",
@ -322,6 +323,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"A", "A",
"Ä", "Ä",
@ -560,6 +562,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"@" "@"
] ]
@ -808,6 +811,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"£" "£"
] ]

View File

@ -603,6 +603,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"@" "@"
] ]
@ -851,6 +852,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"£" "£"
] ]

View File

@ -538,6 +538,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"@" "@"
] ]
@ -786,6 +787,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"£" "£"
] ]

View File

@ -548,6 +548,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"@" "@"
] ]
@ -796,6 +797,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"£" "£"
] ]
@ -962,4 +964,4 @@
], ],
"locale": "be", "locale": "be",
"name": "Belarusian" "name": "Belarusian"
} }

View File

@ -96,6 +96,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"a", "a",
"à", "à",
@ -352,6 +353,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"A", "A",
"À", "À",
@ -590,6 +592,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"@" "@"
] ]
@ -838,6 +841,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"£" "£"
] ]

View File

@ -81,6 +81,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"a", "a",
"ä", "ä",
@ -322,6 +323,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"A", "A",
"Ä", "Ä",
@ -560,6 +562,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"@" "@"
] ]
@ -808,6 +811,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"£" "£"
] ]

View File

@ -81,6 +81,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"a", "a",
"ä", "ä",
@ -322,6 +323,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"A", "A",
"Ä", "Ä",
@ -560,6 +562,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"@" "@"
] ]
@ -808,6 +811,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"£" "£"
] ]

View File

@ -96,6 +96,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"a", "a",
"á", "á",
@ -359,6 +360,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"A", "A",
"Á", "Á",
@ -604,6 +606,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"@" "@"
] ]
@ -852,6 +855,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"£" "£"
] ]

View File

@ -81,6 +81,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"a", "a",
"ä", "ä",
@ -322,6 +323,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"A", "A",
"Ä", "Ä",
@ -560,6 +562,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"@" "@"
] ]
@ -808,6 +811,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"£" "£"
] ]

View File

@ -594,6 +594,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"@" "@"
] ]
@ -842,6 +843,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"£" "£"
] ]

View File

@ -670,6 +670,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"@" "@"
] ]
@ -918,6 +919,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"£" "£"
] ]

View File

@ -706,6 +706,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"@" "@"
] ]
@ -954,6 +955,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"£" "£"
] ]

View File

@ -594,6 +594,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"@" "@"
] ]
@ -843,6 +844,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"£" "£"
] ]

View File

@ -592,6 +592,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"@" "@"
] ]
@ -843,6 +844,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"£" "£"
] ]

View File

@ -574,6 +574,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"@" "@"
] ]
@ -822,6 +823,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"£" "£"
] ]

View File

@ -608,6 +608,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"@" "@"
] ]
@ -856,6 +857,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"£" "£"
] ]

View File

@ -66,6 +66,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"ა", "ა",
"ჺ" "ჺ"
@ -284,6 +285,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"A" "A"
] ]
@ -509,6 +511,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"@" "@"
] ]
@ -757,6 +760,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"£" "£"
] ]

View File

@ -72,6 +72,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"α", "α",
"ά" "ά"
@ -294,6 +295,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"Α", "Α",
"Ά" "Ά"
@ -522,6 +524,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"@" "@"
] ]
@ -770,6 +773,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"£" "£"
] ]

View File

@ -66,6 +66,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"a" "a"
] ]
@ -288,6 +289,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"A" "A"
] ]
@ -522,6 +524,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"@" "@"
] ]
@ -770,6 +773,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"£" "£"
] ]

View File

@ -91,6 +91,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"a", "a",
"á", "á",
@ -337,6 +338,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"A", "A",
"Á", "Á",
@ -570,6 +572,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"@" "@"
] ]
@ -818,6 +821,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"£" "£"
] ]

View File

@ -63,6 +63,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"a" "a"
] ]
@ -273,6 +274,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"A" "A"
] ]
@ -498,6 +500,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"@" "@"
] ]
@ -746,6 +749,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"£" "£"
] ]

View File

@ -125,6 +125,7 @@
], ],
[ [
{ {
"leftOffset": 1,
"strings": [ "strings": [
"ז", "ז",
"ז׳" "ז׳"
@ -298,6 +299,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"@" "@"
] ]
@ -547,6 +549,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"£" "£"
] ]
@ -715,4 +718,4 @@
], ],
"locale": "he", "locale": "he",
"name": "Hebrew" "name": "Hebrew"
} }

View File

@ -326,6 +326,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"@" "@"
] ]
@ -575,6 +576,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"£" "£"
] ]

View File

@ -568,6 +568,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"@" "@"
] ]
@ -817,6 +818,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"£" "£"
] ]

View File

@ -151,6 +151,7 @@
], ],
[ [
{ {
"leftOffset": 1,
"strings": [ "strings": [
"ذ" "ذ"
] ]
@ -335,6 +336,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"٬", "٬",
"@" "@"
@ -606,6 +608,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"£" "£"
] ]
@ -794,4 +797,4 @@
], ],
"locale": "fa", "locale": "fa",
"name": "Persian" "name": "Persian"
} }

View File

@ -92,6 +92,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"a", "a",
"á", "á",
@ -340,6 +341,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"A", "A",
"Á", "Á",
@ -574,6 +576,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"@" "@"
] ]
@ -822,6 +825,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"£" "£"
] ]

View File

@ -90,6 +90,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"a", "a",
"à", "à",
@ -336,6 +337,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"A", "A",
"À", "À",
@ -570,6 +572,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"@" "@"
] ]
@ -818,6 +821,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"£" "£"
] ]

View File

@ -86,6 +86,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"a", "a",
"à", "à",
@ -331,6 +332,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"A", "A",
"À", "À",
@ -568,6 +570,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"@" "@"
] ]
@ -816,6 +819,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"£" "£"
] ]

View File

@ -554,6 +554,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"@" "@"
] ]
@ -802,6 +803,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"£" "£"
] ]
@ -968,4 +970,4 @@
], ],
"locale": "ky", "locale": "ky",
"name": "Kirghiz" "name": "Kirghiz"
} }

View File

@ -399,6 +399,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"@" "@"
] ]
@ -648,6 +649,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"£" "£"
] ]

View File

@ -74,6 +74,7 @@
[ [
{ {
"label": "ㅁ", "label": "ㅁ",
"leftOffset": 0.5,
"strings": [ "strings": [
"a" "a"
] ]
@ -135,6 +136,7 @@
[ [
{ {
"label": "ㅋ", "label": "ㅋ",
"leftOffset": 1,
"strings": [ "strings": [
"z" "z"
] ]
@ -303,6 +305,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"@" "@"
] ]
@ -551,6 +554,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"£" "£"
] ]

View File

@ -389,6 +389,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"@" "@"
] ]
@ -638,6 +639,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"£" "£"
] ]

View File

@ -592,6 +592,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"@" "@"
] ]
@ -843,6 +844,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"£" "£"
] ]

View File

@ -102,6 +102,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"a", "a",
"ą", "ą",
@ -382,6 +383,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"A", "A",
"Ą", "Ą",
@ -638,6 +640,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"@" "@"
] ]
@ -886,6 +889,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"£" "£"
] ]

View File

@ -101,6 +101,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"a", "a",
"ā", "ā",
@ -380,6 +381,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"A", "A",
"Ā", "Ā",
@ -636,6 +638,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"@" "@"
] ]
@ -884,6 +887,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"£" "£"
] ]

View File

@ -548,6 +548,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"@" "@"
] ]
@ -796,6 +797,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"£" "£"
] ]
@ -962,4 +964,4 @@
], ],
"locale": "mk", "locale": "mk",
"name": "Macedonian" "name": "Macedonian"
} }

View File

@ -552,6 +552,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"@" "@"
] ]
@ -801,6 +802,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"£" "£"
] ]
@ -968,4 +970,4 @@
], ],
"locale": "mn", "locale": "mn",
"name": "Mongolian" "name": "Mongolian"
} }

View File

@ -63,6 +63,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"a" "a"
] ]
@ -273,6 +274,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"A" "A"
] ]
@ -498,6 +500,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"@" "@"
] ]
@ -746,6 +749,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"£" "£"
] ]

View File

@ -91,6 +91,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"a", "a",
"á", "á",
@ -339,6 +340,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"A", "A",
"Á", "Á",
@ -574,6 +576,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"@" "@"
] ]
@ -822,6 +825,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"£" "£"
] ]

View File

@ -594,6 +594,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"@" "@"
] ]
@ -842,6 +843,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"£" "£"
] ]

View File

@ -63,6 +63,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"a" "a"
] ]
@ -273,6 +274,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"A" "A"
] ]
@ -498,6 +500,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"@" "@"
] ]
@ -746,6 +749,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"£" "£"
] ]

View File

@ -78,6 +78,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"a", "a",
"ą", "ą",
@ -324,6 +325,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"A", "A",
"Ą", "Ą",
@ -570,6 +572,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"@" "@"
] ]
@ -818,6 +821,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"£" "£"
] ]

View File

@ -90,6 +90,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"a", "a",
"á", "á",
@ -338,6 +339,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"A", "A",
"Á", "Á",
@ -574,6 +576,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"@" "@"
] ]
@ -822,6 +825,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"£" "£"
] ]

View File

@ -70,6 +70,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"a", "a",
"â", "â",
@ -300,6 +301,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"A", "A",
"Â", "Â",
@ -538,6 +540,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"@" "@"
] ]
@ -786,6 +789,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"£" "£"
] ]

View File

@ -548,6 +548,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"@" "@"
] ]
@ -796,6 +797,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"£" "£"
] ]
@ -962,4 +964,4 @@
], ],
"locale": "sr", "locale": "sr",
"name": "Serbian" "name": "Serbian"
} }

View File

@ -548,6 +548,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"@" "@"
] ]
@ -796,6 +797,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"£" "£"
] ]
@ -962,4 +964,4 @@
], ],
"locale": "ru", "locale": "ru",
"name": "Russian" "name": "Russian"
} }

View File

@ -628,6 +628,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"@" "@"
] ]
@ -876,6 +877,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"£" "£"
] ]

View File

@ -63,6 +63,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"a" "a"
] ]
@ -278,6 +279,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"A" "A"
] ]
@ -508,6 +510,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"@" "@"
] ]
@ -756,6 +759,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"£" "£"
] ]

View File

@ -101,6 +101,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"a", "a",
"á", "á",
@ -381,6 +382,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"A", "A",
"Á", "Á",
@ -638,6 +640,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"@" "@"
] ]
@ -886,6 +889,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"£" "£"
] ]

View File

@ -150,6 +150,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"ฟ" "ฟ"
] ]
@ -464,6 +465,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"ฤ" "ฤ"
] ]
@ -716,6 +718,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"@" "@"
] ]
@ -965,6 +968,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"£" "£"
] ]
@ -1132,4 +1136,4 @@
], ],
"locale": "th", "locale": "th",
"name": "Thai" "name": "Thai"
} }

View File

@ -83,6 +83,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"a", "a",
"â" "â"
@ -322,6 +323,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"A", "A",
"Â" "Â"
@ -556,6 +558,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"@" "@"
] ]
@ -804,6 +807,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"£" "£"
] ]

View File

@ -550,6 +550,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"@" "@"
] ]
@ -799,6 +800,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"£" "£"
] ]
@ -966,4 +968,4 @@
], ],
"locale": "uk", "locale": "uk",
"name": "Ukrainian" "name": "Ukrainian"
} }

View File

@ -86,6 +86,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"a", "a",
"à", "à",
@ -330,6 +331,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"A", "A",
"À", "À",
@ -566,6 +568,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"@" "@"
] ]
@ -814,6 +817,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"€" "€"
] ]

View File

@ -626,6 +626,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"@" "@"
] ]
@ -874,6 +875,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"£" "£"
] ]

View File

@ -86,6 +86,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"a", "a",
"à", "à",
@ -330,6 +331,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"A", "A",
"À", "À",
@ -566,6 +568,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"@" "@"
] ]
@ -814,6 +817,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"£" "£"
] ]

View File

@ -112,6 +112,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"a", "a",
"à", "à",
@ -389,6 +390,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"A", "A",
"À", "À",
@ -632,6 +634,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"@" "@"
] ]
@ -881,6 +884,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"£" "£"
] ]

View File

@ -94,6 +94,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"a", "a",
"á", "á",
@ -345,6 +346,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"A", "A",
"Á", "Á",
@ -580,6 +582,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"@" "@"
] ]
@ -828,6 +831,7 @@
], ],
[ [
{ {
"leftOffset": 0.5,
"strings": [ "strings": [
"£" "£"
] ]

View File

@ -113,10 +113,10 @@ class KeyContainer extends St.Widget {
this._rows.push(row); this._rows.push(row);
} }
appendKey(key, width = 1, height = 1) { appendKey(key, width = 1, height = 1, leftOffset = 0) {
let keyInfo = { const keyInfo = {
key, key,
left: this._currentCol, left: this._currentCol + leftOffset,
top: this._currentRow, top: this._currentRow,
width, width,
height, height,
@ -126,37 +126,19 @@ class KeyContainer extends St.Widget {
row.keys.push(keyInfo); row.keys.push(keyInfo);
row.width += width; row.width += width;
this._currentCol += width; this._currentCol += leftOffset + width;
this._maxCols = Math.max(this._currentCol, this._maxCols); this._maxCols = Math.max(this._currentCol, this._maxCols);
} }
layoutButtons() { layoutButtons() {
let nCol = 0, nRow = 0; this._rows.forEach(row => {
row.keys.forEach(keyInfo => {
for (let i = 0; i < this._rows.length; i++) { const {left, top, width, height} = keyInfo;
let row = this._rows[i]; this._gridLayout.attach(keyInfo.key,
left * KEY_SIZE, top * KEY_SIZE,
/* When starting a new row, see if we need some padding */ width * KEY_SIZE, height * KEY_SIZE);
if (nCol === 0) { });
let diff = this._maxCols - row.width; });
if (diff >= 1)
nCol = diff * KEY_SIZE / 2;
else
nCol = diff * KEY_SIZE;
}
for (let j = 0; j < row.keys.length; j++) {
let keyInfo = row.keys[j];
let width = keyInfo.width * KEY_SIZE;
let height = keyInfo.height * KEY_SIZE;
this._gridLayout.attach(keyInfo.key, nCol, nRow, width, height);
nCol += width;
}
nRow += KEY_SIZE;
nCol = 0;
}
} }
getRatio() { getRatio() {
@ -1582,7 +1564,7 @@ export const Keyboard = GObject.registerClass({
if (key.action || key.keyval) if (key.action || key.keyval)
button.keyButton.add_style_class_name('default-key'); button.keyButton.add_style_class_name('default-key');
layout.appendKey(button, key.width); layout.appendKey(button, key.width, 1, key.leftOffset);
} }
} }