As it's analog, you'll need two analog reading through pins on the microcontroller to determine X and Y. Acquiring an additional electronic input will Allow you to examine the swap. Note that this instance assumes you are using an Arduino-compatible board that supports the Joystick library, like the Arduino Leonardo https://dicez554lml4.mappywiki.com/user