Treat ASCII 0x7F as backspace for TtyTerm terminals

Treat ASCII 0x7F as backspace, rather than delete, for TTY terminals.  This
better matches the default Linux terminal settings that are used when connecting
to a simulated platform using xterm or a similar terminal program.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Roy Franz <roy.franz@linaro.org>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Feng Tian <feng.tian@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17896 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Roy Franz 2015-07-09 06:24:15 +00:00 committed by lersek
parent 6e3227c88c
commit 34098df212
1 changed files with 8 additions and 2 deletions

View File

@ -1561,8 +1561,14 @@ UnicodeToEfiKey (
}
if (UnicodeChar == DEL) {
Key.ScanCode = SCAN_DELETE;
Key.UnicodeChar = 0;
if (TerminalDevice->TerminalType == TTYTERMTYPE) {
Key.ScanCode = SCAN_NULL;
Key.UnicodeChar = CHAR_BACKSPACE;
}
else {
Key.ScanCode = SCAN_DELETE;
Key.UnicodeChar = 0;
}
} else {
Key.ScanCode = SCAN_NULL;
Key.UnicodeChar = UnicodeChar;