Well, taking your advices I have a relay with appropriate socket on the way
https://www.rapidonline.com/Relpol-R...-Relay-61-6063
and I will connect Pul-, Pul+,Dir- and Dir+ and power the relay from a 12V power supply.

I also bought this fancy button
https://www.amazon.co.uk/gp/product/...?ie=UTF8&psc=1 .

The last advice need it is where should I connect the button to make the change of the inputs?

Thank you
Gabi