Skip to content

Commit

Permalink
try to fix not broken double ESCAPE on some platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
okbob committed Apr 22, 2024
1 parent ef45298 commit 5d28893
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/inputs.c
Original file line number Diff line number Diff line change
Expand Up @@ -275,10 +275,20 @@ get_ncurses_event(NCursesEventData *nced, bool *sigint, bool *sigwinch)
{
if (nced->keycode == ERR)
{
nced->keycode = PSPG_NOTASSIGNED_CODE;
nced->keycode = PSPG_NOTASSIGNED_CODE;

/*
* workaround for macos and older ncurses. When ESC is pressed,
* then first iteration returns ESC, and second ERR (insted
* expected OK) due setting ESCDELAY to 1 ms.
*/

if (first_event)
{
nced->alt = false;
nced->ignore_it = true;
return true;
}
}

if (nced->keycode == KEY_MOUSE)
Expand Down

0 comments on commit 5d28893

Please sign in to comment.