keyboard: Progressively allocate remainder pixels So the keyboard always fills the width of the screen, and the width is distributed evenly
1 files changed, 5 insertions(+), 0 deletions(-) M keyboard.c
M keyboard.c => keyboard.c +5 -0
@@ 29,11 29,16 @@ kbd_init_suggs(struct key *suggs, uint32_t width, uint32_t height) { struct key *k = suggs; double rowlength = kbd_get_row_length(k); uint8_t i = 0; while (k->label != NULL) { k->x = x; k->y = y; k->w = width / rowlength; x += k->w; i++; if (x < (width * i) / rowlength) { k->w++; x++; } k->h = keyheight; k++; }