How can you detect an AZERTY / QWERTY keyboard in C++ on windows?

2

How do you detect an AZERTY / QWERTY keyboard in C++ on windows?

I need this to initially choose WASD (qwerty) or ZQSD (azerty) for movements in my game.

Thanks a lot!

Valmond

Posted 2015-05-28T10:49:14.110

Reputation: 1 485

Have you tried https://msdn.microsoft.com/en-us/library/windows/desktop/ms646296(v=vs.85).aspx ?

– Amartel – 2015-05-28T11:42:58.420

The question makes no sense, the keyboard layout only determines what specific WM_CHAR message is generated when the user presses a key. The virtual key codes passed to WM_KEYDOWN do not depend on the keyboard layout. – Hans Passant – 2015-05-28T12:31:36.527

Well it makes perfectly sense to me. I always have to reconfigure the key-bindings in new games because I'm using an AZERTY keyboard and with the knowledge (QWE... or AZE...) I can fix that in my game so that other players won't have to do that. – Valmond – 2015-05-28T14:40:52.803

@Amartel, no. I'd prefer to know the specific layout (or physical key<->wchar_t if that isn't possible), I'll use your trick though if I can't find out and add like all languages I can think of but obviously that's a sub-optimal solution. Thanks anyway! – Valmond – 2015-05-28T14:43:14.433

No answers