Mark ESC as handled so that it doesn't come back in CharacterHandler (#1974)

This commit is contained in:
Dustin L. Howett 2019-07-16 13:56:46 -07:00 committed by Dustin L. Howett (MSFT)
parent fa5b9b06bd
commit a0782bfd6c
2 changed files with 9 additions and 0 deletions

View file

@ -258,6 +258,14 @@ bool Terminal::SendKeyEvent(const WORD vkey, const ControlKeyStates states)
}
}
// Manually handle Escape here. If we let it fall through, it'll come
// back up through the character handler. It's registered as a translation
// in TerminalInput, so we'll let TerminalInput control it.
if (vkey == VK_ESCAPE)
{
ch = UNICODE_ESC;
}
const bool manuallyHandled = ch != UNICODE_NULL;
KeyEvent keyEv{ true, 0, vkey, 0, ch, states.Value() };

View file

@ -27,6 +27,7 @@ Author(s):
// UNICODE_NULL is a Windows macro definition
const wchar_t UNICODE_BACKSPACE = 0x8;
const wchar_t UNICODE_ESC = 0x1b;
const wchar_t UNICODE_DEL = 0x7f;
// NOTE: This isn't actually a backspace. It's a graphical block. But
// I believe it's emitted by one of our ANSI/OEM --> Unicode conversions.