[Resolved] (SOLVED) Android 4.4.2 Keyboard Driver for Bluetooth keyboard - General Questions and Answers

I have been successfully using a Bluetooth keyboard on all my android devices operating on Android 4.0.4, 4.1.11, 4.2.2 etc. Recently I bought a tablet with Android 4.4.2 and my Bluetooth keyboard doesn't work correctly on this . It does pair but the prints different characters for keys pressed. None of the numbers print for the correct input and also some letters .. eg when I press 'w' it prints 'z' and many similar errors. My tablet is 10.1 inch Polaroid MID4x10 and it works well for all other applications and the battery lasts for over 5hrs when playing 720p movies. It has GPS as well.
I believe that this version 4.4.2 of Android has been loaded with a wrong keyboard driver.
Any help will be highly appreciated.

Mabboseg said:
I have been successfully using a Bluetooth keyboard on all my android devices operating on Android 4.0.4, 4.1.11, 4.2.2 etc. Recently I bought a tablet with Android 4.4.2 and my Bluetooth keyboard doesn't work correctly on this . It does pair but the prints different characters for keys pressed. None of the numbers print for the correct input and also some letters .. eg when I press 'w' it prints 'z' and many similar errors. My tablet is 10.1 inch Polaroid MID4x10 and it works well for all other applications and the battery lasts for over 5hrs when playing 720p movies. It has GPS as well.
I believe that this version 4.4.2 of Android has been loaded with a wrong keyboard driver.
Any help will be highly appreciated.
Click to expand...
Click to collapse
Check your keyboard settings Make sure that your keyboard is set up for the right country/language.
Because there is not a specific forum for your device, this thread will be moved to general/help

sd_shadow said:
Check your keyboard settings Make sure that your keyboard is set up for the right country/language.
Because there is not a specific forum for your device, this thread will be moved to general/help
Click to expand...
Click to collapse
The Keyboard setting is (Android Keyboard (AOSP) English US), I guess it's ok.
But ... I have been looking around in the tablet and maybe discovered something:
The files used by the bluetooth keyboard are "Generic.kcm & Generic.kl" and that is the cause of the problem. The codes set in this file are NOT for qwerty layout. eg key marked 'Q' is assigned to character 'A' etc. These are in /system/usr/keychars, and /system/usr/keylayout folders respectively.
However ...there are qwerty.kcm & qwerty.kl files there as well in this same folders and they have the correct code assignment to the keys, but, I have no idea how to do settings to use them.
My tablet is not rooted and there is nothing available at present for rooting this device so I can't rename the files.
Any idea as to how to change to qwerty might solve the problem and will be of gr8 help to me.

Mabboseg said:
The Keyboard setting is (Android Keyboard (AOSP) English US),
Click to expand...
Click to collapse
No, that is wrong. That is a android touch screen keyboard
under that should be
Physical Keyboard
then the name of the physical keyboard
mine is Dell BT keyboard
tap on name>set up keyboard latouts

sd_shadow said:
No, that is wrong. That is a android touch screen keyboard
under that should be
Physical Keyboard
then the name of the physical keyboard
mine is Dell BT keyboard
tap on name>set up keyboard latouts
Click to expand...
Click to collapse
There is no other keyboard shown apart from that. I believe (99% sure) that when I am using a basic Bluetooth keyboard it uses code settings from 'Generic.kcm'. I can also see that for internal built in pop-up keyboard it uses 'virtual.kcm' . I am working through this problem and soon I should conquer this problem
(I can't find any way of attaching a picture to this xda forum)

Problem Solved
The problem with my tablet is SOLVED now.
First I had to root the tablet using the method given here:
http://forum.xda-developers.com/android/help/polaroid-p10-tablet-t2965944/post57415782#post57415782
Later I copied a file and renamed it. the actual steps are as follows:
(1) Rename /system/usr/keychars/Generic.kcm -> Generic.bak
(2) Copy /system/usr/keychars/qwerty.kcm and paste it in the same directory. The new file will be pasted as Copy.qwerty.kcm
(3) Rename the Copy.qwerty.kcm -> Generic.kcm
All the above operations were done using the app called Root_Explorer_v2.17.2.apk (Free App)
Make sure to mount the folder r/w before making the changes, after changes are complete than mount it back to r/o.
Now everything is running as good as Gold.
Rooting has made the tablet more fast to boot up and run. Love it now
This was done after so much of reading through the forums and working things out as it applied to my case.

Related

3rd Party keyboard problems

hello all i have XDA mini S wm5 unit..wanted to load 3rd party keyboard which i can do fine..but can i get the damn things to work !! when selecting the the new keyboard (different language) the unit defaults straight back to the keyboard installed..wont even attempt to show the new one..any ideas ? have even change the registration to different code but even doing that still shows default keyboard..do'h
thanks
Hi plasticplanet!
Sounds like the system can't find the DLL for this keyboard.
The simple solution is to re-install it, and make sure you install it in main memory.
The not so simple solution: If you know the name of the DLL for the keyboard, get a registry editor, search for it under HKEY_CLASSES_ROOT\CLSID\{keyboards CLSID}\InprocServer32
and make sure the DLL is in fact in the path specified.
There is also a chance that the DLL is present but can not initialize for some reason. You should check the following:
Was the keyboard installed properly with its installer as directed?
Does the keyboard support your OS (WM5)?
Is registration required? (licence, key etc.)
hi levenun...thanks for your suggestion..i contacted one of the 3rd party companies about this problem..apparently in wm5 (fecking bill gates) the rom version i have which is 1.5 has a bug in it..apparently the memory used to change keyboards is the same that is used for today screen..so if you have plug-ins it wont allow you to change certain things...the company DynaType suggested that i switch them off and then try it..and guess what it worked after that i could then activate my today plug-ins once more
thanks for having a think about my problem :wink:
levenum said:
Hi plasticplanet!
Sounds like the system can't find the DLL for this keyboard.
The simple solution is to re-install it, and make sure you install it in main memory.
The not so simple solution: If you know the name of the DLL for the keyboard, get a registry editor, search for it under HKEY_CLASSES_ROOT\CLSID\{keyboards CLSID}\InprocServer32
and make sure the DLL is in fact in the path specified.
There is also a chance that the DLL is present but can not initialize for some reason. You should check the following:
Was the keyboard installed properly with its installer as directed?
Does the keyboard support your OS (WM5)?
Is registration required? (licence, key etc.)
Click to expand...
Click to collapse

[Q] How to cheat Mexican ROM to see American files?

Hi there. What's up?
I've been trying to set something up and since there are wise people around here I would like to ask you a question.
I have AT&T's samsung i637 aka Jack. Recently I updated soft with mexican one (from Telcel). It works like a charm. Only problem is Mex soft has little different keyboard mapping. Some keys switched places. And I'm already used to old keyboard+what's printed on keys.
In order to get results I tried to swap eT9*.* and kbdmouse.dll, kbdhid.dll, keypad.dll files from Jack soft and put them into Mexican soft along with appropriate registry editing. Without any luck. Swapping eT9 files is not a problem-everything works as it was. I figured the kbd*.dll and keypad files are the case but each time I swap them the keyboard is completely unresponsive. Like those files were "strange".
My question is: Is there any way to trick system to see "new" files?
Thanks for your help. Cheers.
mykail said:
Hi there. What's up?
I've been trying to set something up and since there are wise people around here I would like to ask you a question.
I have AT&T's samsung i637 aka Jack. Recently I updated soft with mexican one (from Telcel). It works like a charm. Only problem is Mex soft has little different keyboard mapping. Some keys switched places. And I'm already used to old keyboard+what's printed on keys.
In order to get results I tried to swap eT9*.* and kbdmouse.dll, kbdhid.dll, keypad.dll files from Jack soft and put them into Mexican soft along with appropriate registry editing. Without any luck. Swapping eT9 files is not a problem-everything works as it was. I figured the kbd*.dll and keypad files are the case but each time I swap them the keyboard is completely unresponsive. Like those files were "strange".
My question is: Is there any way to trick system to see "new" files?
Thanks for your help. Cheers.
Click to expand...
Click to collapse
take a look in the windows folder of your device, are there any "et9.(some name).kmap.txt" files?
if you have them, upload them for me here and tell me which keyboard letters have been changed, then i'll will fix it for you!
Thekn said:
take a look in the windows folder of your device, are there any "et9.(some name).kmap.txt" files?
if you have them, upload them for me here and tell me which keyboard letters have been changed, then i'll will fix it for you!
Click to expand...
Click to collapse
it's eT9.samsung_keylayout.txt and I have already tempered with it.
Result -> English keyboard in messages (software). But I'm rather interested in changing the whole thing, hardware keys as well, special buttons for camera and mail (which were swapped) and gps and silence buttons. Can you bring those back?
Thekn said:
take a look in the windows folder of your device, are there any "et9.(some name).kmap.txt" files?
if you have them, upload them for me here and tell me which keyboard letters have been changed, then i'll will fix it for you!
Click to expand...
Click to collapse
but as you requested...
OK. I compared regs from Mexican and American ROM and I got this:
American rom:
Code:
[HKEY_LOCAL_MACHINE\Security\Phone\PhoneKeyMatch\KeyboardMappings]
"21"="2E,21"
"22"="3F,22"
"2A"="7A,2A"
"40"="79,40"
"2D"="77,2D"
"5F"="75,5F"
"2B"="71,2B"
"29"="70,29"
"28"="6F,28"
"25"="6E,25"
"27"="6D,27"
"3B"="6C,3B"
"3A"="6B,3A"
"26"="6A,26"
"7E"="69,7E"
"24"="68,24"
"2F"="61,2F"
"23"="62,23"
"3D"="73,3D"
"39"="76,39"
"38"="63,38"
"37"="78,37"
"36"="67,36"
"35"="66,35"
"34"="64,34"
"33"="74,33"
"32"="72,32"
"31"="65,31"
And Mexican:
Code:
[HKEY_LOCAL_MACHINE\Security\Phone\PhoneKeyMatch\KeyboardMappings]
"2C"="21,2C"
"3F"="3F,3F"
"2A"="7A,2A"
"24"="79,24"
"2B"="77,2B"
"75"="75,75"
"2F"="71,2F"
"29"="70,29"
"28"="6F,28"
"27"="6E,27"
"22"="6D,22"
"3B"="6C,3B"
"3A"="6B,3A"
"26"="6A,26"
"7E"="69,7E"
"40"="68,40"
"5F"="61,5F"
"23"="62,23"
"2D"="73,2D"
"39"="76,39"
"38"="63,38"
"37"="78,37"
"36"="67,36"
"35"="66,35"
"34"="64,34"
"33"="74,33"
"32"="72,32"
"31"="65,31"
Can someone please help me crack it? Which code is what key. Maybe that is the way.
Thanks
Do you know me?I always know you.heh~I think it‘s difficult to change the keyboard map. Why not change another ROM or cook by yourself?
well...like said above...tried to swap keyboard files...
about cooking...it's very hard for a noob to cook since I cannot find any proper guide with all the commands and stuff
mykail said:
well...like said above...tried to swap keyboard files...
about cooking...it's very hard for a noob to cook since I cannot find any proper guide with all the commands and stuff
Click to expand...
Click to collapse
My name is 忠杰者 form 爱三星论坛. Did you remember? You can look for your I637‘s kitchen to cook ROM. You could obtain from the ROM maker.
there's not i637 kitchen...it's only i617 - told to be the same. but no Noobie noob guide
mykail said:
it's eT9.samsung_keylayout.txt and I have already tempered with it.
Result -> English keyboard in messages (software). But I'm rather interested in changing the whole thing, hardware keys as well, special buttons for camera and mail (which were swapped) and gps and silence buttons. Can you bring those back?
Click to expand...
Click to collapse
try it
first backup registry
open regedit
Camera
HKLM/Software/Samsung/Email : MailKey Value Name
change: WindowsStart MenuMessaging.lnk to WindowsCameraapp.exe
mail:
HKLM/Software/Microsoft/Shell/Camera : Application Value name
change: WindowsCameraapp.exe to Windowstmail.exe
i hope it works for you!
Thanks,
I figured out that much by myself but thanks anyway. What I meant was fact I got used to old keyboard with gps, silence and hardware + in place. I not able to cook my own rom...I think I'm gonna lose the phone.

[How-To][Mod] Changing the Keyboard Characters

Quick and short of it:
The SK4G has the same exact physical Keyboard layout of the G1. But it sucks in comparison to the G1's layout because someone at Samsung dropped the ball. Shift + a number does not give you the normal expected symbol. There is a lack of a comma on the right hand side. Shift+Alt tends to not do anything on most keys. With this mod, I fixed 90% of the annoyances of the hardware keyboard (Just need to turn the [useless everywhere but the stock messaging app] smilie key into the voice key, and the voice key into an alt key and I'll be 100% good)
By hacking the corresponding kcm.bin file in the /system/usr/keychars/ directory, you can change the action of a key. This is not the same as changing the kl file in /system/usr/keylayout/ which allows you to change the behavior of a physical key. (A bit of semantics really.)
I modded the default kcm.bin (Binary Keyboard Character Map) file s3c-keypad.kcm.bin to match the G1 kcm closely, adjusting for what is printed on the SK4g keyboard, so w, e, and r are still smilies, and m is still /, while alt+shift+? is now ¿ as the g1 has. Only change to what is printed was fixing the multiplication sign symbol on alt+o to show an actual multiplication sign, instead of an x. Some unused alt+shift+key were used to improve usage, and for flair.
Main Changes:
shift+number provides its corresponding symbol, like it should.
alt+shift+O is the Umlat combining accent (press another character afterwards it it might combined, like ¨ + u is ü. Same result as longpressing U).
Alt+Q default by Samsung is a Space. Alt+Shift+Q is now Tab.
Alt+Shift+T is the "¬" not symbol. Sideways L. Useful for ¬_¬ sideway glances.
Alt+Shift+Y is the unicode STAR AND CRESCENT. SK4G can't display it, but it will show up correctly in OSes that understand it/have the right encoding (like the G1).
Shift+Period is a comma. Because the comma belongs on the right side of the keyboard dammit.
Alt+Period is a bullet symbol.
Alt+Shift+Period is a "`" Grave combining accent (same as Umlat. Grave + space is regular grave)
Alt+Shift+Enter is a CR return key, instead of the normal LF return key. Some apps recognize the difference (ConnectBot)
[email protected] and [email protected] is the ~ tilde. I did not add the combining accent version. An adult keyboard requires the ~.
[email protected] is the Eighth Note. Because we all need some music in our lives. Displays properly on the SK4g.
Instructions:
If you want to use the character map I created, you will need root, adb, and be comfortable mucking about the phone's system files. You can install with RootExplorer or any other file manager instead, if you know how to do it:
Code:
adb push /path/to/unzipped/files/mods3c-keypad.kcm.bin /data/local/tmp/
adb shell
su
mount -o remount,rw /dev/block/stl9 /system
cp /data/local/tmp/mods3c-keypad.kcm.bin /system/usr/keychars/
cp /system/usr/keychars/s3c-keypad.kcm.bin /system/usr/keychars/s3c-keypad.bu
mv /system/usr/keychars/mods3c-keypad.kcm.bin /system/usr/keychars/s3c-keypad.kcm.bin
chmod 644 /system/usr/keychars/s3c-keypad.kcm.bin
You need to push the file to the tmp folder, then going in as superuser, remount the system partition.
Once remounted, you can copy the file to the correct folder.
Safety first, make a backup of the original file. A copy of the original is also provided in the zip folder.
Now you overwrite the original.
Once that's done, you want to correct the permissions to 644 like the original.
At this point, you can reboot. If you want to give it a try before rebooting, you can just load any app that isn't in memory, or kill an existing app, and load it back up, and type to see the difference. You must reboot if you want to see the changes everywhere. Any app in memory, including home and system, will not see the new file till you kill it/reboot.
What's in the zip:
Four files are provided in the zip.
1: "s3c-keypad.kcm.bin" This is the original kcm.bin from the stock KD1 firmware. Most likely, it has not been change in KG2.
2: "trout-keypad-v3.kcm" This is a plain text readable version of the G1 kcm. Look at this if you want to see the format android uses to build the kcm.bin file. Easy to read.
3: "mods3c-keypad.kcm" This is a modified kcm file, easy to read showing what my modded layout is, with notes.
4: "mods3c-keypad.kcm.bin" the actual kcm.bin file you can use to drastically improve your keyboard.
If You want to make your own:
Some Resources First:
ASOP Developers Guide to the Keyboard:
http://www.kandroid.org/online-pdk/guide/keymaps_keyboard_input.html
Describes how Android uses (some of) the keyboard files, and the file layouts.
Extending the keyboard mapping of an Android system
http://jahrome.free.fr/index.php/keyboard-mapping-android-htc-desire?lang=en
Found this after the fact, some xda members doing this on the g1 way back when:
http://forum.xda-developers.com/showthread.php?t=468703
Someone had a python tool to turn kcm.bin to kcm files.
http://forum.xda-developers.com/showthread.php?t=837002
Basically, you will be mucking around a hexeditor to change the kcm.bin file.
Make the hex editor show you 16 bytes per line, and you will see a nice pattern, as shown on the http://jahrome.free.fr/index.php/keyboard-mapping-android-htc-desire?lang=en.
Any non-normal (unicode) character should be put on the hex side, so 0x0300 would be typed in. Additionally, hex editors tend to show lsb first. So unicode 0x0300 would show up as "00 03". 0xEF01 will be seen as 01 EF.
If you look and compare the hex editor screen to the kcm file provided, you can easily modify the kcm.bin file to your liking.
Future:
I'm trying to find where the LongPress Keyboard character maps are. Like when you longpress ! lets you choose ¡, or long pressing shift+4 ($) gives you the option to insert a couple of currency marks, or longpressing a will let you choose from accented a characters (å,ä,â etc).
Additionally, also looking for the same on the Extended Feature keys, like SYM, and the smilies. The smilies are just macros that get typed when you press them, as using the regular smilie types ":" "-" and ")", and you can delete each one individually. Having a customizable macro key would be great.
But from my guess, one or both of those features are embedded in the keyboard device driver. I will muck around the filesystem to see what I can find.
Notes:
I am not responsible for anything ever anywhere. You break it, you pay it, not me.
Also, this is only for the hardware keyboard, not the virtual IMEs. Changing those would require apk code signing, and desamali and everything. headthefrickache.
thank you!
this is gonna be really helpful and fun to mess around and make my own. glad to have another dev aboard!
Update: I poked around a bit, and looked at the ime-htc.apk that is floating around. Decompiled the apk, and found that it's popup alternatives for the virtual keyboard is in res/values/strings.xml, with the fields pointed at it by res/xml-normal-hdpi/*.xml depending on which language/shape/layout keyboard you are using.
So I think I am right in assuming that the hardware keyboard popups are in the device driver. :/ Will investigate further.
Oh, and a note about the sidekick keyboard. You cannot press and hold ALT+SHIFT and a third key at the same time. You can't press any three keys and have it register at the same time at all. Another instance where the g1 was just better
Additionally, doesn't seem like all keys respond to a alt-lock+shift-lock the same. The @ and ? key seems to only produce the alt or shift version, while most of the others produce the alt+shift version of the key.
This ****ing guy, eh? When can I buy you strippers and blow, eh? I ****ing love you.
chaostic_2k1 said:
Update: I poked around a bit, and looked at the ime-htc.apk that is floating around. Decompiled the apk, and found that it's popup alternatives for the virtual keyboard is in res/values/strings.xml, with the fields pointed at it by res/xml-normal-hdpi/*.xml depending on which language/shape/layout keyboard you are using.
So I think I am right in assuming that the hardware keyboard popups are in the device driver. :/ Will investigate further.
Oh, and a note about the sidekick keyboard. You cannot press and hold ALT+SHIFT and a third key at the same time. You can't press any three keys and have it register at the same time at all. Another instance where the g1 was just better
Additionally, doesn't seem like all keys respond to a alt-lock+shift-lock the same. The @ and ? key seems to only produce the alt or shift version, while most of the others produce the alt+shift version of the key.
Click to expand...
Click to collapse
Port G1 driver? Whoz got the sauce? erm Source?
Well, I figure the g1 just dedicated more gpio than sumsung did for the keyboard. I doubt the g1 driver can be ported. And the sumsung keyboard driver might be hackable, but without the source for it, it be a pain to try. Still looking for the long press keys though.
I may be confused about your question. I can't seem to understand what you mean by hardware keyboard popup, but yes, the keyboard driver is in the kernel, so you'd need a custom kernel to change that.
The kernel source is available at opensource.samsung.com
If you can pm me/write what you're trying to do/fix (as I'm currently a bit confused as to your goal) I would be open to helping work on this
If you hold down the a key on the keyboard, you get a little popup screen that lets you choose the alternative versions of a, like å, ä, á, etc. Same for holding shift+4 or alt+4, would give you the alternatives for $, like ¥, british pound symbol, etc.
I am trying to find where that information is held. On an ime, it's in the strings.xml file inside the apk. For the hardware keyboard, I'm guessing its in the driver. I'm trying to locate that, so that it can be changed to include more things (and in the sk4g, even add macros like the smilies).
Unfortunately, noone else has found it, or if they have, it's buried in some obscure thread inside some obscure device's forum. The problem with android information, is that with so many devices, and versions, there is a ton of information, being redundantly found/created, and buried under other information.
Haha I hear that. I guess I was testing it out using the wrong buttons before, as I didn't get that popup before. Now I was able to, but it looks like it's only for certain keys. At any rate, let me look in the kernel source to see if I can find the correct files there.
sduvick said:
Haha I hear that. I guess I was testing it out using the wrong buttons before, as I didn't get that popup before. Now I was able to, but it looks like it's only for certain keys. At any rate, let me look in the kernel source to see if I can find the correct files there.
Click to expand...
Click to collapse
I will donate money to this project. No ****ing joke. I wanna see this **** happen.
$50 is what I'm putting down at the moment. I'll put down more if more coders want to help out sduvick and make this work wonderfully.
Requirements,
01. Have all the features which the OP is attempting to incorporate.
02. Have a secondary .apk which allows users to modify key layout whilst using the phone.
Update/message towards chaostic: it appears that the longpress popup is coming from /system/framework/services.jar (desmali'd) com/android/server/KeyInputQueue.
On a somewhat related note, trying to find the keymaps for smileys to remove the extra alt added after the '<3' alt key if anyone might know where that is. EDIT: re-read your OP, looks like you couldn't find these either, but apparently this was fixed in the KG2 update, so maybe the kernel updates might give me more details. will update shortly.
UPDATE: found the smileys in /system/framework/framework.jar (desmali'd) com/android/internal/widget/smileys.smali
sduvick said:
Update/message towards chaostic: it appears that the longpress popup is coming from /system/framework/services.jar (desmali'd) com/android/server/KeyInputQueue.
On a somewhat related note, trying to find the keymaps for smileys to remove the extra alt added after the '<3' alt key if anyone might know where that is. EDIT: re-read your OP, looks like you couldn't find these either, but apparently this was fixed in the KG2 update, so maybe the kernel updates might give me more details. will update shortly.
UPDATE: found the smileys in /system/framework/framework.jar (desmali'd) com/android/internal/widget/smileys.smali
Click to expand...
Click to collapse
So the smilies have been found is great, but the two things of note is how difficult it would be for a regular edit, so for rom builders or themers its great, but individuals would be hard press to change it.
Just to make sure, these are the alt+w or alt+e or alt+r smilies/macros, or is it the smiliey key widgets?
Either way it gives me somewhere to look. Seems the longpress alternatives is a longshot for easy modding at this time. But ever forward. Thanks.
I would integrate it as part of the tweaks thread I've been working out of, but it's a matter of changing some very simple (once you get it extracted and desmali'd) source, just looking through one file and looking for the strings for each smiley. Mind you, this is only for the smiley button itself, that is the popup that appears in messaging when you try to use the smiley button. This doesn't really relate at all to the keyboard at all actually.
Any key presses are gonna be from the kernel somewhere, still waiting on the download, samsung's opensource server is slow as balls.
Works great; how to edit
I just did this and it solved one of my two huge dissatisfiers with the Sk4G over the G1 and the actual original Sidekicks (where I was one of the people who convinced them to add | and ` and ~ back at Danger).
I really wanted to type ` by itself, so I edited my keymap so that [email protected] is ~ but alt-~ is `. I did this using emacs, with hexl-mode, and it was a snap!
Also, even though I've used adb in the past, I got stuck at su and it did nothing. I realized I needed to be running the SuperUser app first, and once I did that and ^C'd out of the su, it prompted me and I allowed it to remember shell request, and everything from then on worked great!
Thanks!
Leigh.
Glad it Helped someone
Can you hack the keyboard to allow virtual keyboard to work while in landscape mode?
Thanks that is awesome
This was really helpful.
I'm been bothered with the funky behaviour of shift+0-9
I also mapped alt-a a to escape
and changed alt-q from space to really being tab
The .kl file was also interesting:
/system/usr/keylayout/s3c-keypad.kl
It is just a textfile, so easy to edit and I was able to remap the mostly useless SMILEY key to GRAVE.
which is helpfull when I need a ~.
The .kl file also has all the other buttons on the SK4G so they can be reassigned.
I moved VOICE_INPUT to what was MULTITASKER, so I can enter voice commands without opening the keyboard.
and made myself a ALT_LEFT.
Smart Quote-enabled Physical Keyboard
First off, a huge thanks to chaostic_2k1, whose hack of the Sidekick 4G keyboard is brilliant. It was the only one I could find, and his instructions are first-rate. Using his modified s3c-keypad.kcm.bin file, I’ve been able to concoct a keyboard that has all of his fine variations along with smart-quote and easier em-dash ability.
If users are trying to write a professional manuscript, they need smart quotes (curly quotes), em dashes, and ellipses. The attached file has these modifications:
ALT-f = left double quotation mark
SHIFT-ALT-f = still gives the left bracket
ALT-g = right double quotation mark
SHIFT-ALT-g = still gives the right bracket
[These brackets are also stock-accessible with ALT-space]
[Right and left double quotation marks are stock-accessible with ALT-k, long press, etc. The keystrokes in this file cut down the number of steps]
ALT-lowercase L = right single quotation mark (curly apostrophe)
SHIFT-ALT-lowercase L = straight apostrophe
ALT-t = regular hyphen
SHIFT-ALT-t = em dash
[The em dash is still stock-accessible with ALT-t, long press, etc.]
The ellipsis is stock-accessible with ALT-space. I didn't modify anything connected with the ellipsis.
Follow the instructions in the first post of this thread for proper s3c-keypad.kcm.bin copying into /system/usr/keychars
Root obviously a must, and I used Total Commander file manager to copy file from sd card to /system/usr/keychars
If using Total Commander, remember to change /system directory to read-write.
Proper screen display of smart quotes: neither ThinkFree or Kingsoft word processors will display the actual right and left double quotes, though the quotes will enter correctly and display on a desktop word processor, printer, etc. In order to see double quotes correctly, users must use QuickOffice or TextMaker word processors [for reasons I can’t figure, KingSoft doesn’t even allow ALT-space or any SHIFT-ALT keystroke].
This keyboard mapping works on my Sidekick 4G, but I take no responsibility for any problem. I’ve also hacked the /system/usr/keylayout/s3c-keypad.kl to change key 54 SMILEY to key 54 TAB WAKE_DROPPED
This changes the SMILEY to a proper tab.
Do take care with the /system/usr/keylayout/s3c-keypad.kl If you screw it up, all physical keys, including Menu, etc, are dead, and you have to touch-screen the restoration of the original file. A little scary.
EDIT/UPDATE: Attached is the kcm file with an additional character: the left apostrophe. SHIFT-ALT-k = left single quotation mark
This is needed for smart quote usage when quoting within double quotes: "So when you said 'yes,' you really meant no."
Jake

How to remap mouse buttons and is possible to make .kl and .kcm files for it?

Hi,
I've read all possible threads trying to answer my question and tried editing and creating .kl files with no effect.
None of my mouse buttons can be remapped using the simplest method - by making a .kl file .kl.
Key list:
0x110 (key 272) left click button - mapping BTN_LEFT
0x111 (key 273) right click button - mapping BTN_RIGHT
0x112 (key 274) middle button (scroll button) - mapping BTN_MIDDLE
0x113 (key 275) back/previous button - mapping BTN_SIDE
0x114 (key 276) forward/next button - mapping BTN_EXTRA
KeyTest app that shows details on keypresses returns info only for the FORWARD and BACK mouse buttons. Pressing the rest gives no output.
I managed to remap these two keys with Xposed Additions Xposed Framework module.
Unfortunetly I couldn't do the same for 3 remaining keys
Some questions relating the issue:
Are mouse devices remapped some other way then by making a .kl file for them? Is there even an official, Google way to remap them? Just like the one in the Dev site?
Can you determine which .kl file is used by a specific device? With a shell command maybe?
RESEARCH:
Android Button State
An Android button state is a standard identifier defined in the Android API for indicating which buttons (on a mouse or stylus) are pressed. Android button states are defined by the android.view.MotionEvent class as constants that begin with the prefix BUTTON_.
The current button state is determined by the Android InputReader component which monitors when buttons (on a mouse or stylus) are pressed / released and sets / resets appropriate button state flag.
The relationship between buttons and button states is hardcoded.
Click to expand...
Click to collapse
Source Android official website - > Devices -> Interfaces -> Input -> Key Layout Files site describing .kl files usage and syntax doesn't mention anything about the mouse - so is there no .kl for mouse? No "official" way of remapping the keys? or if I think right, basing on "Android Button State" mentioned above; left, right and middle mouse buttons are hardcoded and can't be just remapped? So where is it hardcoded then?
Source Android official website - > Devices -> Interfaces -> Input -> Input Device Configuration Files
The default behavior for a mouse is to present an on-screen cursor which tracks the mouse's movements and simulates touches when the mouse is clicked. Although the mouse can be configured differently, the default behavior is usually sufficient for standard mouse peripherals.
Click to expand...
Click to collapse
Eem... ok so it says it can be configured otherwise, but how... if the .kl files are not working...
Input Device Configuration File - /system/usr/idc/Vendor_XXXX_Product_XXXX.idc
I have tried making an .idc file for my mouse and it's being used, but I don't know what I should put in it so Android would also use a .kl or .kcm file for the mouse just like it does for keyboards.
Logcat output:
I/EventHub( 656): New device: id=32, fd=173, path='/dev/input/event6', name='Bluetooth Mouse', classes=0x80000008,
configuration='/system/usr/idc/Vendor_099a_Product_0500.idc', keyLayout='', keyCharacterMap='', builtinKeyboard=false, wakeMechanism=EVIOCSSUSPENDBLOCK, usingClockIoctl=true
Click to expand...
Click to collapse
After connecting keyboard: (I don't have an .idc file for the keyboard, there is no need for it)
I/EventHub( 656): New device: id=33, fd=173, path='/dev/input/event6', name='MEDION MD86853', classes=0x80000003,
configuration='',keyLayout='/system/usr/keylayout/Vendor_04e8_Product_7021.kl', keyCharacterMap='/system/usr/keychars/Vendor_04e8_Product_7021.kcm', builtinKeyboard=false, wakeMechanism=EVIOCSSUSPENDBLOCK, usingClockIoctl=true
Click to expand...
Click to collapse
Can I add some parameters to the .idc file that would force using a specific .kl file? I can't find any documentation for .idc files contect that would be more exensive - a list of possible variables/values would be nice, but I can't find it.
Try using this app: https://play.google.com/store/apps/details?id=com.tincore.and.keymapper&hl=en
@Ventricle have you found ansolution?
@Ventricle - did you find a solution for this? I am trying to move pointer with a gamepad X and Y axis. so far i couldn't do this. thanks.
No, sorry I couldn't do it with any known methods. It's hardcoded I guess - still possible to change, but would require more in-depth looking and then changing some files.
I've been using PhoenixOS and RemixOS recently and they have mouse right click and middle click sorted out. I'll look into the system files and maybe I can reproduce the method (I hope that's legal )
I know something about this but, only if somebody still need help.
Nickescd said:
I know something about this but, only if somebody still need help.
Click to expand...
Click to collapse
Hi, I need to change usb mouse right button from "back" fuction to "menu" is that possible? I am android 8.1 rooted, thanks
Nickescd said:
I know something about this but, only if somebody still need help.
Click to expand...
Click to collapse
Please, I've looked into this for months and there's literally nothing I can find to help me. I just want to be able to rebind right click and it's impossible.
I'm also looking for solutions. I've tried tincore, many other remappers, going into the .kl files directly.. I thought about making one but I don't know the vendor id and such for a Logitech m535. Also Phoenix is and remix os are old at this point and don't seem like there's been updates since about 2018.
This is the most accurate problem (which I am having) description and research on the internet.
Sadly no news I believe?
Of course if you only need to forward mouse to PC you can use virtualhere. Quite expensive piece of software 25$ with current 50% discount. And needs to purchase new one on new Android device
I am using latest PrimeOS Mainline in a quad boot system with a logitech K400r wireless keyboard/trackpad. I tried to change the right mouse button behavior but failed. I am writing what I learned/did before giving up as it might aid others with troubleshooting similar issues.
Problem:
Right mouse button clearly does not act as back button and it is really annoying if you are used to the default behaviour.
Right mouse button seems to be same as left mouse button (possibly long click lmb) unless right click on desktop icon and works as menu button. Looks like they try and make rmb like windows where you are supposed to get a context menu.
Troubleshooting Steps:
Make backup of PrimeOS partition (just in case).
Identify keyboard and get vendor and product id.
Code:
cat /sys/kernel/debug/usb/devices
I check the output and get vendor=046d product=c52b.
Now create custom files for my keyboard. Don't want to mess with generic files. Input device files are located in /system/usr on my device. Some devices use /vendor/usr or /odm/usr for these files. A rough idea for the search path order here https://source.android.com/devices/input/input-device-configuration-files. I am in terminal as root user and /system folder has RW access.
Code:
cd /system/usr/keylayout
cp Generic.kl Vendor_046d_Product_c52b.kl
chmod 644 Vendor_046d_Product_c52b.kl
cd /system/usr/keychars
cp Generic.kcm Vendor_046d_Product_c52b.kcm
chmod 644 Vendor_046d_Product_c52b.kcm
I examine the files and nothing in particular stands out as a problem. I compare files with files from another device where the keyboard works as expected, again nothing stands out.
I begin troubleshooting further. I identify input stream from keyboard.
Code:
getevent -p
From the list I find my keyboard interacts via /dev/input/event10.
Now I can view the scan codes for keyboard.
Code:
getevent -l /dev/input/event10
Right mouse button gives EV_MSC MSC_SCAN 00090002 and EV_KEY BTN_RIGHT. This seems normal. I do the same for working device and get same codes.
I try and add line 'key usage 0x090002 BACK' to .kl file in the 'keys defined by HID usages' section but this does not work (yes I rebooted after).
Conclusions:
Doesn't look like you can change right mouse button behavior using config files in this instance. Perhaps problem in kernel. AndroidX86 does not have this issue but doesn't have the great UI.
Might be able to mod /system/framework/hid.jar or /system/framework/input.jar perhaps.
PrimeOS should have provided an option in settings to change rmb behavior if they veered away from the default usage. I'll post on PrimeOS thread.
Use esc key instead
I know this thread is old, but did anyone find solution to this? Remapping mouse clicks is the only thing I can't remap as well. Quite frustrating! Any help is greatly appreciated. I'm rooted on LineageOS via Magisk on an Onn box (Android TV)

External keyboard layout locked to US English

I bought a Teclast M40 Pro tablet to be used with an external keyboard. No problem to set the system language to my language Swedish, but I couldn´t set external keyboard layout to Swedish or any other language. I. e. all the options including this long list of keyboard layouts exist and it looks like everything is set OK, but no settings take effect. The supplier (Banggood) consulted the maker and then confirmed that the tablet was locked to US English layout. But -unbelievably - they also say that is OK and no reason for return. So, is there a workaround or any way to unlock the keyboard layout setting? The tablet runs Android 11.
bjorni said:
I bought a Teclast M40 Pro tablet to be used with an external keyboard. No problem to set the system language to my language Swedish, but I couldn´t set external keyboard layout to Swedish or any other language. I. e. all the options including this long list of keyboard layouts exist and it looks like everything is set OK, but no settings take effect. The supplier (Banggood) consulted the maker and then confirmed that the tablet was locked to US English layout. But -unbelievably - they also say that is OK and no reason for return. So, is there a workaround or any way to unlock the keyboard layout setting? The tablet runs Android 11.
Click to expand...
Click to collapse
Add Keyboard Language TECLAST M40 Pro, how to - HardReset.info
www.hardreset.info
Droidriven said:
Add Keyboard Language TECLAST M40 Pro, how to - HardReset.info
www.hardreset.info
Click to expand...
Click to collapse
Thanks for the tip. This one tells you how to add a shortcut to quickly change the language of a virtual keyboard. Unfortunately, it does not address the question how to change the key layout of an external keyboard for a tablet that has been locked to a specific language.
bjorni said:
Thanks for the tip. This one tells you how to add a shortcut to quickly change the language of a virtual keyboard. Unfortunately, it does not address the question how to change the key layout of an external keyboard for a tablet that has been locked to a specific language.
Click to expand...
Click to collapse
If the device is locked to US, you might need to root the device to modify some system files to make it work.
Try this app, it might make your changes without root.
External Keyboard Helper Pro - Apps on Google Play
Take full control over your external Bluetooth or USB keyboard.
play.google.com
Droidriven said:
If the device is locked to US, you might need to root the device to modify some system files to make it work.
Try this app, it might make your changes without root.
External Keyboard Helper Pro - Apps on Google Play
Take full control over your external Bluetooth or USB keyboard.
play.google.com
Click to expand...
Click to collapse
I have already tried it and it can´t change anything, it can only read what keys are pressed, but not communicate anything outside itself
If Settings > System > Languages & input > Physical keyboard really doesn't change things then you'll have to root your device and change stuff in /system/usr.
Have you tried a different language that you're not interested in? Not Swedish, maybe Russian or Persian to see if anything changes?
I was just helping someone who wanted Persian. The language list under Physical keyboard had 40 languages. They all were written correctly except Persian. Selecting Persian gave you fallback to English. I made them a new app with the correct Persian layout that they could load without being rooted.
Hint: You need an app that responds to android.hardware.input.metadata.KEYBOARD_LAYOUTS
bjorni said:
I have already tried it and it can´t change anything, it can only read what keys are pressed, but not communicate anything outside itself
Click to expand...
Click to collapse
Like I said, you may end up having to root the device and then modify some things in system or data partition.
Have you read this? Read every post, they approach this in more than one way.
cannot change languange on external keyboard
I have a smart tv (pilot) which run android 4.0.2 . I connected it an external keyboard (through USB). I have English and Hebrew in the keyboard. The problem is that I cannot switch language throu...
android.stackexchange.com
Renate said:
If Settings > System > Languages & input > Physical keyboard really doesn't change things then you'll have to root your device and change stuff in /system/usr.
Have you tried a different language that you're not interested in? Not Swedish, maybe Russian or Persian to see if anything changes?
I was just helping someone who wanted Persian. The language list under Physical keyboard had 40 languages. They all were written correctly except Persian. Selecting Persian gave you fallback to English. I made them a new app with the correct Persian layout that they could load without being rooted.
Hint: You need an app that responds to android.hardware.input.metadata.KEYBOARD_LAYOUTS
Click to expand...
Click to collapse
The language list is VERY long and I have tried quite a few like you suggest, but so far nothing works. I was hoping that there might be a fix or workaround that did not require rooting, but I am beginning to realize there is´nt any such thing.
Droidriven said:
Like I said, you may end up having to root the device and then modify some things in system or data partition.
Have you read this? Read every post, they approach this in more than one way.
cannot change languange on external keyboard
I have a smart tv (pilot) which run android 4.0.2 . I connected it an external keyboard (through USB). I have English and Hebrew in the keyboard. The problem is that I cannot switch language throu...
android.stackexchange.com
Click to expand...
Click to collapse
Yes, rooting is probably required :-(
It could be that they screwed up the language packs completely.
Install this little apk. It has 2 Persian and Russian.
Select the Persian (Arabic) or Persian (Latin) in Settings > System > Languages & input > Physical keyboard
To uninstall afterwards:
Code:
C:\>adb uninstall com.temblast.kbdmaps
Renate said:
It could be that they screwed up the language packs completely.
Install this little apk. It has 2 Persian and Russian.
Select the Persian (Arabic) or Persian (Latin) in Settings > System > Languages & input > Physical keyboard
To uninstall afterwards:
Code:
C:\>adb uninstall com.temblast.kbdmaps
Click to expand...
Click to collapse
Sorry for late response. I installed your apk. The Persian key layouts appeared in the list, but could not change anything more than any other layout.
Sorry. It was worth a try. Apparently the the whole mechanism is broken on your device.
Pointless note: Android did a stupid in that keymaps that are loadable are exactly the same as your garden variety in /system/usr/keychars except:
Code:
type FULL # to be found in /system/usr/keychars
type OVERLAY # to be found in loadable key maps
This causes problem when somebody glibly copies a /system/usr/keychars style keymap to a keyboard collection app.
As the there seems to be no solution, I tried another approach. I found the latest official M40 Pro EEA (M1A1) EEA firmware. It looked to be the same version I already have, but I thought at least it has not been tampered with. I flashed it and yes, it was the identical firmware and unfortunately the external keyboard issue was still there. So, unbelievable as it is, this is the version they are selling now. But worse is still to come. I then decided there was no reason why I couldn´t use the ROW firmware instead of EEA, so I downloaded that one and flashed it. No change!!!
Can any one help me make sense of this. Why is Teclast doing such a thing?
Just to avoid any idea that I don´t know how to use external keyboards, I already own 2 pcs of the older version M40 (Android 10) of the tablet, bought with some time apart and with different firmwares and both work OK with external keyboards.
Hi, I'm not sure if it is the exact same problem, but I reached this post trying to find a solution to a similar issue. I have searched a lot of places and this was the newest thread, so I'll provide the solution I found here in case it can help others.
I have a BMAX MaxPad i10 Pro tablet, Android 11, and I bought an external bluetooth keyboard with spanish layout. When I tried to use the keyboard, keys always works with an english layout, regardless keyboard layout I selected, both when configuring physical bluetooth layout or virtual keyboards layout (GBoard and SwiftKey). I tried several keyboards, even an USB keyboard with an USB type-C connector with the same behaviour, and the problem does not appear when connecting the keyboard to an iPad and to a Xiaomi Mi 8 phone (android 10), so I discard a keyboard issue
In the end, I managed to get it working by disabling the Android Accessibility Suite in the settings, that was enabled in my tablet for no reason.
Maybe this was a particular solution to my case, but all the information I found over there are unresolved questions stuck in explaing how to properly configure and selecting the keyboard layout, and no providing a valid solution.
At least, this is just a clue on something else to try...
Regards,
Álvaro.

Categories

Resources