On Mon Nov 6 12:38:40 2023 +0000, Rémi Bernon wrote:
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.
Sorry, I got it the other way, edited to swap low / high word.
If you meant the `layout_id` part, this is the mechanism used by Windows to support multiple layouts for the same input language. The first, or single, layout for a given input language uses the keyboard language in its HKL. Additional layouts have an additional indirection, through the "Layout Id" property which is, both available in the HKL with the highest nibble set (0xf000 prefix), and in the registry where one can use this unique id to lookup the layout and find its input language / name back.