SFML community forums
Help => General => Topic started by: ryandaniels on April 11, 2010, 03:50:52 am
-
Probably a very simple question, but I've been searching for a while and haven't been able to answer it.
In my program, I need to get text from the user. I didn't have any problems until I tried typing the '-' character, which returned a value of 276. According to the Unicode tables I've seen, it should have been 45. Quite a few other characters also appear to not match up. So, I'd like to know if there is a different table that matches up with these different values, or simply a way to convert.
Also I'd like to know if there is an existing way to find what a character should be if pushed with the shift key down. (Minor, already have a solution, just somewhat messy)
-
Can you show the relevant code? Which other characters give you the wrong value?
Also I'd like to know if there is an existing way to find what a character should be if pushed with the shift key down
No. Why do you need to do that??
-
Can you show the relevant code? Which other characters give you the wrong value?
Also I'd like to know if there is an existing way to find what a character should be if pushed with the shift key down
No. Why do you need to do that??
Upon attempting to copy-paste the code, I discovered my mistake; I had wrongly figured that Event.Text.Unicode could be used if the event was a keypress event. I hadn't been doing this at first, I did it to on a whim to fix an exception, and it seemed to worked, so I forgot about it.
As for your second comment, that was sorta what tipped me off to what I was doing wrong, I thought sfml might already appropriate for when the shift key was pressed, and your incredulity at my question suggested this even more.
In short, everything is working now, thank you.