View Single Post
Old 08-11-2016, 12:33 AM   #1
hylo
Junior Member
hylo began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Aug 2016
Device: Kindle PW4; Kindle Scribe
Smile Keyboard localization to Korean

Hi, all!
I'm glad to present Kindle Korean keyboard(kingul) for you.
Spoiler:
Kingul is a compound word of 'Kindle' and 'Hangul', name of the Korean alphabet. Since PW3 doesn't support Korean keyboard, I made one for myself. Unlike the other languages, Korean alphabet can be composed with some of its own to make another character(syllable) with a new unicode value.

e.g. 한(U+D55C) = ㅎ(U+1112), ㅏ(U+1161), ㄴ(U+11AB)
The display sequence on the screen is ㅎ -> 하(another composed character) -> 한. In other words, it needs a postprocessing after a key is typed. This hack provides you such a postprocessing on Kindle PW3 device.


This is an open source project and curretnly being managed on github(https://github.com/hylo926/kingul). Since it captures keyboard inputs and can send arbitrary input, it would be useful to someone who wants to make a feature like snippet or something.


What Does It Do?:
Spoiler:
When you type a key on the screen, it sends to the appropriate window an event that indicates the key is pressed or released. This hack continoulsy tries to catch a currently focused window, peeks the key event, does the postprocessing by entering or deleting characters.


Latest Updates (08/31/2016):
Spoiler:
Implemented KUAL menu.


INSTALL:
Spoiler:
Prerequisites: Jailbroken PW3 device, KUAL + MRPI Installer

Put the install.bin file to Kindle/mrpackages and run it with MRPI helper


UNINSTALL:
Spoiler:
Put the uinstall.bin file to Kindle/mrpackages and run it with MRPI helper



NOTES & TROUBLESHOOTING:
Spoiler:

(1) Suddenly, vowels and consonants are separated on the screen
: Restart the kingul.(KUAL -> Kingul -> Restart kingul)
(2) There's no Kokrean in Keyboard setting.
: Choose keyboard selection on KUAL menu (KUAL -> Kingul -> Toggle keyboard selection)



Changelog:
Spoiler:

08/31/2016 - v0.5 KUAL menu
08/30/2016 - v0.4 Support PW2 and Voyage
08/29/2016 - v0.3 Lowered the CPU usage



Got the basic idea from
https://www.mobileread.com/forums/sho...5&postcount=28
Thanks you, baf.


Original Post:
Spoiler:

Hi all,
I'm trying to localize default keyboard to Korean on jailbroken PW3 with 5.8.1 FW.
Since the most languages are supported now, or easily be done with pre-existing localization files inside /usr/share/keyboard (including Korean keymap), regarding old threads are seemed to be abandoned.
If it's not, I'm sorry and please let me know the thread that I can ask for a help.

First of all, I succeeded to change the keyboard layout and print Korean letters. I copied 'ko' folder from /usr/share/keyboard, which contains Korean keymap files, into /var/local/keyboard and modified file names, and then mounted to some other supported keyboard. For example, change the filename from ko-1448x1072.keymap.gz to ru-1448x1072.keymap.gz and then by using 'mount --bind' to bind /var/local/keyboard/ko into /usr/share/keyboard/ru.

Most of languages are covered enough with so far. But the problem is Korean character(called Hangul) is distinguished from other characters because each letter should be assembled or composed with other letters to make one complete character. For example, 한(U+D55C) is composed of 3 letters: ㅎ(U+1112), ㅏ(U+1161), ㄴ(U+11AB). The display sequence on the screen is ㅎ -> 하(another composed character) -> 한. But now they're just displayed as three separate characters on the screen(ㅎㅏㄴ). In conclusion, it needs some kind of post-processing after a key is typed.

At first, I thought binary files inside keyboard folder(*.kdb, *.ldb, utils.so) are something to do with it. But after a few experiments, I concluded that it's only related to input suggestion.

And then I found that Japanese keyboard has a similar post-processing system. Basically, it's a system that converts Romaji to Hiragana according to hiragana_rules.txt which I found inside 'ja' folder. If you type 'a' or 'ha' it converts them into appropriate Japanese character. In the text file 'hiragana_rules.txt', there is a bunch of such rules. So I thought it would be possible to post-processing Korean letters by tweaking these rules. But again, this text file seems irrelevant to current keyboard behavior. It says "These rules replace the default ICU behavior" but it was not. I guess these rules have been compiled and exist somewhere else inside the device in a binary form.

Finally, I decided to hook the keyboard and add some post processing on it. But I have no idea where to start. And also, I'm not fully aware of the software stack of PW3 because I started this since yesterday. I've searched around this forum but haven't found the useful information yet. So it would be a great help if someone could give me some hints or suggest an easier way.


Attached Thumbnails
Click image for larger version

Name:	screenshot_2016_08_16T10_07_39+0900.png
Views:	347
Size:	24.0 KB
ID:	151243   Click image for larger version

Name:	screenshot_2016_08_16T10_08_55+0900.png
Views:	343
Size:	27.2 KB
ID:	151244   Click image for larger version

Name:	screenshot_2016_08_17T22_04_51+0900.png
Views:	316
Size:	34.7 KB
ID:	151245   Click image for larger version

Name:	screenshot_2016_08_31T14_17_45+0900.png
Views:	353
Size:	21.3 KB
ID:	151293  
Attached Files
File Type: bin Update_kingul_0.5_install_pw3_pw2_kv.bin (17.6 KB, 326 views)
File Type: bin Update_kingul_0.5_uninstall.bin (3.9 KB, 246 views)

Last edited by hylo; 08-31-2016 at 01:58 AM.
hylo is offline   Reply With Quote