The way I do it is on my W key (my IWT key) I have two copies of it.

W -> Pressed = enable click-to-move -> all other, then send the interact-with-target key -> all other
W -> Released = disable click-to-move -> all other

This makes it so they aren't always enabled so random right-clicks in the world won't send them off into the wild blue yonder. If that's not detailed enough, holler and I'll explain whatever isn't obvious to you.