Yep, i think the keyboard extension is probably your best bet!
We don’t support gamepads out of the box, but if you need the computer to recognize the device as a proper gamepad and not a keyboard, you can probably hack the keyboard package to make that happen. Gamepads are also over HID iirc. The package lives here for reference.
To work on pxt-common-packages locally, you can follow these instructions to set up a local instance of pxt-arcade. One note, those instructions are a little out of date and mention using the command pxt link, but you should actually use npm link