I'm just starting to experiment with digital audio, MIDI in particular. My electronic keyboard has a sustain pedal with what looks like a standard 1⁄4 in. connector. I know there are MIDI sustain pedals out there, but I think it would be super-cool if I could figure out a way to hook it up to my computer. How does a keyboard sustain pedal work? Would it be possible to plug it into one of my audio inputs and script something up to make the computer think it's a MIDI controller?
The sustain pedal on a standard MIDI keyboard is simply a switch (that's why it is also called a footswitch). Some keyboards (Like my Kurzweil PC-88) have multiple footswitch jacks that can assigned to different MIDI functions, most map it directly to sustain.
Plugging the footswitch directly into your audio input won't accomplish what you want and could potentially damage the equipment.
In order to use the footswitch as a MIDI controller, you will need to plug it into the proper jack on your keyboard and attach the keyboard's MIDI jacks to your computer. Then you can use software such as MIDI-OX to remap the controller message to do what you want.
You can do what you want with a joystick adapter.
You can use the pins for buttons 1-4 to attach pedals to. Then, you can use one of the many pieces of software, such as MJOY (http://www.otk.it/mjoy/) to map the "joystick" to MIDI functions.