dimanche 24 juillet 2016

SFML event::TextEntered not working properly

I'm making a school project about image modifying and I'm using sfml to make something like a console but a bit more "beautiful".

while (window.isOpen()) {
        Event event;
        while (window.pollEvent(event)) {

            if (event.type == Event::Closed)
                window.close();
        }
        if (event.type == sf::Event::TextEntered)
        {
            //display text on screen
        }
    }

The problem is that when i press a certain key shortly on the display it appears like I've hold the key for a long period of time...

Example: pressing G, expecting to see only 1 G on the screen but on the screens there appears like 20 G.

Aucun commentaire:

Enregistrer un commentaire