As promised, full instructions for building your own USB footpedal using a low-cost Raspberry Pi Zero and a cheap standard footswitch. Can send both keystrokes and MIDI messages, so you can scroll through sheet music, or use it to send any MIDI messages you like.
Easily extensible to support analogue expression pedals as well. If you've looked at the incredible cost of a MIDI expression pedal (i.e one that sends MIDI via USB) well, this is a lot cheaper.
https://stash.reaper.fm/v/33149/footpedal.zip