Hello everyone, please excuse the simplicity of this question, but I'm new to electronics and I've been scratching my head for a couple of days. I have a borad through which I can control two nema steppers with joystick modules, but due to space constrains, I can only use one joystick in my panel, so I was thinking of splitting the joystick X and Y cables into two different pairs (each pair corresponding to each one of the motors) and then use a pushbutton to select which one of the motors I want to control and display the one currently being controlled. Question is what exactly should I use to do this? The piece I'm missing is the one with question marks. Please note that the wires are just a representation:
Also, I don't need code or anything because I want to learn, I just would like to know what I need to keep learning.
Thanks a lot in advance!