Here is an enclosure I built for a 3d analog joystick to control marlin (In my case a lowrider CNC but should work for any marlin machine).
You can find a discussion of the mod here: https://forum.v1engineering.com/t/joystick-managed-by-marlin/10863
I reccomend hacking a network cable in half and using a female-to-female RJ45 jack to make the joystick pluggable.
Parts list:
JH-D300X-R3 https://www.amazon.com/gp/product/B07CVGPMDP
RJ45 female to femal keystone jack: https://www.amazon.ca/gp/product/B016O9SXCM
DPST Switch Mounting Size: 26 x 21.5mm https://www.amazon.ca/gp/product/B07MV52SRM
An LED and 180Ohm resistor
Category: ElectronicsThe author marked this model as their own original creation. Imported from Thingiverse.