SFML community forums
Help => General => Topic started by: prchakal on December 11, 2008, 07:34:08 pm
-
How to support portuguese keyboard?
Some key are different of default of sfml.
How support it? Keys like it (ç/Ç/¨/ã/á/....)
-
If you're talking about text input, then just use sf::Event::TextEntered which delivers Unicode and not sf::Event::KeyPressed.
If you really need these keys for the key press event, then I'm sorry I have no solution yet. But it's planned, probably for the 1.5 version.
-
I have tested the project called "IMGUI" (http://www.sfml-dev.org/wiki/en/projects) and i compile here and it support this letters and others too...
But on my project, the letters are some blank spaces...
Im read all the code and i get unicode char with the same method, but i dont know what happen...
-
Hi,
I solve the problem.
I dont know wy, but when you have your text in WSTRING and put on sf::String the unicode is lost.
So i convert the WSTRING atributes of my classes to STRING and it function normals, accepting all portuguese letters.
Ty.
-
You should show us the relevant parts of your code, it's hard to help you with so few details.
-
Dont need more, i have solved.
But u can try it:
wstring test;
test = L"coração"; // <-error
sf::String textBox;
sf::Font font;
if (!font.LoadFromFile("dados\\fontes\\tahoma.ttf"))
{
//failed
}
textBox.SetText(test);
textBox.SetSize(12);
textBox.SetFont(font);
Conclusion, you can put in WSTRING some portuguese letters, or if you force with cast, occur the same problem.
Solution: use only STRING on SetText.