I used old version of joystick library for write this code.
you have to use Arduino Leonardo to run this code.
By default, 11 buttons, x-axis and y-axis are defined.
You can change the input types and numbers according to you.
The pins to be used are specified in the code.