*This requires an chrome extension to use: https://chrome.google.com/webstore/detail/scratch-addons/fbeffbjdlemaoicjdapfpikkikjoneco?hl=en* Click the gamepad icon next to the fullscreen button. If it isn't already preset, go inside the project and modify them to fit the preset, or make your own.
This is currently set-up to use with a Nintendo Switch controller (that's what I have handy) To get the proper addon, click the "Scratch Addons "extension button and click "Addons" and search "gamepad", then enable Gamepad Support.