mirror of
https://github.com/tianocore/edk2
synced 2026-08-27 00:23:19 -04:00
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:
parent
49583d582b
commit
aba8628e17
2 changed files with 3 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue