diff -ru ncurses-6.4-20230211/ncurses/win32con/win_driver.c ncurses-6.4-20230211-fixed/ncurses/win32con/win_driver.c --- ncurses-6.4-20230211/ncurses/win32con/win_driver.c 2023-02-12 03:31:33 +0000 +++ ncurses-6.4-20230211-fixed/ncurses/win32con/win_driver.c 2023-06-10 23:24:54 +0000 @@ -94,7 +94,8 @@ GenMap(VK_RIGHT, KEY_RIGHT), GenMap(VK_DOWN, KEY_DOWN), GenMap(VK_DELETE, KEY_DC), - GenMap(VK_INSERT, KEY_IC) + GenMap(VK_INSERT, KEY_IC), + GenMap(VK_BACK, KEY_BACKSPACE) }; static const LONG ansi_keys[] = { @@ -1570,7 +1571,12 @@ char ch = inp_rec.Event.KeyEvent.uChar.AsciiChar; if (inp_rec.Event.KeyEvent.bKeyDown) { - if (0 == ch) { + /* + * Windows console reports VK_BACK together with an ASCII + * character 0x7F (DEL), we we have to prefer VK in this case + * in order to report a correct event to an app. + */ + if (0 == ch || vk == VK_BACK) { int nKey = MapKey(vk); if (nKey < 0) { CONSUME(); @@ -2135,7 +2141,7 @@ vk = (WORD) (vk + 12); } } - if (*buf == 0) { + if (*buf == 0 || vk == VK_BACK) { int key = MapKey(vk); if (key < 0) continue;