Hello guys !
I have a little question about mouse event : I do not want to be in the polling loop (that's cool because actually, the mouse can be handled separatly). However, when I clic on the window, the meter counting the number of clics don't increase by 1 but increase depending on how long I let the mouse button pressed.
Question : is it possible to get only once in the loop ( thus triggering the event on the clic and not on the pressed action ) ?
Here is the code :
if (sf::Mouse::isButtonPressed(sf::Mouse::Left))
{
sf::Vector2i localPosition = sf::Mouse::getPosition(window);
if ((myElectrode->getShape()).isPositionInside((sf::Vector2f) localPosition)) // the function always return true at the moment
{
count++;
string windowTitle = to_string((long double) count);
window.setTitle(windowTitle);
}
}
Thanks in advance,
Gabriel.