if((sf::Mouse::isButtonPressed(sf::Mouse::Button::Left))
&& (sf::Event::MouseMoved))
{
shape.setPosition(sf::Event::MouseMoveEvent().x,sf::Event::MouseMoveEvent().y);
window.clear(sf::Color(128,128,128));
window.draw(shape);
window.display();
}
It doesn't look like what's in the tutorial, not even remotely. In this small part of code, your way to check the type of the event is wrong, and your way to get the positions of the mouse is also wrong. And you don't want to put your clear/draw/display inside the event loop (if you want to know what a basic game loop is supposed to look like, read and understand the
first part of the graphics tutorial).
Why didn't you take a look at the
link I gave? It directly points to what you have to do to get mouse coordinates, and there's only 3 lines of code so it's easy even for copypasters.
Seriously, why does your code look like nothing you can find in the tutorial? Why don't you read them after everyone told you to? There isn't a tutorial where you can find "sf::Event::MouseMoveEvent().x".