Beginner: How many inputs?

I have searched for code that
can send these gamepad signals in arduino.

But I have not find any.

Can someone please show me a complete code for an arduino with one button that sends HID/gamepad-signals to Mac. Both digital and analog. Please? Just to give me a first direction.