about summary refs log tree commit diff
path: root/keyboard.c
diff options
context:
space:
mode:
authorZach DeCook <zachdecook@librem.one>2022-01-20 20:40:34 -0500
committerZach DeCook <zachdecook@librem.one>2022-01-20 20:40:34 -0500
commit1ae1ac8ccd79716830f911fd97438d99d17998b2 (patch)
tree528b5102fc2b5cabb72f07453cf30dfb898fd2bf /keyboard.c
parent8a3e71164d730500105ae1de2f9a666fb11c9eae (diff)
downloadsuggpicker-1ae1ac8ccd79716830f911fd97438d99d17998b2.tar.gz
numlayouts: hard-code to one
Diffstat (limited to 'keyboard.c')
-rw-r--r--keyboard.c22
1 files changed, 3 insertions, 19 deletions
diff --git a/keyboard.c b/keyboard.c
index 9e97d20..85f412f 100644
--- a/keyboard.c
+++ b/keyboard.c
@@ -14,25 +14,12 @@
 
 void
 kbd_init(struct kbd *kb, struct layout *layouts) {
-	int i;
-
 	fprintf(stderr, "Initializing keyboard\n");
 
 	kb->layouts = layouts;
 
-	for (i = 0; i < NumLayouts - 1; i++)
-		;
-	fprintf(stderr, "Found %d layouts\n", i);
-
 	kb->layer_index = 0;
 
-	i = 0;
-	enum layout_id lid = kb->layers[0];
-	while (lid != NumLayouts) {
-		lid = kb->layers[++i];
-	}
-	fprintf(stderr, "Found %d layers\n", i);
-
 	enum layout_id layer;
 	if (kb->landscape) {
 		layer = kb->landscape_layers[kb->layer_index];
@@ -185,16 +172,13 @@ kbd_draw_layout(struct kbd *kb) {
 }
 
 void
-kbd_resize(struct kbd *kb, struct layout *layouts, uint8_t layoutcount) {
+kbd_resize(struct kbd *kb, struct layout *layouts) {
 	struct drwsurf *d = kb->surf;
 
-	fprintf(stderr, "Resize %dx%d %d, %d layouts\n", kb->w, kb->h, kb->s,
-	        layoutcount);
+	fprintf(stderr, "Resize %dx%d %d\n", kb->w, kb->h, kb->s);
 
 	drwsurf_resize(d, kb->w, kb->h, kb->s);
-	for (int i = 0; i < layoutcount; i++) {
-		kbd_init_layout(&layouts[i], kb->w, kb->h);
-	}
+	kbd_init_layout(&layouts[0], kb->w, kb->h);
 	kbd_draw_layout(kb);
 }