More seriously though, sure, you can do it, but you need to have a driver that supports it. What operating system are you running?
(Or alternately, you might be able to replace the pedal’s microcontroller with your own, and make it directly pretend to be a keyboard.)
You might want to post this in 'input devices' or 'making stuff together' subforums, btw.