In this guide, we'll focus on a different approach: building custom controllers to play Aracde games in the browser.
You can choose from a number of microcontrollers supported in Microsoft MakeCode for Circuit Playground Express or MakeCode Maker. The Adafruit Circuit Playground Express has all kinds of sensors, buttons, and capacitive touch pads to make keypresses. But even the Adafruit Feather Express or Trinket M0 can be used in MakeCode Maker.
Tailor your needs to the boards available or have on hand.
Adafruit carries a huge array of switches, including arcade buttons. You can use alligator clips or wires to connect them to your microcontroller. Here are just two of the dozens of products you can choose from on adafruit.com.