61
Graphics / Wwedish vowels in sf::Event::TextEntered, problem
« on: October 07, 2011, 01:02:30 pm »
Environment
VC++ 2010 Express
Windows 7 enterprise 64
SFML 1.6
I have a simple hangman game going on, but I've run into a nasty problem. In Sweden, we have three vowels not used in the english language, but could be called Å/AO, Ä/AE and Ö/OE.
I have changed VC++ to use swedish language by adding
locale swedish("swedish");
locale::global(swedish);
in the main code.
The wovels are placed on the keyboard as key 1 (Ö) and 2 (Ä) right of "L" and the (Å) key above those two.
If I write this code, I'll get the swedish wovels, but all other keys appear too.
If I use this code instead to sort the other keys away, I won't get the swedish vowels
I assume the "Unicode < 0x80" is the culprit to the behaviour. I just can't figure out what to write instead. Is there a solution to this problem?
VC++ 2010 Express
Windows 7 enterprise 64
SFML 1.6
I have a simple hangman game going on, but I've run into a nasty problem. In Sweden, we have three vowels not used in the english language, but could be called Å/AO, Ä/AE and Ö/OE.
I have changed VC++ to use swedish language by adding
locale swedish("swedish");
locale::global(swedish);
in the main code.
The wovels are placed on the keyboard as key 1 (Ö) and 2 (Ä) right of "L" and the (Å) key above those two.
If I write this code, I'll get the swedish wovels, but all other keys appear too.
Code: [Select]
if (Event.Type == sf::Event::KeyPressed)
{
if ( Event.Type == sf::Event::TextEntered )
cout << "Char= " << (char)Event.Text.Unicode <<endl;
}
If I use this code instead to sort the other keys away, I won't get the swedish vowels
Code: [Select]
if (Event.Type == sf::Event::KeyPressed)
{
if ( Event.Text.Unicode < 0x80 ) // it's printable
{
if ( Event.Type == sf::Event::TextEntered )
cout << "Char= " << (char)Event.Text.Unicode <<endl;
}
}
I assume the "Unicode < 0x80" is the culprit to the behaviour. I just can't figure out what to write instead. Is there a solution to this problem?