1
Window / How to detect keyboard layout?
« on: March 07, 2017, 04:23:02 pm »
I'm using the latest version of SFML with C++. I want to program my controls so that they change depending on keyboard layout. I have 2 questions:
1.) How can I detect the layout of the users' keyboard (QWERTY, AZERTY, Dvorak, etc)? (I do not want to ask the player for their keyboard layout. It's not professional.) If SFML can't help (I don't see anything in the docs), could you tell me a cross platform way of doing it (ideally with user-friendly documentation)?
Note: Mac OS is not supported in https://github.com/SFML/SFML/pull/568. So this is not a solution.
2.)Let's say, (for the sake of argument), I'm using AZERTY and I press Q. Will this activate sf::Keyboard::isKeyPressed(sf::Keyboard::Q)? Or will it activate sf::Keyboard::isKeyPressed(sf::Keyboard::A) (A being the key in QWERTY that is in the same place as Q in AZERTY)?
Thanks! Sorry if I seem demanding at all; I'm in quite a muddle. I'd greatly appreciate your help .
1.) How can I detect the layout of the users' keyboard (QWERTY, AZERTY, Dvorak, etc)? (I do not want to ask the player for their keyboard layout. It's not professional.) If SFML can't help (I don't see anything in the docs), could you tell me a cross platform way of doing it (ideally with user-friendly documentation)?
Note: Mac OS is not supported in https://github.com/SFML/SFML/pull/568. So this is not a solution.
2.)Let's say, (for the sake of argument), I'm using AZERTY and I press Q. Will this activate sf::Keyboard::isKeyPressed(sf::Keyboard::Q)? Or will it activate sf::Keyboard::isKeyPressed(sf::Keyboard::A) (A being the key in QWERTY that is in the same place as Q in AZERTY)?
Thanks! Sorry if I seem demanding at all; I'm in quite a muddle. I'd greatly appreciate your help .