Skip to content

Commit

Permalink
Ignore spurious Delete key press during info screen
Browse files Browse the repository at this point in the history
When a user reboots the system using Ctrl+Alt+RShift+Delete and keeps
the keys pressed for too long, we might see a spurious Delete key press.
Previously, this immediately exited the info screen.

Thank you to Exxos for reporting this.

Note that spurious Ctrl, Alt and Shift key presses are handled in
ikbd_reset(), but the Delete key press only arrives much later.
  • Loading branch information
czietz committed Apr 10, 2022
1 parent c848d1a commit 32ac917
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion bios/initinfo.c
Expand Up @@ -44,6 +44,9 @@

#if FULL_INITINFO

#define ESC_ASCII 0x1b
#define DEL_ASCII 0x7f

#define INFO_LENGTH 40 /* width of info lines (must fit in low-rez) */
#define LOGO_LENGTH 34 /* must equal length of strings in EmuTOS logo */

Expand Down Expand Up @@ -374,6 +377,10 @@ WORD initinfo(ULONG *pshiftbits)
* pause for a short while, or longer if:
* . a Shift key is held down, or
* . the user selects an alternate boot drive
*
* if the user reboots using Ctrl+Alt+Shift+Delete,
* and keeps the keys pressed for too long, we might see a
* spurious Del key press, and ignore it.
*/
while (1)
{
Expand Down Expand Up @@ -410,8 +417,12 @@ WORD initinfo(ULONG *pshiftbits)
int c = LOBYTE(bconin2());

c = toupper(c);
if (c == DEL_ASCII) {
/* eat spurious Delete key press */
continue;
} else
#if WITH_CLI
if (c == 0x1b) {
if (c == ESC_ASCII) {
bootflags |= BOOTFLAG_EARLY_CLI;
} else
#endif
Expand Down

0 comments on commit 32ac917

Please sign in to comment.