Is this really your code?? Obviously not, Event.Type cannot be both TextEntered and KeyPressed.
I'd like to see your real code please.
Sad to say Mr Laurent, it was my original code. First, I didn't realize that TextEntered was an event type of its own but thought it was an event fired by key down. That code was buggy to say the least...
I did like this, in code and pseudo code to keep it short.
In this way, I' get the swedish wovels but reject anything but letters. I never used:
if ( Event.Text.Unicode < 0x80 ) // it's printable
Since I want a single word for hang man game (hardly more than 255 letters long
, it is sufficient for me.
lower2upper(char letterin); //= function to make an a char to an A char.
int i=0;
char tempchar;
char secretword[255];//the word you want to find out
char alphabet[30]{all the letters in the alphabet A-Ö and - for combined words};
if ( Event.Type == sf::Event::TextEntered)
{
tempchar= ((char)Event.Text.Unicode;
tempchar = lower2upper(tempchar);
if (the charexists in the alphabet[]) //pseudocode
{
secretword
= tempchar;
i++
}
}