You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Set width on every key in that row to the same value slightly below 1 (for example 0.92 or 0.9). WM Keyboard automatically centers any row whose total key width is narrower than the layer's gridWeight, giving you equal left and right padding and proportionally narrower keys without adding any empty {"type": "none"} keys.
How it works
gridWeightOf(rows) (core/language/src/main/java/com/wasimaster/wmkeyboard/core/layout/KeyboardLayout.kt:901-909) sets the layer's reference gridWeight to the most common row width in that layer (for example 10 on a standard 10-column grid; ties go to the wider width).
sidePadFor(row, gridWeight) (KeyboardLayout.kt:920-921, applied in feature/ime/src/main/java/com/wasimaster/wmkeyboard/ime/ui/KeyboardScreen.kt:20393) pads both ends of any shorter row equally by (gridWeight - rowSum) / 2.
Key.width supports two decimal places (GridUnitStep = 0.01f, KeyboardLayout.kt:988), in both the visual Layout Editor's key sheet and the raw JSON editor.
Example (10-key row squeezed to 92% width with 0.4 units of padding per side)
In a 10-wide layer where at least two other rows still sum to 10:
Each key scales proportionally to 0.92, the row sums to 9.2, and sidePadFor adds (10 - 9.2) / 2 = 0.4 key-units of padding on the left and 0.4 on the right. (If Extend edge keys is on under Layout & size, the key faces still draw visually inset by 0.4 units while the outer gap stays tappable for the end keys, per KeyboardScreen.kt:24188-24199.)
Two layout rules to keep in mind
Majority row width (gridWeightOf, lines 901-909): Because gridWeight is the mode (most frequent row total in the layer), if a majority of rows in the layer share the same reduced sum (such as 9.2), 9.2 becomes the new gridWeight and fills the full width again. Keep at least half the rows at the full width (or, if you want padding on the entire board rather than specific rows, set "appearance": { "sidePadLeftScale": ..., "sidePadRightScale": ... } on the layout per LayoutJsonDocs.kt:117-118).
Single-spacebar rows (fillSpaceRows, lines 944-958): On a short row containing a single "action": { "type": "space" } key, fillSpaceRows automatically widens the spacebar to absorb gridWeight - rowSum. Only on a single-spacebar row (or if you want asymmetric left vs. right padding) do you need explicit { "label": "", "action": { "type": "none" }, "width": 0.4 } spacer entries (LayoutJsonDocs.kt:267).
AI-assisted: verified against abcffa2 (core/layout/KeyboardLayout.kt, core/layout/json/LayoutJsonDocs.kt, and ime/ui/KeyboardScreen.kt).
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
A little bit left and right. Squeeze the keys proportionally. Without resorting to adding empty keys if possible!
All reactions