I need a command to be executed as long as the left mouse button is being held down.
Look at table 7-1 of the docs. There are events that specify motion while the button is pressed, <B1-Motion>
, <B2-Motion>
etc.
If you're not talking about a press-and-move event, then you can start doing your activity on <Button-1>
and stop doing it when you receive <B1-Release>
.