From df56145d2935783ee7a807b3608f6a8fa90ff45b Mon Sep 17 00:00:00 2001 From: fdai7184 Date: Wed, 8 Feb 2023 21:10:28 +0100 Subject: [PATCH] Quit with Q --- src/input.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/input.c b/src/input.c index 7626acc..95cad7d 100644 --- a/src/input.c +++ b/src/input.c @@ -36,7 +36,8 @@ void getInput(){ void testArrowInput(){ if(kbhit()){ - if(getch() == '\033'){ + char key1 = getch(); + if(key1 == '\033'){ getch(); char key = getch(); if(key=='A'){ @@ -52,6 +53,9 @@ void testArrowInput(){ printf("left"); } } + else if(key1=='q'){ + printf("Quit"); + } } }