Why you really need that when you can do most stuff with left/right mouse buttons. But in case if you really need that then you can use this option
And then using rotate context toolbar, you can play around with your part.
Other option is "Move with Triad". Right click on a component and select "Move with Triad"
And then you would see arrow/rings to move/rotate the component
Solidworks doesn't need extra lines in the code for something you can do by simply moving the inserted part with the right mouse button. Just select the part you want moved and right click a face and move or rotate it.