well, for me, when I move the mouse the square turns faster
my guess is that the default spinning speed depends on the default keyboard key delay. each signal sent by the keyboard generates one single event.
but when you move the mouse, lots of other events are also generated. and since the arrow key is being hold down, your code recognizes
if (sf::Keyboard::isKeyPressed(sf::Keyboard::Left)) as true and rotates the square by the number of new events generated. I don't know if I made myself clear.
anyway, if you just want to check is a key is being holded down, you don't need events for that. just move the
if (sf::Keyboard::isKeyPressed(sf::Keyboard::Left))//or Right, with the rotation commands
outside the
while (window.pollEvent(event)), but keep it inside the
while (window.isOpen()) loop.