OvmfPkg/VirtioInputDxe: invert condition for matching KEY_PRESSED events

Technically, beyond KEY_PRESSED and its inverse KEY_RELEASED, a third
type of event is possible for autorepeated keystrokes.  Invert the
condition on Event->Value to handle autorepeat events as (successive)
key presses rather than repeated releases (essentially ignoring them).

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-31 00:54:00 +03:00 committed by mergify[bot]
parent 49583d582b
commit aba8628e17
2 changed files with 3 additions and 2 deletions

View file

@ -115,7 +115,8 @@ typedef struct {
CR (a, VIRTIO_INPUT_DEV, AbsolutePointer, VIRTIO_INPUT_SIG)
// Bellow candidates to be included as Linux header
#define KEY_PRESSED 1
#define KEY_RELEASED 0
#define KEY_PRESSED 1
//
// VirtioInput.c

View file

@ -191,7 +191,7 @@ VirtioKeyboardHandleEvent (
IN VIRTIO_INPUT_EVENT *Event
)
{
if (Event->Value == KEY_PRESSED) {
if (Event->Value != KEY_RELEASED) {
// Key pressed event received
Dev->KeyActive[(UINT8)Event->Code] = TRUE;