You need a stepper motor controller that acts on keys.
grbl_ESP32 is a grbl based controller that can execute gcode macro's when a switch is activated. You could use 2 switches to activate 2 macros. A macro is a simple gcode command line that moves the stepper to a position at a defined rate like "G91 X100 F30" move the X-axis +100 mm at 30mm/min.
Have a look at their WiKi https://github.com/bdring/Grbl_Esp32/wiki/Macro-Button-Feature