So Windows has a GetKeyboardLayout function that returns:
The return value is the input locale identifier for the thread. The low word contains a Language Identifier for the input language and the high word contains a device handle to the physical layout of the keyboard.
Cool. Great. Fantastic.
That'll give me exactly what I need to see if something is QWERTY, QWERTZ, AZERTY or Whatever.
Right?
Well... No.
I know, I was just as surprised.
The French being, well, French, have their own AZERTY layout, while the Dutch, wanting so desperately to be American, stuck with QWERTY.
Fine. Whatever. These resolve as expected.
Enter Belgium, the tiny country sandwiched between France and The Netherlands.
Being about 60% Dutch-speaking and 40% French-speaking1, of course the Belgian keyboard layout is AZERTY as well.2
And this is where the fuckup happened.
Because what does GetKeyboardLayout return for one of these?
Go on.
Guess.