Apparently, a guy in Japan has hacked his iPhone to work with his mini keyboard.
With this translation, I am kinda getting the idea how he did it. (If you can read Japanese, please enlighten me by translating this original DIY Page.
From what is looks like, you just need 3 lines connecting each other with ground connected, DC 3.3V connected, and just the TxD to RxD. Pretty simple it seems so you might want to give it a go if you have an old keyboard laying around. (Well, maybe I will…)