Replace IInputEvent with INPUT_RECORD (#15673)

`IInputEvent` makes adding Unicode support to `InputBuffer` more
difficult than necessary as the abstract class makes downcasting
as well as copying quite verbose. I found that using `INPUT_RECORD`s
directly leads to a significantly simplified implementation.

In addition, this commit fixes at least one bug: The previous approach
to detect the null key via `DoActiveModifierKeysMatch` didn't work.
As it compared the modifier keys as a bitset with `==` it failed to
match whenever the numpad key was set, which it usually is.

## Validation Steps Performed
* Unit and feature tests are 
This commit is contained in:
Leonard Hecker
2023-08-11 16:06:08 +02:00
committed by GitHub
parent e9c8391fd5
commit 5b44476048
54 changed files with 790 additions and 2282 deletions

View File

@@ -45,9 +45,28 @@
</Expand>
</Type>
<Type Name="KeyEvent">
<DisplayString Condition="_keyDown">{{↓ wch:{_charData} mod:{_activeModifierKeys} repeat:{_repeatCount} vk:{_virtualKeyCode} vsc:{_virtualScanCode}}</DisplayString>
<DisplayString Condition="!_keyDown">{{↑ wch:{_charData} mod:{_activeModifierKeys} repeat:{_repeatCount} vk:{_virtualKeyCode} vsc:{_virtualScanCode}}</DisplayString>
<Type Name="_KEY_EVENT_RECORD">
<DisplayString Condition="bKeyDown != 0">↓ rep:{wRepeatCount} vk:{wVirtualKeyCode} sc:{wVirtualScanCode} ch:{uChar.UnicodeChar} ctrl:{(unsigned short)dwControlKeyState,x}</DisplayString>
<DisplayString Condition="bKeyDown == 0">↑ rep:{wRepeatCount} vk:{wVirtualKeyCode} sc:{wVirtualScanCode} ch:{uChar.UnicodeChar} ctrl:{(unsigned short)dwControlKeyState,x}</DisplayString>
</Type>
<Type Name="_MOUSE_EVENT_RECORD">
<DisplayString>pos:{dwMousePosition.X},{dwMousePosition.Y} state:{dwButtonState,x} ctrl:{(unsigned short)dwControlKeyState,x} flags:{(unsigned short)dwEventFlags,x}</DisplayString>
</Type>
<Type Name="_WINDOW_BUFFER_SIZE_RECORD">
<DisplayString>size:{dwSize.X},{dwSize.Y}</DisplayString>
</Type>
<Type Name="_MENU_EVENT_RECORD">
<DisplayString>id:{dwCommandId}</DisplayString>
</Type>
<Type Name="_FOCUS_EVENT_RECORD">
<DisplayString>focus:{bSetFocus}</DisplayString>
</Type>
<Type Name="_INPUT_RECORD">
<DisplayString Condition="EventType == 0x0001">Key {Event.KeyEvent}</DisplayString>
<DisplayString Condition="EventType == 0x0002">Mouse {Event.MouseEvent}</DisplayString>
<DisplayString Condition="EventType == 0x0004">WindowBufferSize {Event.WindowBufferSizeEvent}</DisplayString>
<DisplayString Condition="EventType == 0x0008">Menu {Event.MenuEvent}</DisplayString>
<DisplayString Condition="EventType == 0x0010">Focus {Event.FocusEvent}</DisplayString>
</Type>
<Type Name="til::size">