Monday, August 3, 2009

Partial support for iKeyEx layout.plist on 3.0

The layout.plist to UIKBKeyboard conversion function is done. As promised, an executable that converts layout.plist to .keyboard files can be downloaded from here.

This program converts a layout.plist into 8 .keyboard files which can be loaded by UIKit natively. For example, if you want to install the Colemak keyboard,
  1. ssh into your device
  2. Download layout-plist-to-keyboards by typing:
    wget http://networkpx.googlecode.com/files/layout-plist-to-keyboards
  3. Change that file to an executable:
    chmod a+x layout-plist-to-keyboards
  4. Download the layout.plist for Colemak:
    wget http://networkpx.googlecode.com/svn/trunk/hk.kennytm.Colemak/deb/Library/iKeyEx/Keyboards/Colemak.keyboard/layout.plist
  5. Perform the conversion:
    ./layout-plist-to-keyboards layout.plist
  6. Check that there are 8 .keyboard files in the directory.
    ls
  7. Move all these keyboards to UIKit.framework (requires root permission):
    mv *.keyboard /System/Library/Frameworks/UIKit.framework/

Now all QWERTY keyboards are replaced by Colemak.

If you don't want to replace the QWERTY keyboard, you can rename them to something else. Say, you'll never use the Thai keyboard, then name them iPhone-Portrait-Thai.keyboard, etc. Now you can activate the Thai keyboard to use the custom one.

This solution is not a replacement of a full iKeyEx. For example, 5-Row QWERTY won't work completely because the custom-code injecting part is not done yet (but Punctuation Mod should work). hClipboard won't work at all since it's no a layout.plist. Other caveats are listed here. Please don't host Cydia packages publicly that uses this solution, because every keyboard will become mutually exclusive now :) Only for personal use.

49 comments:

  1. Have you tried a restore after this process?? Just curious if it will cause problems if one of the default boards are replaced with the 5row, or anything?

    ReplyDelete
  2. Works like a charm... As for the restore comment above, the original keyboard works fine after you remove the 8 files.

    ReplyDelete
  3. thanks it works like a charm the only thing is .keyboard file were only and it still works.

    http://chronzz.com/kb/1.PNG changed the arabic to the persian keyboard i made.

    ReplyDelete
  4. I understand that what you are attempting is custom keyboards. Many of us who have created bitmap keyboard replacements are very interested in getting rid of Apple's fugly keyboards and replace them with our own. So my question would be whether we can hope to get a solution to this. Since it is clear that some apps have managed to inject their own keyboards (iTypeFastr is one example), would you consider giving us an app that would allow a simple swap of keyboards (even bitmap versions).

    ReplyDelete
  5. i got an error
    bash ./layout-plist-to-keyboards: cannot execute binary file

    i run it on Ubuntu 9.04 and i already chmod a+x
    what's wrong????

    ReplyDelete
  6. @ເດດ:

    Run it on the iPhone/iPod Touch, not on your computer.

    ReplyDelete
  7. i run it on the iphone and got this eror

    "Command /layout-plist-to-keyboards layout.plist
    Faild with return code 127 and eror message sh-line 209/layout-plist-to-keyboards layout.plist
    No such file or directory"

    ReplyDelete
  8. I have try to convert a keyboard for Traditional Chinese Zhuyin, but I cannot figure out how to rename the keyboard to use in Zhuyin?

    I have found a file in UIKit called Keyboard-zh-Hant-Zhuyin.plist...

    ReplyDelete
  9. what about the "variants.plist"
    how do we use it now?

    ReplyDelete
  10. thanks Kenny
    it works like charm for me XD
    the only thing it use the springboard memory about 6-10Mb that's a lot

    ReplyDelete
  11. @Anonymous 1:

    ./layout-plist-to-keyboards

    Don't forget the leading dot.

    @Tomky:

    iPhone-Portrait-Zhuyin

    @Anonymous 2:

    For now, edit those Keyboard-en.plist in UIKit.

    ReplyDelete
  12. hi KennyTM~
    thank you You're the Greatest :-)

    ReplyDelete
  13. Thanks for the quick reply~
    I still wonder if I could use 5-Row in the layout.plist and convert to .keyboard with this tool?

    ReplyDelete
  14. @Tomky:

    Yes, but not all functions work.

    ReplyDelete
  15. @Dethaksone:

    I wonder how to get the memory measure. With MobileNotes, a normal keyboard occupies Real Resident Size of 9.9 MiB, and with the .keyboard (Colemak) files it grows to 10.2 MiB, so the size difference is only ~300 KiB.

    ReplyDelete
  16. It works well!
    Thanks for the great work!

    I will try to put the keyboard on non-JB devices to see if it works.

    ReplyDelete
  17. Did this with 5-Row Qwerty and works well, except it takes several seconds to switch from the main keyboard to the secondary keyboard (by pressing the "@123" button). Have you noticed this or is it just an issue on mine? I have an iPhone 3G. Thanks.

    ReplyDelete
  18. P.S. It only has this delay the first time you do it in a typing session, after that it is instant (cached in memory I guess?)

    ReplyDelete
  19. I need some help understanding this. Does this utility do more than generate the keyboard files? Or would it be possible to get the keyboard files and simply stick them in the UIKit folder?

    ReplyDelete
  20. I'm sorry but I'm a noob at using ssh and when I ssh into my iphone and type in the first wget command, I get that it's an invalid wget command. Any idea what I'm doing wrong?

    ReplyDelete
  21. @Anonymous 1:

    No. But all you need to do afterwards is move them to the UIKit folder.

    @Anonymous 2:

    apt-get install wget.

    Or use curl instead. Or scp copy your file to the device. Or download the 2 files with the new Safari Download Manager.

    ReplyDelete
  22. @Paul:

    If it's slow, blame Apple. This utility only generates data for UIKit to load. No code involved.

    ReplyDelete
  23. I cannot get this to work. I have copied the command into /bin and changed its permissions, but when I execute the command to convert Keyboard-en.plist it says "Bad system call". Is there a kind soul who could make these 8 .keyboard files available? BTW, what are these files? Are they graphics? Are they editable in a graphics program? I want to change the appearance of the keyboard keys. The layout should stay as is.

    ReplyDelete
  24. @ Anonymous
    put the command "layout-plist-to-keyboards and layout.plist" in "private/var/root"
    then run terminal on SSH program (i use WinSCP)
    then type "chmod a+x layout-plist-to-keyboards" then after that open terminal then run the command "./layout-to-plist-keyboards layout.plist" after it done, it will generate 8 file of keyboard type for you

    hope it help

    ReplyDelete
  25. I did exactly that. Copied both the conversion executable and Keyboard-en.plist into private/var/root. Then chmod the executable (which succeeded). But running the exact command "./layout-plist-to-keyboards Keyboard-en.plist" generated the same response: Bad system call. Renaming the Keyboard-en.plist to layout.plist also failed.

    ReplyDelete
  26. So I now decided to use the Colemak layout file instead of Keyboard-en.plist. Now the command seems to run, since I get no Bad system call message, but the keyboard files are not generated. I'm at my wits end. If anyone can generate those keyboard files (not colemak but standard QWERTY) and put them for download, I would be eternally grateful.

    ReplyDelete
  27. @Anonymous:

    Keyboard-en.plist is not a layout.plist-formatted keyboard. It doesn't even specify any keyboards.

    ReplyDelete
  28. Okay, I was just following the suggestion you gave 8/4 12:00 PM:

    @Anonymous 2:
    For now, edit those Keyboard-en.plist in UIKit.

    Maybe I'm trying to do something that simply cannot be done. What I want is to change the appearance of the standard keyboard. The layout should remain as is. All I want is different colors for the keys and background.

    ReplyDelete
  29. @Anonymous:

    No you can't do it with iKeyEx or any derivatives of it. You need WinterBoard.

    ReplyDelete
  30. I ssh into my phone and can't get past the wget command. When I enter wget http://networkpx.googlecode.com/files/layout-plist-to-keyboards it comes back "-sh: wget: command not found" Is there something I can do to get past this?

    ReplyDelete
  31. @Anonymous
    You should use Cydia to install wget package first. (If not found, you need to switch to Developer or Hacker mode with Settings in Manage page)

    ReplyDelete
  32. Ok. I got past the wget hurdle. Now how do I change a file to executable? Just type in chmod a+x layout-plist-to-keyboards? When I do that it doesn't do anything.

    ReplyDelete
  33. @Anonymous:

    chmod won't output anything. Just move on.

    ReplyDelete
  34. Hey, I just followed all the instructions, chmod was fine, I run "./layout-plist-to-keyboards layout.plist" but no .keyboard files get generated, and no message is returned when the command completes.
    I ran it from private/var/root, on iPhone 3GS OS 3.0 ... any idea? :\

    ReplyDelete
  35. I got to the "mv *.keyboard /System/Library/Frameworks/UIKit.framework/ part and got a message of permission denied and then suggests "try to overwrite:system/Library/Frameworks/UIKit.framework/Media. Also, when I type in ls I don't see any keyboards, I just seeApplications Media/Documents and Library. Any ideas what I'm doing wrong?

    ReplyDelete
  36. Hi,

    I'm customizing a keyboard modifying a layout.plist file and then converting it with your program. Is there any way to make a particular button bigger than all the others on the same row?

    Thanks

    ReplyDelete
  37. @Anonymous:
    (1) The iPhone file system is case sensitive, so System with an uppercase S
    (2) Don't forget the leading /
    (3) I think you should take a crash course on UNIX first...

    @Paul:
    No, layout.plist is incapable of doing so. You need to write your own .keyboard files if you need this.

    ReplyDelete
  38. unfortunately I've ran the status change on the the layout-plist-to-keyboards and it worked as it's green with a * status after it, but when I run the command to run it and have it access the layout.plist nothing happens and there are no files created, is there a posiblility that a group of commands are not in my terminal shell?

    Thank you for getting this up and running and for helping all of us with support.

    ReplyDelete
  39. On second thought, is there any way that you could possibly upload the .keyboard files that we can SSH into our phone since there seems to be many of us that are following directions and still having issues, or should we keep trying.....

    Thank you again for your patience and support with this.

    ReplyDelete
  40. It seems it is impossible to put the .keybaord files into System without JB...so sad...

    I have another question: is it possible to adjust the width of Return key in layout.plist and supported by layout-plist-to-keyboard? I hope I can make it smaller...

    ReplyDelete
  41. @Tomky: It's also outside the scope of layout.plist.

    Note that these are possible for .keyboard file types, only that the simple layout.plist format was not designed to handle such flexibility.

    ReplyDelete
  42. What utility can I use to edit a .keyboard file? Thanks

    ReplyDelete
  43. Kenny,

    I appreciate the work, but I think I'll wait until something a little more friendly to install. Thanks again.
    Chris

    ReplyDelete
  44. @Paul:

    Sadly there's isn't one yet.

    ReplyDelete
  45. KennyTM~ pls help create keyboard VietNam
    ex: dduwowngf = đường
    Tieengs Vieetj = Tiếng Việt
    it type telex

    http://www.unikey.org/manual/ukmanual.html

    Thanks !

    ReplyDelete
  46. hi kenny
    what the name for the Japanese QWERTY?

    ReplyDelete
  47. Hi kennytm, is there any way to make the Os use the keyboard artworks? Why would they leave the keyboard artwork files there if there were not going to use them?

    ReplyDelete
  48. Amharic fonts with IKEY EX keyboard install on Iphone 3G 0.3.1 software but they don,t work why ??

    what i am doing wronge?

    THINKS

    ReplyDelete
  49. Kenny, please help... it worked on 3.0.1 like a charm, but on 3.1 it keeps displaying the message: 'Bus error'.
    What can I do?

    ReplyDelete