Use sf::Event to read when the mouse button is pressed. See detailed description (http://www.sfml-dev.org/documentation/2.3.2/classsf_1_1Event.php).
while window is open
handle window events (if piece is selected and mouse was pressed, update position)
other updates go here...
end while