Here's a
simpler button selection structure.
There is an example for joystick buttons and a second example for custom controls through the Cypress I/O.
It just has a case for each button on the joystick.
I'd recommend making a control of each value you put inside each case, so you can adjust them all in one place on the front panel instead of digging through the cases.