On Thu Nov 2 11:59:31 2023 +0000, Alexandros Frantzis wrote:
Could you please elaborate on why the first layout in a keymap for each language is treated specially in terms of HKL (i.e., HIWORD is `lang`)? Is there some API (or internal Wine) expectation for this being the case?
The low word of HKL is not dependent on the keyboard layout but instead represents the user locale. For instance on Windows if you change the language to "English UI language" / "French keyboard", you will get a HKL value of 0x040c0409, if you change it to "French UI language" / "English keyboard" it will be 0x0409040c.
In theory, on Windows, you switch user locale at the same time you change the keyboard layout, but we do not support changing user locale in Wine for the moment and it is initialized from `LC_MESSAGES` and not from the keyboard layout. So, I'm getting the current user locale from the default HKL, and using it for all the exposed layouts.