
I salvaged an old 3-switch dictation-machine foot switch from a throw-out box in a storeroom at a place I was servicing a computer. Then I dug out an old 3-button USB boy-mouse* from my own junk-trunk and set about combining the two.
Soldering the wires from the pedal switches to where the original mouse-button switches had been was pretty simple, then I used some old rubber feet to make a secure place within the pedal enclosure to hold the mouse circuit board. The hardware side was finished in under an hour.

Software was trickier and involved much hunting around on the internet and asking friends, who in turn went off hunting around the internet too. I am using Debian GNU/Linux, so if you want to configure a mouse as a keyboard extension in Windows, I can't help you there - maybe there is a shareware utility or something. However, MacOS users might find some useful starting points here as MacOS is built on BSD which is a close-cousin of Linux. This page only describes strangling Linux until it works acceptably.
First, I had to set up my xorg.conf file with the following section in with the rest of the HID stuff:
Section "InputDevice"
Identifier "Pedal" # foot-pedal from old mouse
Driver "mouse"
Option "Device" "/dev/input/mouse1"
# Option "Name" "USB Mouse"
# Option "ProductID" "0x1205"
Option "Protocol" "ExplorerPS/2"
Option "SendCoreEvents" "true"
Option "Emulate3Buttons" "false"
# Option "Button1" "page_up" # if ONLY it was THIS easy
# Option "Button2" "page_down"
# Option "Button3" "home"
EndSection
This made the system recognise the mouse (assuming the pedal has shown up on device "mouse1" - there is a way to glue this down, but it shows up elsewhere seldom enough for me that I haven't bothered), however it is still mapped to the "mouse" device and the foot switches are linked to their respective mouse button actions in parallel with the desktop mouse's buttons. (Note: I left in some commented out lines at the bottom of the above section describing how I would have LIKED to have been able to do it, with none of the below shenanigans.)
Next, I needed to move buttons 1,2,3 of the foot pedal to be above my regular desktop mouse buttons (3 finger buttons, plus two more for scroll-wheel). For this I used xinput via a script in my ~/.kde/autostart/ folder. There are plenty of other places non-KDE users can autostart this from - you could even tack it on to the front of your secondlife startup shell script.
# /bin/bash
# remap the 'pedal' mouse to high order buttons above those of the 'regular' mouse
xinput set-button-map Pedal 6 7 8 0 0 0 0 0 0 0 0 0
# start imwheel to remap high mouse buttone to keys
imwheel -k -a 120 "678"
That moves the pedal buttons 1,2,3 above buttons 1,2,3,4,5 of my generic desktop scroll-wheel mouse. The extra zeros are there because it complains otherwise, but this is put together more by trial-and-error than knowing what I am actually doing!
To get mouse buttons (now) 6,7,8 mapping to key presses, we need to install and set up imwheel. Here is the /etc/X11/imwheel/imwheelrc file I used:
# IMWheel Configuration file ($HOME/.imwheelrc or /etc/imwheelrc) # (GPL)Jon Atkins# Please read the README and/or imwheel(1) manpage for info # and this is best operated on using vim (as I said: It's crunchy) ".*" None, Thumb1, Page_Up, 0 None, Left, Page_Down, 0 None, Right, Home
So with all this set up, I can now operate the Page up (fly-up/jump), Home (fly on/off), and Page down (fly-down/squat) keys from the (respectively) left, middle, right footswitch pedals.
And for the foot-fetishes out there...

Caveat: Holding the jump foot-switch results in multiple jumps rather than jumping-to-fly, though I can land with the right (down) footswitch fine. Probably a key-repeat timing issue. I need to look into adjusting imWheel's key-repeat-rate some time. Or maybe this is a feature. Yes that's it: It is a feature!! ;-P
Final Word:While I started with a 3-button foot switch, if you have an old boy-mouse* lying about, there is no reason you can't use some big switches mounted in a block of wood or some scrap metal for the same effect - but with potential for even more buttons ;-)
* "Boy mice" have balls. "Girl-mice" don't and as a result are more robust :-P
(And someone emailed to say that girl-mice are easier to control. BAH! :-)