From c068c79779449d22c501fc6e5de1ebe35a5503bb Mon Sep 17 00:00:00 2001 From: Laurent MAZET Date: Wed, 15 May 2024 14:10:34 +0200 Subject: [PATCH] correct escape key --- cmore.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/cmore.c b/cmore.c index ccf6158..8768627 100644 --- a/cmore.c +++ b/cmore.c @@ -76,12 +76,8 @@ void display (char **lines, int xmax, int ymax, int keep_skip) int key = waitforkey (); VERBOSE (DEBUG, fprintf (stdout, "key pressed: 0x%04x (%c)\n", key, (key >= ' ') && (key < 256) ? key : '.')); switch (key) { - case KEY_ESC: case ':': -#ifndef __PDCURSES__ - key = waitforkey (); - switch (key) { - case KEY_ESC: + switch (waitforkey ()) { case ':': DoExit (); /* fallthrough */ @@ -91,7 +87,13 @@ void display (char **lines, int xmax, int ymax, int keep_skip) break; } break; -#endif + case KEY_ESC: +#ifndef __PDCURSES__ + if (waitforkey () != KEY_ESC) { + break; + } + /* fallthrough */ +#endif /* __PDCURSES__ */ case 'q': DoExit (); stop = 1; -- 2.30.2