X11 keycodes are just Linux keycodes + 8 nowadays according to evdev or libinput drivers, and we can avoid innacurate reconstruction in the most common case.
Opening this as a draft for now, to show where I'd like to go with https://gitlab.winehq.org/wine/wine/-/merge_requests/2062.