I was hoping that I've missed something..
Exactly
..you always get the real state of the mouse, even if it is moved, pressed or released when your window is out of focus and no event is triggered.
sf::Mouse (http://www.sfml-dev.org/documentation/2.0/classsf_1_1Mouse.php#ab647159eb88e369a0332a9c5a7ba6687)
Why donĀ“t you handle the mouse events?
if (event.type == sf::Event::MouseButtonPressed)
{
if (event.mouseButton.button == sf::Mouse::Right)
{
std::cout << "the right button was pressed" << std::endl;
std::cout << "mouse x: " << event.mouseButton.x << std::endl;
std::cout << "mouse y: " << event.mouseButton.y << std::endl;
}
}
Code from the Events tutorial (http://www.sfml-dev.org/tutorials/2.0/window-events.php)