Managing the events received from the user is a really important topic. SFML provides us with two different approaches. The first is by polling the events received from a
sf::Window instance, and the other is by checking the state in real time of an entry.
First of all, what is an event?
Generally, an event is an object that is triggered when something changes/happens. They are OS-dependent, but SFML provides us with a nice object to handle them in an OS-independent way. This is the
sf::Event class. This class deals with a vast number of events, as follows: