Hello all,
i am making a text box, and a small problem occured.
if( event.Type == sf::Event::KeyPressed )
{
if( event.Key.Code == sf::Key::Back )
{
text.erase( text.size( ) - 1 );
}
else if( event.Key.Code == sf::Key::Return )
{
text += "\n";
}
}
else if( event.Type == sf::Event::TextEntered )
{
text += ( char )event.Text.Unicode;
}
The problem is that sf::Key::Back is ignored, when i type text. I figured out that its the problem with sf::Event::TextEntered because it takes backspace as text entered( ? ). How can i avoid that?