mirror of
https://github.com/tianocore/edk2
synced 2026-08-27 00:23:19 -04:00
OvmfPkg/VirtioInputDxe: do not set ScanCode together with UnicodeChar
EFI_INPUT_KEY's ->ScanCode and ->UnicodeChar are mutually exclusive. The value space of ->ScanCode only includes representations of keys that are not representable in Unicode (F1-F10, Esc, arrows etc.) and vice versa. Furthermore, the integer representations of those fields overlap. As such, writing ->UnicodeChar values into ->ScanCode is invalid and produces bogus EFI_INPUT_KEYs that would compare inequal to any well-formed values that might be passed into e.g. RegisterKeyNotifyEx. Do not set ->ScanCode when a Unicode value is produced for a printable character. Signed-off-by: Ivan Shapovalov <intelfx@intelfx.name> Tested-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@futurfusion.io>
This commit is contained in:
parent
e9ca367750
commit
cd7c5fe467
1 changed files with 0 additions and 2 deletions
|
|
@ -167,10 +167,8 @@ VirtioKeyboardConvertKeyCode (
|
|||
|
||||
default:
|
||||
if (Dev->KeyActive[KEY_LEFTSHIFT] || Dev->KeyActive[KEY_RIGHTSHIFT]) {
|
||||
Key->ScanCode = MapShift[Code];
|
||||
Key->UnicodeChar = MapShift[Code];
|
||||
} else {
|
||||
Key->ScanCode = Map[Code];
|
||||
Key->UnicodeChar = Map[Code];
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue