@afrantzis There is a remaining problem, NtUserGetAsyncKeyboardState limits itself to 256 virtual keys, discarding the extended scan code info. So it results on my down arrow key (e0 50) being kept repeated while being focused out, and when focused in, pressing the arrow again is needed to stop the repeat.
I believe to solve this we should either limit/convert the key handling to the 256 default scan code, or locally memorize in winewayland the pressed keys or create a version of NtUserGetAsyncKeyboardState with extended scan code info.