Is there any way we can convert an sf::keyboard::key (say, A) into its char/string name counterpart?Not with SFML, but with Thor: InputNames.hpp (http://www.bromeon.ch/libraries/thor/v2.0/doc/_input_names_8hpp.html)
But that means I have to go through all those horrible CMake compiling experiences I had with SFML a few years back again :(Is there any way we can convert an sf::keyboard::key (say, A) into its char/string name counterpart?Not with SFML, but with Thor: InputNames.hpp (http://www.bromeon.ch/libraries/thor/v2.0/doc/_input_names_8hpp.html)
But that means I have to go through all those horrible CMake compiling experiences I had with SFML a few years back again :(It's only horrible if you don't read the tutorial :P
On an unrelated note, (correct me if I'm wrong, but) does thor also handle texts?No, there is nothing specific for sf::Text. I once posted a workaround for a SFML bug here, but it's well possible that it has been fixed meanwhile.
It's only horrible if you don't read the tutorial :PWell back then there were version differences (I found SFML via a tutorial referring to v1.6, and back then the site's tutorial page was still the old one) so I guess that's what made stuff so complicated :P
Setting Thor up is explained step by step, you just have to read carefully. On Windows, you can also use the Nightly builds (everything is described on the download page).
No, there is nothing specific for sf::Text. I once posted a workaround for a SFML bug here, but it's well possible that it has been fixed meanwhile.Weird, I was sure someone asked about the lack of wordwrapping in sfml and one of the solutions was using an external library...
Hello SFML community!
I was wondering about implementing customizable controls for a game I'm currently working on, and this question somewhat popped up on my mind: Is there any way we can convert an sf::keyboard::key (say, A) into its char/string name counterpart?
In order to create an actual options/controls screen, I'd need to be able to convert a sf::keyboard::key into a string of what it represents, which will be shown to the screen. Currently though, the only thing I can think of is manually represent each code as a specific char or string (using a ton of ifs to assign sf::keyboard::key::A into "A", sf::keyboard::key::Lshift into "Left Shift", etc).
I'm pretty sure i'm not the first to face this problem, so is there a better alternative to this?
Thanks in advance :)