summary refs log tree commit diff homepage
diff options
context:
space:
mode:
-rw-r--r--2048.c4
-rw-r--r--freecell.c1
-rw-r--r--play.c1
3 files changed, 5 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();
diff --git a/freecell.c b/freecell.c
index 3855d18..b3ca0e9 100644
--- a/freecell.c
+++ b/freecell.c
@@ -325,6 +325,7 @@ static bool quit;
 static void input(void) {
 	MEVENT m;
 	int ch = getch();
+	if (ch == ERR) ch = getch();
 	uint stack = Stacks;
 
 	if (ch == KEY_MOUSE && getmouse(&m) == OK) {
diff --git a/play.c b/play.c
index 1e1ab51..ca3ac4f 100644
--- a/play.c
+++ b/play.c
@@ -249,6 +249,7 @@ static const struct Game *menu(void) {
 		clrtoeol();
 		move(1 + 3 * game, 2);
 		int ch = getch();
+		if (ch == ERR) ch = getch();
 		switch (ch) {
 			break; case 'k': case KEY_UP: {
 				if (game) game--;