I found that using sf::Event::MouseButton.X and sf::Event::MouseButton.Y does not give the correct mouse position. The sf::Mouse class does though.
#include <iostream>
#include <SFML/Graphics.hpp>
using namespace std;
int main()
{
sf::RenderWindow TestWindow(sf::VideoMode(800, 600, 32), "Mouse Cursor Position Test");
while (TestWindow.IsOpened())
{
sf::Event TestEvent;
while(TestWindow.PollEvent(TestEvent))
{
if (TestEvent.Type == sf::Event::Closed)
TestWindow.Close();
if (TestEvent.Type == sf::Event::MouseMoved)
{
cout << "Method 1: (" << TestEvent.MouseButton.X << ", " << TestEvent.MouseButton.Y << ")\n";
cout << "Method 2: (" << sf::Mouse::GetPosition(TestWindow).x << ", " << sf::Mouse::GetPosition(TestWindow).y << ")\n\n";
}
}
TestWindow.Clear();
TestWindow.Display();
}
}