(Q) mapping hardware keyboard, polish layout

Search This thread

09mysh

Senior Member
Apr 27, 2014
169
42
Xiaomi 11 Lite 5g NE
Hello everyone

I am trying to acheive the right method for mapping hardware keyboard. Usb host works perfectly, always does what it should on firmware 1.21 with nook manager, kernel version 176. I found some polish keychar kcm file on the net, then I renamed that file with right vendor and product id for my keyboard (terminal, keyboard connected in host mode, typed: lsusb) and placed it in system/usr/keychars... But that didn't make any effect on keyboard mapping, looks like that file is ignored. I could try to edit qwerty.kl in system/usr/keylayouts but from what I know, you cant add there symbols like "ą" or "ś". What I am going for is just these few polish letters : Ą,Ę,Ś,Ó,Ż,Ź. Normally you get them by pressing modifier (alt) and for example, " A", what gives you "Ą" etc. Usb mode ultilty, and little app avaible on net - Key Test, both will show you the same keycode when you pressing a letter or letter+modifier. That makes hard to find out how to edit keylayout file (qwerty.kl) as you cant guess that needed keycode. I was looking quite a lot for answers on xda before I decided to ask, but what I finds does'nt look like exact sollutions. Hopefully I didn't miss anything. Adb is working fine for me, any hints appreciated, Thanks
 
Last edited:
  • Like
Reactions: bartbrudz

Renate

Recognized Contributor / Inactive Recognized Dev
Step one, determine what .kl and kcm.bin the Nook is trying to load.
You will see this if you have ADB and logcat running when you connect.
It will try to load one based on the VID/PID.
It will tell you the exact name of the file.
Probably your naming is different.
I ran into this already.
I didn't bother, I just use qwerty.kl and qwerty.kcm.bin
These are the defaults when there is no VID/PID specific files.

If your kcm.bin is correct it should have the UTF-16 values inside.
The format is pretty simple. After the header (32 bytes) it's like:
Code:
{
   uint32 keycode;
   uint16 label;
   uint16 keypad;
   uint16 normal;
   uint16 shifted;
   uint16 alt;
   uint16 altshifted;
}

You can just enter the little-endian UTF-16 values using a hex editor.
 
  • Like
Reactions: 09mysh

09mysh

Senior Member
Apr 27, 2014
169
42
Xiaomi 11 Lite 5g NE
Ok I got it! It is easy to find some proper tutorials for hex editing qwerty.kcm. But before I did that effort and started learning about it, I searched for some very lazy sollution: qwerty.kcm.bin already prepared by someone else. I found one (obviosly with polish layout),I swapped the original file with it, set the permissions to be the same as in original file, reboot (don't know if absolutely necessary)... thats it, easy. All that thanks to some hard working man who (as he has mentioned on other forum) spent the whole night learning on how to edit qwerty.kcm in hex editor.
Anyway, thank you very much for directing me in the right way. Knowing which files should be edited helped me to resolve the problem. Also logcat is very interesting tool, as it might give some image of how the system works. Thanks
 
Last edited:

bartbrudz

New member
Apr 11, 2016
2
0
hi, I have the same problem but i can't find the qwerty.kcm.bin with polish letters. Could you provide the file ??
 

09mysh

Senior Member
Apr 27, 2014
169
42
Xiaomi 11 Lite 5g NE
hi, here is my whole keychars folder (/system/usr/keychars). You can make a backup of your keychars forder and then overwrite it with mine. You can let me know if it works for you. Find attachment below. Powodzonka.
 

Attachments

  • keychars.zip
    4.7 KB · Views: 25
  • Like
Reactions: bartbrudz

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    Hello everyone

    I am trying to acheive the right method for mapping hardware keyboard. Usb host works perfectly, always does what it should on firmware 1.21 with nook manager, kernel version 176. I found some polish keychar kcm file on the net, then I renamed that file with right vendor and product id for my keyboard (terminal, keyboard connected in host mode, typed: lsusb) and placed it in system/usr/keychars... But that didn't make any effect on keyboard mapping, looks like that file is ignored. I could try to edit qwerty.kl in system/usr/keylayouts but from what I know, you cant add there symbols like "ą" or "ś". What I am going for is just these few polish letters : Ą,Ę,Ś,Ó,Ż,Ź. Normally you get them by pressing modifier (alt) and for example, " A", what gives you "Ą" etc. Usb mode ultilty, and little app avaible on net - Key Test, both will show you the same keycode when you pressing a letter or letter+modifier. That makes hard to find out how to edit keylayout file (qwerty.kl) as you cant guess that needed keycode. I was looking quite a lot for answers on xda before I decided to ask, but what I finds does'nt look like exact sollutions. Hopefully I didn't miss anything. Adb is working fine for me, any hints appreciated, Thanks
    1
    Step one, determine what .kl and kcm.bin the Nook is trying to load.
    You will see this if you have ADB and logcat running when you connect.
    It will try to load one based on the VID/PID.
    It will tell you the exact name of the file.
    Probably your naming is different.
    I ran into this already.
    I didn't bother, I just use qwerty.kl and qwerty.kcm.bin
    These are the defaults when there is no VID/PID specific files.

    If your kcm.bin is correct it should have the UTF-16 values inside.
    The format is pretty simple. After the header (32 bytes) it's like:
    Code:
    {
       uint32 keycode;
       uint16 label;
       uint16 keypad;
       uint16 normal;
       uint16 shifted;
       uint16 alt;
       uint16 altshifted;
    }

    You can just enter the little-endian UTF-16 values using a hex editor.
    1
    hi, I have the same problem but i can't find the qwerty.kcm.bin with polish letters. Could you provide the file ??

    Hi, I'll try to copy it from my nook directory, once I have some time.
    1
    hi, here is my whole keychars folder (/system/usr/keychars). You can make a backup of your keychars forder and then overwrite it with mine. You can let me know if it works for you. Find attachment below. Powodzonka.