Как узнать раскладку:
C++ (Qt)
#ifdef Q_WS_WIN
#include <windows.h>
#endif
QString getTheCurrentLanguageKeyboardLayouts()
{
const int hexKeyLanguageRussian = 0x419;
const int hexKeyLanguageEnglish = 0x409;
QString name = QApplication::keyboardInputLocale().name();
#ifdef Q_WS_WIN
switch( LOWORD ( GetKeyboardLayout( 0 ) ) )
{
case hexKeyLanguageRussian:
name = "ru";
break;
case hexKeyLanguageEnglish:
name = "en";
break;
}
#endif
return name;
}