Hello, I always wanted to post ideas on here but never went through with it because I often found similar ideas posted by other users already on there and in the best case scenarios they were either dismissed as unimportant or didn't "match the Multimedia Library idea" (which is a shame for such a wonderful library
but so be it)
However, I made this account because I didn't find a request QUITE like this after about 40 minutes of research and I hope my prayers to the great and powerful Laurent will not be dismissed
The situationI made a simple program that initialise a 3D camera with MMO-like controls, everything works fine.
sf::Event::MouseButtonPressed works perfectly
sf::Event::TextEntered works perfectly also
sf::Event::KeyPressed SEEMED to work perfectly until now
Then I realised TextEntered returned the unicode value of the character being entered
(Shift + a = A, obviously) which is good
KeyPressed returns an enum like "sf::Keyboard::A" which is equal to a random value like "0"
(when A is pressed, the event is pulled) which works fine in most cases
The problemIf I want to implement my own keybinding, I want to know the unicode value of the keys being pressed as opposed to some arbitraty value like "A = 0" and TextEntered works for most keys but will mess up while holding modifiers or even have unwanted effects when the user try to use "^" as a key or any other foul unexpected inputs that are differed and depends on the next key
A long story made short-ishSDL USED to have a method to get EITHER the 'unicode' (event.key.keysym.unicode, take in account modifiers like TextEntered) or 'sym' (event.key.keysym.sym, doesn't disregard modifiers but rather consider them their own keys so Shift will return its own Unicode similar to how KeyPressed acts)
After a bit of dancing around forums I arrived to the conclusion "sf::Keyboard::A" make the code look nice but it would be much better if the program launched a KeyPressed event when ANY key is pressed with a way to get its Unicode value (Ctrl = 26, etc.)
Ex:
if (event.key.code == sf::Keyboard::W) { } //W
if (event.key.sym == 26) { } //Ctrl (Ctrl is already taken into account in SFML but not other characters like "^")
This would be helpful not only for custom Keybinding but also work around the limited Enum we have right now wouldn't it? Please feel free to discuss about this ask me questions or tell me how I am wrong instead of just "I don't see the point" D: