summary refs log tree commit diff homepage
path: root/2048.c
diff options
context:
space:
mode:
Diffstat (limited to '2048.c')
-rw-r--r--2048.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/2048.c b/2048.c
index 260f67e..d2e44bb 100644
--- a/2048.c
+++ b/2048.c
@@ -260,7 +260,9 @@ static void drawGameOver(void) {
 }
 
 static bool input(void) {
-	switch (getch()) {
+	int ch = getch();
+	if (ch == ERR) ch = getch();
+	switch (ch) {
 		break; case 'h': case KEY_LEFT: if (left()) spawn();
 		break; case 'j': case KEY_DOWN: if (down()) spawn();
 		break; case 'k': case KEY_UP: if (up()) spawn();