Hi there I'm working on a textbox where the user enters its name. The problem I'm having is that a soon as i press a key it writes out the character about five times in a row. That's why I just want it to enter a character when the user releases the key.
if(mainEvent.type == sf::Event::TextEntered)
{
char c = static_cast<char>(mainEvent.text.unicode);
if(c >= 'A' && c <= 'z')
{
// Add the new character to the string
str = c;
// Set the string to name
nameString += str;
name.setString(nameString);
cout << nameString;
}
}
Thanks in advance :)