I got this idea from a YouTube video for using folding cupholders as pedals and it works well.
There are a bunch of these on Amazon, but here is the product I used (not affiliate):
https://www.amazon.com/gp/product/B000EDQR4G/ref=ppx_yo_dt_b_asin_image_o03_s00?ie=UTF8&psc=1I can't find the original video, but I'll update if I find it.
The springs are C-702 9/16 x 1 x .054 Utility Comp Spring sold in pairs for a couple of bucks at my local hardware store.
You could use this pedal as a free floating device. The original YouTube video did that. He was demonstrating Pole Position with a Spintrak wheel attachment and just showed the pedal for a few seconds as an aside.
I attached the microswitch by threading 2 zip ties, attached to each other, through the bottom of the cup holder and the lower hole in the switch. I suppose that you could use a glob of slicone adhesive, if you're worried about stability, but I haven't had any issues.
The foot pedal works well for Time Crisis, games like Forgotten Worlds if you don't have a push spinner, and of course arcade racing games, many of which used digital pedals. It's not the greatest for games that require rapid button presses, but using the pedal for firing works fine if you don't have a better option for Tron, Assault, or other trigger stick or top fire joystick games where you can't easily reach a normal button.