I have got the following keyboard layouts in system:
I created the following QWERTZ / AZERTY detection function:
bool bIsAzertyKeyboard = false;
bool bIsQwertzKeyboard = false;
bool bIsQwertyKeyboard = false;
void DetectKeyboardType() {
bIsAzertyKeyboard = false;
bIsQwertzKeyboard = false;
bIsQwertyKeyboard = true;
switch (PRIMARYLANGID(LOWORD(GetKeyboardLayout(0))))
{
case LANG_FRENCH:
bIsQwertyKeyboard = false;
bIsAzertyKeyboard = true;
break;
case LANG_GERMAN:
bIsQwertyKeyboard = false;
bIsQwertzKeyboard = true;
break;
}
}
Unfortunately, I'm getting troubles detecting for the correct keyboard language, when it's a keyboard installed under a different language.
For example:
bIsQwertzKeyboard is true only when the selected keyboard language is DEU. When I select ENG DE, the Y and Z are getting inverted, but bIsQwertzKeyboard is false.
How can I detect for the QWERTZ keyboard in all cases?
