Oh wait no, I made that wrong. Because for a double click you'll have to press, release and press. With my code it will get reset when ever you release the button.
unsigned int MouseButtonPressed = 0;
//...
if(event.type == sf::Event::MouseButtonPressed)
{
if(MouseButtonPressed < 2)
++MouseButtonPressed;
else
{
MouseButtonPressed = 0;
// Handle Double (or more) Click Event
}
}
else if(event.type == sf::Event::MouseButtonReleased && MouseButtonPressed >= 2)
{
MouseButtonPressed = 0;
}
But keep in mind you won't be able to handle single clicks anymore with that code and the user will be able to make double clicks with an unlimited pause in between.
I guess a better way would be to measure the time difference between two clicks with a
sf::Clock. Whenever someone clicks check if the difference is not too big and then restart the clock.