you first need to check how events work
https://www.sfml-dev.org/tutorials/2.5/window-events.phplower in that page, you'll find this piece of code
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;
}
}
which means: if "right mouse button pressed, do this"
in the place of the "couts", you can add your code to make a "sprite", "rectangle",... appear at the location you wish (event.mouseButton.x, event.mouseButton.y), available from the event itself
sf::Quads is a primitive type, you can create your own shapes with sf::VertexArray, but I advise you to first play with what is already there before diving deeper, it's very complete already!