OvmfPkg/VirtioInputDxe: handle Ctrl-Alt-Del

Signed-off-by: Ivan Shapovalov <intelfx@intelfx.name>
Tested-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@futurfusion.io>
This commit is contained in:
Ivan Shapovalov 2026-07-27 14:19:37 +03:00 committed by mergify[bot]
parent 1bc9b85452
commit d98a39d4ce
2 changed files with 12 additions and 0 deletions

View file

@ -32,6 +32,7 @@
DebugLib
MemoryAllocationLib
UefiBootServicesTableLib
UefiRuntimeServicesTableLib
UefiDriverEntryPoint
UefiLib
VirtioLib

View file

@ -13,6 +13,7 @@
#include <Library/DebugLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/UefiRuntimeServicesTableLib.h>
#include <Library/UefiLib.h>
#include "VirtioInput.h"
@ -441,6 +442,16 @@ VirtioKeyboardHandleEvent (
// Key pressed event received
Dev->KeyActive[(UINT8)Event->Code] = TRUE;
// Handle Ctrl-Alt-Del (in any order)
if (
(Dev->KeyActive[KEY_LEFTCTRL] || Dev->KeyActive[KEY_RIGHTCTRL]) &&
(Dev->KeyActive[KEY_LEFTALT] || Dev->KeyActive[KEY_RIGHTALT]) &&
Dev->KeyActive[KEY_DELETE]
)
{
gRT->ResetSystem (EfiResetWarm, EFI_SUCCESS, 0, NULL);
}
//
// Update toggle state
// This must happen before EFI_KEY_DATA is populated, since the toggle state