When pressing the backspace or delete key I don't get TextEntered events on Mac OS X Lion.
I do get KeyPressed events, so it is not a big issue.
Example code:
while (App.isOpen())
{
sf::Event event;
while (App.pollEvent(event))
{
if (event.type == sf::Event::Closed)
App.close();
if (event.type == sf::Event::TextEntered)
{
if (event.text.unicode == 8) // 8 = backspace
{
// The program never passes here
}
else if (event.text.unicode == 127) // 127 = delete
{
// Neither does is pass here
}
}
if (event.type == sf::Event::KeyPressed)
{
if (event.key.code == sf::Keyboard::Back)
{
// This works
}
else if (event.key.code == sf::Keyboard::Delete)
{
// This also works
}
}
}
App.clear();
App.display();
}
Is this a problem with sfml or is it just mac os x that isn't sending those events?