On Fri May 24 10:33:28 2024 +0000, Rémi Bernon wrote:
In order to avoid having to duplicate the scan2vk mapping in the drivers, I would suggest maybe extending the `NtUserSendHardwareInput` call, for instance with a custom flag and add support for syncing the full keystate, passing the state array in lparam (and some dummy INPUT_KEYBOARD structure). You could then probably re-use the `send_hardware_message` request HID report data to pass the new vkey state to wineserver, and handle the key updates there, that would save some `get_async_keystate` roundtrips.
If the driver needs to pass vkeys (that's what I understood by 'state array'), it already needs to do some translation along the lines of `dlls/win32u/input.c:map_scan_to_kbd_vkey`. Perhaps we can directly send scan codes instead and win32u can perform the translation to vkey[256] itself?:
`NtUserSendHardwareInput(SEND_HWMSG_SCANCODES, lparam=<array of pressed scancodes>)`