It's clear that there will be as many different visions of a "perfect keyboard" as there are people posting here. What is worst, there'll be many conflicting ones: "can the keys be bigger?", "the keys should be smaller", "i need one more page with numbers only", "who the hell needs a page with numbers only, it's a waste of memory", etc...
So i'd say that what a program with such ambitions would need the most is full customizability. Here's a roundup of features i'd like to see:
-key layout customizable trough an xml file.
-multiple pages switched by button actions (tap, hold, gesture) so we can have one default page, one with numbers, one with national symbols, etc.
-gestures, but not only right/left/up/down, like in default keyboard, but also diagonal, and ability to use a key from a different page upon a gesture, eg. when you press a letter and drag in bottom right direction, you'll get a lowercase national (like accented one) character, if you drag in top-right direction, you'll get an uppercase one.
-dynamic key binding: you copy a text to the clipboard, and with a certain key combination (set in the config file) you can bind it to some unoccupied space left for that purpose (you could use it for single letters/symbols, e-mail addresses, or even a bit longer texts - say up to 256 characters).
-did i mention customizability?
I guess that these features would be a good starting point and more functions could be added on the way.
So in short, my vision of the perfect keyboard would be actually just a framework, a tool, enabling the users to experiment with different layouts and functions and create their own perfect keyboard. And the XML config file plus additional graphics would be the keyboard itself. It would be for text input what BatteryStatus is for Today screen plugins.
Example config could look a bit like this:
<Page name="Default" background="image.png" height="200">
<Key name="A" image="key_normal.png" image_pressed="key_pressed.png" caption="A">
<Press action="typeText" argument="a"
<DragR action="specialKey" argument="Space" />
<DragBR action="overrideCaption" argument="ą" action="typeText" argument="ą" />
Available key gestures could be tap, hold, double tap, drag - sideways, up and down, diagonally. Actions could be something like type text, override caption (replaces default key caption until the key released, so that you can see what you're typing), permanently change page to a defined one, change page to a different one for one keypress (like the shift does i the default keyboard), cycle pages, etc. Each key could trigger multiple actions - so it could type some text, and then change page to a different one (example - you have a page with large assignable buttons, so you can bing something like an e-mail address there. When you press that key and the address is typed, the keyboard will return to its default page).
Anyway, that's just my 2 cents. Good luck with the project, whatever direction it goes in.