Bewared this is not a straight forward and a pretty involved method of connection and requires a few uber hacking skills to complete from the look of it. But if you fancy giving it a go, a guy at AwghBlog demonstrates how this PS/2 keyboard to an iPhone connection works and how to set it up in detail with step by step instructions.
To complete this hack you will need a jailbroken iPhone and since Apple’s official SDK doesn’t allow access to the serial port, an Arduino Diecimila, an iPod Breakout board, a female PS/2 keyboard connector, one 500k resistor, wire, and a soldering iron and solder… pheww.
The Arduino reads input from the keyboard and converts it to serial, then the iPhone pulls the data via VNC. Like we said, a little roundabout, but we love the amount of ingenuity involved.