Changing keyboard layout on Touchpad
Virtual keyboard layouts in Touchpad are hardcoded into LunaSysMgr binary, therefore editing the keyboard layouts requires a binary patch to the LunaSysMgr executable. HP/Palm has not released the source for LunaSysMgr.
This article describes how to perform that patch, but as of late Aug 2011, no such patches are yet available.
Built In Layouts
Generally there are three keyboard layouts: QWERTY, QWERTZ and AZERTY. On selected keys of these layouts extended characters can be accessed with a long tap on some keys. The long-tap causes a lookup of the extended character set defined for that key and those optional characters are displayed to be selected from. For example, the "a" key may have extended characters of á or à or â or ã.
I. Keyboard layouts
Each keyboard layout consists of main layout and 3 interchangeble bottom rows of keyboard for different applications.
Main keyboard layout describes 5 rows of 12 keys each.
3 bottom rows are 12 keys each
In total there are 8 rows of 12 keys each.
Each key is described by 4 double words (4 bytes).
1 - button type(big endian)
2 last bytes are used Mostly they are set of flags but there is too few info to decode all of them. The least one is button type BF - no button. i.e. there is button and if you press it it will type but it is invisible (try typing to the right of 0 or to the left of 1 to check what is being typed in normal keyboard) 3F - normal button 40 - long button (like spacebar) The second is length class: 40 - short one (mostly spacers) 80 - normal width C0 - long one (Shift etc.) A0 - very long one (space bar) Normal button will look like 0x0000803F
2 - utf-code of main symbol(little endian)(It may be not utf but USC2 but as I get it UTF8 in little endian is the same as USC2 (at least for english and cyrillic characters))
3 - utf-code of secondary symbol(little endian)
4 - Extended characters set address (little endian)
About symbols (2,3) If the greatest byte (the most right one in LE) is 01 then it is not symbol but the text from some static variable defined in the file (like smiles, .com etc.) or special button like shift, enter etc. If main symbol is considered regional by system (it is hardcoded somewhere in LunaSysMgr) then the behaviour is as follows:
a. When shift is pressed The big letter is produced b. Without shift small letter is produced. c. With caps on big letter is produced d. When switched to secondary keys (-/ button) secondary symbol is e. Button is white
produced always If main symbol is not considered regional (unfortunatelly russian letters are not considered regional)
a. When shift is pressed secondary symbol is produced b. Without shift small(if appliable) main symbol is produced c. With caps on big(if appliable) main symbol is produced d. When switched to secondary keys (-/ button) behaviour of e. Button is light grey
previous statements is not changed. And look of keys too.
To make nonregional keys act like regional ones the only workaround is to duplicate them as main and secondary symbols.
It is easy to say that any zero key is just skipped during keyboard generation process so in reall there can be less then 12 buttons in a row.
Extended characters set address is internal pointer not and offset so it is quite a work to find which one corresponds to which character set.
II. Extended characters sets
There are 65 extended character sets.
17 for letters (E R T Y U I O P A S D G L Z C N M). They are general for all 3 keyboard layouts.
3*10 for numbers (1 2 3 4 5 6 7 8 9 0). For each layout there are different sets for each number
5+5+6 for punctuations and .com. There are 4 for QWERTY and QWERTZ and 5 for AZERTY. And for each layout there is special set for .com
Also there is a set for http:// and for choosing keyboard size. They are general for all 3 layouts.
Each set is a sequence of double words with utf-codes of letters (or links to static text) ending with zero dword.
For ex. for A-letter set it is:
41000000 c0000000 c1000000 c2000000 c3000000 c4000000 c5000000 e6000000 aa000000 00000000
III. Changing Layout
In Keyboard layout you can easily change button type flags, primary and secondaty symbol.
Extended characters set address can be changed too, but you should deduce it by initial values of layouts. It is not very hard but requires time.
Characters in extended characters sets can be changed too. Though you cannot change number of characters in particualr set you can choose the one with needed number of symbols and reassign it to needed button by changing address in layout.
|3.0.0 emul||3.0.0 device||3.0.2 device||keyboard/letter|
|0x003EE840||0x003BEE80||0x003CACB0||QWERTY Main layout|
|0x003EEC00||0x003BF240||0x003CB070||QWERTY Default bottom row|
|0x003EECC0||0x003BF300||0x003CB130||QWERTY URL bottom row|
|0x003EED80||0x003BF3C0||0x003CB1F0||QWERTY Email bottom row|
|0x003EEE40||0x003BF480||0x003CB2B0||QWERTZ Main layout|
|0x003EF200||0x003BF840||0x003CB670||QWERTZ Default bottom row|
|0x003EF2C0||0x003BF900||0x003CB730||QWERTZ URL bottom row|
|0x003EF380||0x003BF9C0||0x003CB7F0||QWERTZ Email bottom row|
|0x003EF440||0x003BFA80||0x003CB8B0||AZERTY Main layout|
|0x003EF800||0x003BFE40||0x003CBC70||AZERTY Default bottom row|
|0x003EF8C0||0x003BFF00||0x003CBD30||AZERTY URL bottom row|
|0x003EF980||0x003BFFC0||0x003CBDF0||AZERTY Email bottom row|
Extended character offsets are very numberous to list them all. I will just name offsets for firs one and the order of sets. As each set is ended with 0x00000000, it will be quite easy to distinguish them
The order is following
|3.0.0 emul||3.0.0 device||3.0.2 device||letter to which character set is bind|
|Hide keyboard(size of it)|
|URL key /|