I've been poking around various Apple developer forums as well as this forum and haven't been able to find the answer to this...

Is there a way to send keyboard events to the foreground application? Ie, when I'm in, say, Mail, on the iPhone, could a Unix application send "keystrokes" to it?

The goal here is to build an external keyboard device. I already have an embedded processor (a Parallax Propeller) and code to deal with a PS2 keyboard and serial port from a different project. That plus the Sparkfun iPod connector breakout should give me enough to do the hardware side. The only thing I'm not sure on is how to send the events to the GUI.

If I get this to work, I'll be happy to share source code (both iPhone and Propeller) and schematics.