HOWTO: Make Vol- act as a menu button - Nook Color General

Connect nootered nook (note, that's post-nootering; you're not connecting with the nooter card -in- the nook) via usb.
- # adb pull /system/usr/keylayout
-- edit 'TWL4030_Keypad.kl' and 'omap_twl4030keypad.kl' with your text editor of choice; I used vi, always a safe choice.
-- replace 'VOLUME_DOWN' with 'MENU' in each
- # adb shell
- # mount -o rw,remount -t ext2 /dev/block/mmcblk0p5 /system
- # exit
- # adb push TWL4030_Keypad.kl /system/usr/keylayout/TWL4030_Keypad.kl
- # adb push omap_twl4030keypad.kl /system/usr/keylayout/omap_twl4030keypad.kl
- # adb shell
- # cd /system/usr/keylayout
- # chmod 644 omap_twl4030keypad.kl
- # chmod 644 TWL4030_Keypad.kl
- # cd /
- # mount -o ro,remount -t ext2 /dev/block/mmcblk0p5 /system
- # exit
- # adb reboot
After this, vol down hardbutton is vol down no more, it's a menu button. Enjoy. Thanks to staulkor and the person who posted that button remapping thread.
EDIT: Thanks jasoraso, for catching a typo.

Great... Thank you very much. Additionally I will also map volume + to BACK once I got my NC.
I also don't really need the volume control... and I bet you can always use a sound manager app.

how would you undo this?

cabbieBot said:
how would you undo this?
Click to expand...
Click to collapse
Same as doing it in the first place, but replacing
-- replace 'VOLUME_DOWN' with 'MENU' in each
with
-- replace 'MENU' with 'VOLUME_DOWN' in each

Works perfect, I now have Vol Up as BACK and Vol Down as MENU

Totally awesome!!! FBreader (my favorite way to read ebooks) works fabulously now - I hate being constrained to black and white to read.
I got an NC because I really needed an ebook reader...both my Visor and my Ipaq died and I'd been reading using FBreader on my netbook, but this is sooo perfect

Yeah, that works quite amazingly! Thanks for posting!

Thanks for this tip! I have re-mapped my volume up to MENU and the Volume Down to BACK. Aldiko works great now!!!

Work great. Thanks so much.

So once you do this, how do you change your volume?

buffnutz1 said:
So once you do this, how do you change your volume?
Click to expand...
Click to collapse
Nook settings.

Would someone please pastebin these two files?
/system/usr/keylayout/TWL4030_Keypad.kl
/system/usr/keylayout/omap_twl4030keypad.kl
I messed up, and I'd like a known-good state to start from again.

So due to SoftKeys this isn't really necessary anymore... but I forget which lines I changed to menu and back...
What I have:
key 158 BACK WAKE_DROPPED
key 14 BACK WAKE_DROPPED
key 229 MENU WAKE_DROPPED
key 139 MENU WAKE_DROPPED
key 59 MENU WAKE_DROPPED
Since there isn't a back or menu button, I'm guessing just changing all BACKs to VOLUME_UP and all MENUs to VOLUME_DOWN would be sufficient, but I'm not sure... any ideas?

i remapped both buttons, works great, thanks!
now I noticed that the default NC Screen Capture function doesn't work ( hold down "n" + "vol down" buttons at the same time )
has anyone figured out a way to re-mapp this functionality?
i don't use it often, so is it just a trade off I'll have to live with?

Possible using Root Explorer?
Would this be possible to do without ADB? Instead using root explorer?
Simply replace the text files:
key 115 VOLUME_UP to key 115 MENU
and
key 114 VOLUME_DOWN to key 114 BACK
Or do the ADB commands actually replace more in the file than that?
Thanks

I am sure I've seen an app on the market which lets you remap buttons to other functions, but I sure can't find it now.
It'd be really nice to have Back/Menu AND Vol +/- available via long presses.

Awesome! Thanks. I also replaced the VOLUME_UP with BACK.
Would be great to have a widget to toggle back and forth between volume control and back/menu control with the hard keys! Anybody?

It is much easier and faster to just use root explorer to modify the lines in
system/usr/keylayout/TWL4030_Keypad.kl
change 114 to MENU
change 115 to BACK
Reboot.
Done.
To revert back just rename 115 to VOLUME_UP and 114 to VOLUME_DOWN

buffnutz1 said:
So once you do this, how do you change your volume?
Click to expand...
Click to collapse
I just use volumer++ from the market.
this is actually part of [SCRIPT - 1/9/11] NookColor Auto Config (Windows) 1.0.0 & 1.0.1
in the Dev section. http://forum.xda-developers.com/showthread.php?t=877745

methfan said:
i remapped both buttons, works great, thanks!
now I noticed that the default NC Screen Capture function doesn't work ( hold down "n" + "vol down" buttons at the same time )
has anyone figured out a way to re-mapp this functionality?
i don't use it often, so is it just a trade off I'll have to live with?
Click to expand...
Click to collapse
I believe this happened to me, too. My screen capture function no longer works after remapping my volume buttons. I'll post here if I find a solution.

Related

Remapping keys.. [camera]

I am interested in remapping the key to take a photo using the htc camera. Has this been done, or is it even possible? I found nothing specific to the hero in my searches so I'm not sure. I just hate using the trackball.
barnacles10 said:
I am interested in remapping the key to take a photo using the htc camera. Has this been done, or is it even possible? I found nothing specific to the hero in my searches so I'm not sure. I just hate using the trackball.
Click to expand...
Click to collapse
Just edit the heroc-keypad.kl(may have a different name) in system/usr/keylayout;
I always remap my "phone" button to be the "camera" instead, and then I use the "search" button for autofocus.
Decad3nce said:
Just edit the heroc-keypad.kl(may have a different name) in system/usr/keylayout;
I always remap my "phone" button to be the "camera" instead, and then I use the "search" button for autofocus.
Click to expand...
Click to collapse
So I just opened the heroc-keypad and I honestly don't know what to do in there or rather what does what. I'm real interested in this since i don't use my volume keys and eventually when the I1 comes out on sprint which will be the first sprint phone with push to talk and android I would like to port it to our phones (or try) so that we have ptt
thatguythatdid said:
So I just opened the heroc-keypad and I honestly don't know what to do in there or rather what does what. I'm real interested in this since i don't use my volume keys and eventually when the I1 comes out on sprint which will be the first sprint phone with push to talk and android I would like to port it to our phones (or try) so that we have ptt
Click to expand...
Click to collapse
Well essentially it shows you what key does what.
Code:
key 102 HOME
key 139 MENU WAKE_DROPPED
key 158 BACK
key 127 FOCUS
key 231 CAMERA
key 107 ENDCALL WAKE_DROPPED
key 191 DPAD_CENTER
key 115 VOLUME_UP WAKE
key 114 VOLUME_DOWN WAKE
Key 231 is usually "CALL" and Key 127 is usually "SEARCH"
I just went in and changed it to "CAMERA" and "FOCUS" and then pushed the file back to system/usr/keylayout/
You can also change things like "WAKE" if you want the action to wake the phone from sleep. It wouldn't be too hard to create a new action to be called by the physical button push. Though I haven't tinkered around too much with that.
Thanks gonna try some things out
thanks, I might try this. So what happens when you push the phone button on the home screen say. Does your camera boot?
barnacles10 said:
thanks, I might try this. So what happens when you push the phone button on the home screen say. Does your camera boot?
Click to expand...
Click to collapse
Yep, sometimes requires a long-press though.
Then if I push "Search" for auto-focus, followed by "Phone" again for camera, it takes a snap shot.
Really handy.

[MOD] Remap search softkey to camera

I TAKE NO CREDIT FOR THIS LITTLE HACK, THIS WAS DONE FOLLOWING THE INSTRUCTIONS FROM THIS SITE.
ALL CREDIT GOES TO Decad3nce for making this as easy as 1,2,3.
---------------------------------------------------------------------------------------------------------------------------
THIS SHOULD WORK ON ANY 2.2 ROM. I DON'T KNOW ABOUT 2.1.​--------------------------------------------------------------------------------------------------------------------------------------------------------------
***INSTRUCTIONS***​
1) Download the file HERE
2) put the "incrediblec-keypad.kl" file you just downloaded into the TOOLS folder of your Android-SDK folder.
3) run this:
Code:
adb remount
adb push incrediblec-keypad.kl /system/usr/keylayout
4) Reboot your phone, and then long press the search key to check it out!
-------------------------------------------------------------------------------------------------------------------------------------
UPDATE​
Big Thanks to Touchpro247 over on at for putting together a .zip to flash via recovery!
"Just install via recovery.
or
Un-install via recovery."
no way! i requested this exact feature a while ago on android forums but seemed nobody was interested. so i gave up, haha. so stoked to see this, at work right now, but i am def gonna install this when i get home. thank you!
Awesome find! I like to use my voice search for the search button so I instead mapped camera to the long press menu button.
Is there a way to get this working with optical pad?
Didn't think the whole menu button thing to thoroughly. Going back to Search button.
Thanks a bunch for the support guys!
I'm not too sure about the optical trackpad sorry man!
Would people be able to use Root Explorer to copy the file into designated location? I renamed the original file, just to be safe and copied the new one...then rebooted and it disabled all the soft keys...so I am back to the original for now.
Here's an update.zip for it.
Just install via recovery.
or
Un-install via recovery.
Thanks for posting!
touchpro247 said:
Here's an update.zip for it just install via recovery.
Thanks for posting!
Click to expand...
Click to collapse
Awesome touchpro...
Reason, I did it that way was I wanted to keep the original for backup. I will try update.zip. Thanks!
Tats_06 aka olta777
touchpro247 said:
Here's an update.zip for it just install via recovery.
Thanks for posting!
Click to expand...
Click to collapse
Your welcome man, thanks for posting this, I tried and tried to do this and couldn't get it. I appreciate it. updating OP.
op, thanks for posting
When I edited the the incrediblec-keypad.kl file to use a long press of the Menu button, the short press of the Menu button stopped working. So, no more menu access.
What am I doing wrong? Thanks.
Code:
key 107 ENDCALL WAKE_DROPPED
key 116 POWER WAKE_DROPPED
key 115 VOLUME_UP WAKE
key 114 VOLUME_DOWN WAKE
key 217 SEARCH WAKE_DROPPED
key 158 BACK WAKE_DROPPED
key 139 CAMERA WAKE_DROPPED
key 102 HOME WAKE_DROPPED
So, would replacing the key ID with the ID of the optical trackpad button work?
Good questions guys I wish I could be of some help but I don't know much about this stuff
WOW, this works perfectly! Thanks for posting...I always hated the search button anyway.
INTREPID-NY said:
When I edited the the incrediblec-keypad.kl file to use a long press of the Menu button, the short press of the Menu button stopped working. So, no more menu access.
What am I doing wrong? Thanks.
Code:
key 107 ENDCALL WAKE_DROPPED
key 116 POWER WAKE_DROPPED
key 115 VOLUME_UP WAKE
key 114 VOLUME_DOWN WAKE
key 217 SEARCH WAKE_DROPPED
key 158 BACK WAKE_DROPPED
key 139 CAMERA WAKE_DROPPED
key 102 HOME WAKE_DROPPED
Click to expand...
Click to collapse
Curious, did you edit it in a "unix" editor? If you used something like notepad to change it and save it, it would be saved in the DOS format. I wonder if using something like Textpad to open and save it in UNIX text format would make it work...
I used ultraedit - it may have saved it in DOS format. I'll give it another try and make sure it saves as Unix.
Is there a way to make the the search function still work on a short press? When I short press my search button it does nothing but when I long press it brings up the camera...any fix would be great thanks!
AisforAustin said:
Is there a way to make the the search function still work on a short press? When I short press my search button it does nothing but when I long press it brings up the camera...any fix would be great thanks!
Click to expand...
Click to collapse
if you do that, it may wanna bring up the search menu while you are taking a picture with this button (when camera app is open).
Farenhe1t said:
WOW, this works perfectly! Thanks for posting...I always hated the search button anyway.
Click to expand...
Click to collapse
yes , I think so.
Can anyone point me in the right direction of a droid incredible keymap? It doesn't seem that pressing the optical track pad button is mapped to anything easily recognizable in the qwerty.kl file, so I'm not sure how to find the button's ID. I looked in the optical trackpad wake thread, but the only difference I could see between that file and the one on my phone is that key 232 was changed from WAKE to WAKE_DROPPED, which I imagine wouldn't change whether the key could wake from sleep or not. I tried using the zip in this thread modified to sub in key 232 (dpad center, seems like maybe thats opti trackpad press) but it did not launch the camera as expected.
As far as I'm concerned, the ideal button mapping would be pressing the opti track pad to launch the camera app, and swiping any direction on the opti track pad to take a picture from within the camera app. First step is to get that button to launch the app, which is preferable to rebinding search, since the opti button isn't used for anything anyways.
Any help would be greatly appreciated.
im currently trying to remap the short press on my milestone to act as the long press (so i can set it to open quick settings on short press) and then the long press can be set to the search. could anyone point me in the right direction? i know how to remap keys but im having trouble changing the short and long press for my search key.

[RFC] Remapping volume buttons

The volume buttons can be remapped to other buttons by editing the file /system/usr/keylayout/sec_key.kl. The problem is changing this file requires a reboot to take affect.
I wrote a daemon to allow on the fly remapping. It works by using uinput subsystem to create a virtual keyboard, listening to the real keyboard /dev/input/event1, and sending the mapped keys to the virutal keyboard whenever a key is pressed.
In order to use it, you need to edit the file /system/usr/keylayout/sec_key.kl, removing (or commenting out with #) the first two lines, and reboot. After this step, the volume buttons are ignored. Now run the daemon (as root). The default configuration is to send SPACE/SHIFT+SPACE for VOL-/+ to firefox and the default browser, down/up arrow to tapatalk, and VOL-/+ to everything else.
The daemon opens a named pipe on /app-cache/.uinput-virtual-keyboard-fifo and can be configured using this pipe.
For example, the command
echo profile com.sec.android.app.ve 231 44
Will map the keys in the video editor to CALL (open phone) and Z.
The daemon is at http://my.svgalib.org/android/pgdn
Source at http://my.svgalib.org/android/pgdn.c
Comments are welcome.
You, dear sir, are a genious.
Really appreciate your effort. Works like a charm.
Sent from my GT-N7000 using XDA App
Can you provide for a key remap for the stock camera application? Volume up capture picture, volume down focus mode?
Thank you!
Sent from my GT-N7000 using xda premium
The file with the meaning of the keys is /system/usr/keylayout/Vendor_04E8_Product_7021.kl according to it FOCUS is 211 and CAMERA is 212. Unfortunately, FOCUS appears to do nothing, so if you run the command
Code:
echo profile com.sec.android.app.camera 211 212 > /app-cache/.uinput-virtual-keyboard-fifo
The VOL+ button will take a picture, but the VOL- button does nothing.
(There is currently no configuration file, so this command needs to run everytime the daemon is started).
MatanZ said:
The volume buttons can be remapped to other buttons by editing the file /system/usr/keylayout/sec_key.kl. The problem is changing this file requires a reboot to take affect.
I wrote a daemon to allow on the fly remapping. It works by using uinput subsystem to create a virtual keyboard, listening to the real keyboard /dev/input/event1, and sending the mapped keys to the virutal keyboard whenever a key is pressed.
In order to use it, you need to edit the file /system/usr/keylayout/sec_key.kl, removing (or commenting out with #) the first two lines, and reboot. After this step, the volume buttons are ignored. Now run the daemon (as root). The default configuration is to send SPACE/SHIFT+SPACE for VOL-/+ to firefox and the default browser, down/up arrow to tapatalk, and VOL-/+ to everything else.
The daemon opens a named pipe on /app-cache/.uinput-virtual-keyboard-fifo and can be configured using this pipe.
For example, the command
echo profile com.sec.android.app.ve 231 44
Will map the keys in the video editor to CALL (open phone) and Z.
The daemon is at http://my.svgalib.org/android/pgdn
Source at http://my.svgalib.org/android/pgdn.c
Comments are welcome.
Click to expand...
Click to collapse
Thanks for the information !..great work. Can you provide how to remap the power button for taking pictures with the camera (sorely missed especially for this device due to its size; touchscreen very awkward esp. for 1-handed shots and have been asking a lot for this even tried to do this myself based on SGS2 hacked camera but got nowhere)
Thanks !
You can try with this (untested) daemon which allows for mapping all four hardware buttons:
http://my.svgalib.org/android/pgdn4
You need to disable the buttons by also removing the 102 and 116 lines from the file /system/usr/keylayout/sec_key.kl and rebooting. By default home and power map to home and power on all applications except for camera, where power, vol+ and vol- map to camera button (take a picture).
I've tried to map the volume buttons 4cm down on the left side.
Wont work. Then i tried for another 2 hours to map them to the right side of my note. (under the on/off button).
Didn't work too...
What am i doing wrong? Do i need a screwdriver to execute the script and the buttons?
What i have done as a temporary measure is edit the
/system/usr/keylayout/sec_key.kl
so that i can use volume down button to start camera as well as take pics
Could someone explain in more detail how to run a daemon? Thanks.
[Edit] Solved. I used Script manager to run it as "is executable" as root and at boot up. But I have to copy it to the internal memory to run it, otherwise, "permission denied".
Thanks. really like it but few issues noted
1. For the camera mod as suggested in post 6 - The home button does not work after the daemon is run. Long press works however.
2. The daemon needs to be in internal memory for it to work with script manager. If in sd card it shows permission denied.
Also since its in internal memory, it gets deleted every time at boot and hence have to copy it there every time after boot.
Is there any other app to run the daemon from sdcard ?
Thanks
drgopoos said:
Thanks. really like it but few issues noted
1. For the camera mod as suggested in post 6 - The home button does not work after the daemon is run. Long press works however.
2. The daemon needs to be in internal memory for it to work with script manager. If in sd card it shows permission denied.
Also since its in internal memory, it gets deleted every time at boot and hence have to copy it there every time after boot.
Is there any other app to run the daemon from sdcard ?
Thanks
Click to expand...
Click to collapse
I put the file under /system, and it won't be deleted every time it bootup.
wonghyf said:
I put the file under /system, and it won't be deleted every time it bootup.
Click to expand...
Click to collapse
how about the home button not working ?
has that happened ?
drgopoos said:
how about the home button not working ?
has that happened ?
Click to expand...
Click to collapse
It's working for me.
wonghyf said:
It's working for me.
Click to expand...
Click to collapse
After running the script my home button does not work . Long press works.
Will try to redo everything once more i guess.
wonghyf said:
I put the file under /system, and it won't be deleted every time it bootup.
Click to expand...
Click to collapse
I think the best partition is /data. This partition is ext4, so supports executable, symlinks, etc. And is mounted rw, so it does not need to be remounted for every change.
If you want to make the daemon suid root, it has to be on /system, since /data is by default mounted with option nosuid.
MatanZ said:
You can try with this (untested) daemon which allows for mapping all four hardware buttons:
http://my.svgalib.org/android/pgdn4
You need to disable the buttons by also removing the 102 and 116 lines from the file /system/usr/keylayout/sec_key.kl and rebooting. By default home and power map to home and power on all applications except for camera, where power, vol+ and vol- map to camera button (take a picture).
Click to expand...
Click to collapse
Thanks ! works like a charm ! (finally camera with power button to take picture on note..so many camera mods but no one doing this mod which was so easily available on sgs, sgs2), Thanks !
Can someone post a modded camera apk to take pics with volume or power button?
This mod is awesome!
Thanks!!!!!
Sent from my GT-N7000 using xda premium
Surprised to that this was popping up in battery stat to use some battery....
@Taptalk-GalaxyNote
should be possible to input the passw with the volume control?
my email forces me to lock with strong password. Should be possible to start and script with a remapped button, producing to input the password stored on it and unlock screen?
Thanks a lot.

Remapping Physical Buttons/Adding Alternate Keys

I am aware that there is a thread in the Droid 4 Dev Section but as I am a "New User" I can't post there
^^ And as I am a new user please excuse any mistakes I make in posting/formatting this
I am going to be redoing this guide soon for several reasons.
A few days after I made this thread the root functionality of File Expert became something you have to pay for. I also found a good hex editor which is much clearer then Notepad ++.
There are two parts to this guide, Remapping Physical Keys/Buttons and Alternate Keys(Using the SYM key as an ALT key as on previous Droid versions).
Things to download
File Expert (I use this as my root file explorer, permission editor, etc. it also lets me remount the /system as read write which I couldn't seem to do with adb remount or busybox remount.) You dont NEED this, you should theoretically be able to use terminal/adb shell but I couldn't get it to work so this guide uses it.
KeynrTracker.apk (For Remapping buttons not covered) Attached, From http://forum.xda-developers.com/showthread.php?t=850464 - the actual button remapping tool doesnt work with Droid 4 yet
Notepad++ I would recommend using Notepad++, but any editor that can handle binary/unix files - NORMAL NOTEPAD DOES NOT WORK, NOR DOES WORD
THE PHONE NEEDS TO BE ROOTED FOR THIS TO WORK - MAKE A BACKUP OF THE FILES THAT WE ARE GOING TO EDIT
Remapping Physical Keys
The files in /system/usr/keylayout are the configuration for physical buttons, you can edit all of them, but I would recommend only editing omap-keypad.kl(Physical Keyboard) for the time being, as you could disable the capacitive buttons. IF you do somehow mess up omap-keypad.kl (I didnt have the correct permissions at first) android has a default generic version it defaults on if omap-keypad.kl doesn't work correctly, you can tell it is using this as the Caps Lock key, Shift key, SYM key wont work properly and the Arrow buttons will all be rotated to the right so up = right, right = down etc.
This part of the guide is essentially this older guide for HTC Hero, but with more customization for the Droid 4.
Either download my uploaded copy of the original omap-keypad.kl or get your own from /system/usr/keylayout/omap-keypad.kl
Open omap-keypad.kl in a text editor either on your phone(touchqode is what I use) or on your computer (Notepad++)
For this example I am going to remap the SYM key to an ALT key so it can be used in the next part of this guide.
In your text editor find
Code:
key 162 SYM WAKE_DROPPED
(It should be at the bottom) 162 is the physical scancode, SYM is the action that happens and WAKE_DROPPED tells the OS that if the phone is off pressing key 162 will wake it but it will not send the keypress. We want to make this an alt button so all we do is change SYM to ALT_LEFT (You have it be ALT_RIGHT, I'm not sure theres a difference but I use ALT_LEFT). So it should look like
Code:
key 162 ALT_LEFT WAKE_DROPPED
If you want other keys, for example I remapped the OK key to be a SHIFT_RIGHT key, you need to find the scan code for the key using the attached KeynrTracker.apk
So in this case the scancode is 232, so we go into our omap-keypad.kl file and find key 232
We see that it is mapped to DPAD_CENTER and I want to make it a shift button so I'll change it to SHIFT_RIGHT
Now we need to get our keymap back onto the phone should be as simple as
Code:
adb remount
adb push omap-keypad /system/usr/keylayout
BUT, that did not work for me so I had to use File Expert to remount and copy the file. So transfer the file to the internal phone storage/sdcard, then use File Expert to remount the /system as rw.
Go to /system press the menu button -> More -> Mount -> Mount as Read Write
Then copy the edited file from your sdcard to /system/usr/keylayout it should prompt you that there is a file there called omap-keypad.kl, select overwrite.
Then long hold on the omap-keypad.kl file and select permissions from the menu.
Make sure the permissions look like below, and click apply.
Now reboot your phone and your custom key mappings should work!
Creating Alternate Keys
The biggest issue I have from switching from a OG Droid to the Droid 4 is the fact that you have to press SYM and select your symbol instead of alternate symbols for a key.
So we already set up the SYM key to act as an ALT key in the first part, but now we have to define the keys so they do something when our "ALT" key is pressed, this data is stored in /system/usr/keychars/omap-keypad.kcm.bin, like before you can use my uploaded versions or get your own from that directory. But unlike before these aren't straight forward text files they have been converted to binary, because it is faster for the system to read. So when we open it in Notepad ++ this is what it shows
Because this file is binary/hex the all the nul symbols really = 00 in hex = 0 in binary. If you feel comfortable editing the hex code directly you can convert the document from ASCII to hex in notepad ++ under the plugin menu, and use this to figure out the characters http://www.ascii-code.com/
But for the purpose of the guide we are going to ignore the NUL symbols and change the characters. If it helps you can make a copy and open it in normal notepad because it doesnt show the null characters, BUT YOU CAN NOT USE NOTEPAD TO EDIT IT. So to set a key so it will use an alternate key when ALT(SYM) is pressed you need to find 5th instance of that in the document, so in this case I want to make the "," and "." keys be "<" and ">" when SYM is held down, so I need to change the 5th definition for the , key to < so it should look like this
Code:
NUL,NUL,NUL,NUL;NUL<NUL;NUL
And the same for the "." key
Code:
NUL.NUL.NUL.NUL:NUL>NUL:
From what I understand from poking around on the files from my phone and looking at things on the internet the first two times the character appears is defining what key has what attributes, the 3rd one is the lowercase, 4th is the uppercase, 5th is the ALT and 6th is the ALT+Shift. So with out all the Nulls this is what the Key Character Map for A looks like, A A a A a A and for "," it is , , , ; ; ; but for our edited version it is , , , ; < ; because the 5th spot is the one that represents the character you will get when you do that key + ALT.
Now to get the file back onto your phone do what we did before but put it in /system/usr/keychars/omap-keypad.kcm.bin
Make sure your permissions are the same as the one for the omap-keypad.kl
Restart and you should have a working Alternate Key Character
Awesome, can't wait to try this out. I haven't looked at all of this quite yet, but i am hoping to be able to remap caps lock, the most useless key ever, to something better. Thanks for your work!
Sent from my DROID4 using XDA App
The guide was amazing helpful for binding >< and changing caps lock to be an alt key, but I was wondering if you had any idea which file would have the operations for alt + backspace to make it clear a whole line. Again thanks for the guide.
valhala.awaits said:
I haven't looked at all of this quite yet, but i am hoping to be able to remap caps lock, the most useless key ever, to something better.
Click to expand...
Click to collapse
WHAT THE HECK ARE YOU TALKING ABOUT? CAPS LOCK IS THE BEST KEY ON THE KEYBOARD. THIS IS BLASPHEMY.
(Sorry couldn't resist )
Keyboard maps out pretty well, I did
quote -> backquote
I -> pipe
O P -> { }
K L -> [ ]
/ -> \
, . -> < >
Q -> tilde
Used CAPS LOCK as my alt key.
Left the SYM key entirely alone.
Half tempted to make caps lock and OK shift keys, make sym key the OK key, and make shift key the ALT key.
BTW, ALT+arrows and backspace work as they did on the Droid 1/2/3.
Thanks so much for posting this, really has made the Droid 4 keyboard *SUBSTANTIALLY* better!
kasouti said:
The guide was amazing helpful for binding >< and changing caps lock to be an alt key, but I was wondering if you had any idea which file would have the operations for alt + backspace to make it clear a whole line. Again thanks for the guide.
Click to expand...
Click to collapse
I'm not sure, neither of my phones(OG Droid, Droid 4) have had that functionality so I'm not sure what makes that work. If you want you can send me your keylayout and keychars folders from your old phone(Droid 2/3?)that had that, through a PM and I'll try to figure out how to add that.
kb remap
moah99 thank you thank you thank you. The one key I totally miss from my D1 is the @ key and thanks to you I have remapped the useless caps lock key to @. Caps lock would be useful except I use swiftkey that renders it inoperative on the D4.
After finding the correct key (222) with keynrtracker, I completed the rest using rootexplorer - backed up that file, mounted the containing folder as r/w, opened file in text editor, edited the correct line to show AT instead of CAPS, rebooted phone and it worked perfectly.
Tried this but....
I tried changing the key 222 (Caps lock) to power the phone off and on (when i text people and I'm watching tv i typically just leave the keyboard open and lock the phone, but the power button isn't exactly easy to find) so i wouldn't need to use the power button on top. It didn't work, is there anyway i can get it to work?
Thanks,
Jacob
moah909 said:
I'm not sure, neither of my phones(OG Droid, Droid 4) have had that functionality so I'm not sure what makes that work. If you want you can send me your keylayout and keychars folders from your old phone(Droid 2/3?)that had that, through a PM and I'll try to figure out how to add that.
Click to expand...
Click to collapse
Looks like it does support it. For some reason it was just buggy at first and didn't seem to respond to alt then left. As for the delete, I was coming from an epic and my friend with a droid 2 had told me the alt then delete would wipe the line, apparently alt has to be held when it's hit and within texting you either need 2 blank spaces before pressing it or to have just finished deleting a word. Or some odd rules like that. Thanks for the help.
Hmmm. I'm running into some oddness here, the shifted number keys look right in the kcm.bin file, but they don't work in Connectbot. It looks like they're being treated like ANSI function keys instead. Anyone else know what's up here? I've never owned a Droid-anything before, my previous two phones (G1 and TP2) keyboards work fine in Connectbot.
highlandsun said:
Hmmm. I'm running into some oddness here, the shifted number keys look right in the kcm.bin file, but they don't work in Connectbot. It looks like they're being treated like ANSI function keys instead. Anyone else know what's up here? I've never owned a Droid-anything before, my previous two phones (G1 and TP2) keyboards work fine in Connectbot.
Click to expand...
Click to collapse
See (http ://code.google.com/p/connectbot/issues/detail?id=558) Issue 558 on ConnectBots site.
here is an untouched system/usr/keylayout incase anybody needs it:
http://www.mediafire.com/?mtsl53uus6qkwfz
Help me please
So you definitely seem to understand how this works. Well i tried making my caps lock key a power key because my power key sticks really bad, and all that did was screw up my dpad (like when i would press the left arrow it would go down, etc) and so i asked for a /system/usr/keylayout file which i got and tried pasting it into the usr file to fix all the things i may have screwed up and now nothing works. The capacitive buttons, all of the keyboard and the volume and power doesn't work. What do i have to do?
remap slash key to just question mark
What is the proper designation in Omap-kypad.kl for the question mark? I wanted to convert the slash / key to just the question mark. The D1 has one - I looked at the Omap-kypad.kl on my D1 but couldn't find anything that looked like "quest" or "question", etc. On the other hand I don't see that slash in the symbol set when the SYM key is pressed so maybe I shouldn't change it. Would be nice to know if its possible though.
H0H3N5T3RN said:
So you definitely seem to understand how this works. Well i tried making my caps lock key a power key because my power key sticks really bad, and all that did was screw up my dpad (like when i would press the left arrow it would go down, etc) and so i asked for a /system/usr/keylayout file which i got and tried pasting it into the usr file to fix all the things i may have screwed up and now nothing works. The capacitive buttons, all of the keyboard and the volume and power doesn't work. What do i have to do?
Click to expand...
Click to collapse
You should check the permissions of the files using adb shell/terminal emulator.
Code:
su
cd /system/usr/keylayout
ls -l *
It should look like (with your date of course)
Code:
-rw-r--r-- root root 3383 2012-02-24 23:20 omap-keypad.kl
-rw-r--r-- root root 245 2011-12-28 15:23 AVRCP.kl
-rw-r--r-- root root 75 2011-12-28 15:23 cpcap-key.kl
-rw-r--r-- root root 1834 2011-12-28 15:23 evfwd.kl
-rw-r--r-- root root 3609 2011-12-28 15:23 usb_keyboard_102_en_us.kl
-rw-r--r-- root root 4132 2011-12-28 15:23 qwerty.kl
If it doesn't say -rw-r--r-- that means the correct permissions aren't set, so run:
Code:
chmod 0644 *
and all your buttons should work!
Your original issue was probably the same thing the permissions on the file probably weren't set right which makes it default on a generic keylayout. I did the same thing when I first was remapping my buttons and I couldn't figure out what was wrong for a couple weeks
Although this looks like a very powerful tool for remapping keys, I'm a little overwhelmed. For my previous WM phone, HTC Touch Pro 2, there used to be a very intuitive, easy-to-use remapping tool.
Is there any chance that somebody will develop another key-remapping tool targeted for the technically challenged if I wait this one out?
Can somebody tell me how I can assign "!" to shift+1?
I know. "!" is assigned to shift+1 by default. But with Smart Keyboard Pro, all symbols are messed up so I have to reassign them all individually.
I am a total noob when it comes to coding and I just remapped my search key and made it a second power key! Two minutes, root explorer did the trick.This is my first post on these forums and this is a fantastic thread for noons and pros alike!
P.S. I tried the app first but the layout file is named as QWERTY.kl in CM 7.2 RC 1 so I had to do it manually.I used your helper app to find out what I needed to change!
Cheers to the contributors of knowledge to this thread!!!!!! :beer:
Sent from my LG-P500 using Tapatalk 2 Beta-5
greekchampion04 said:
here is an untouched system/usr/keylayout incase anybody needs it:
http://www.mediafire.com/?mtsl53uus6qkwfz
Click to expand...
Click to collapse
Any way to PM me this file? It is no longer available at that link. Thanks in advance
Remmap a key to no function
Hi, I was wondering how to remmap a HArd Key to do nothing. I can eighter modify the .kl file or use ButtonRemapper, but what should I write in order to dissable this key.
The reason is because the volume down button is broken and keeps pressing itself when the phone heats up.
Thank you!
Change the keyboard layout
Hello,
I use a smartbook HP Compaq Airlife 100 with Android 1.6. This device has a physical keyboard with Spanish layout. I want to change it into a German layout. In /system/usr/keychars I find a German quertz_hawthorne_german.kcm.bin. In /system/usr/keylayout I find a quertz_hawthorne_german.kl.
At which place is the trigger for switching the used keyboard language? In the normal Android menu I can only choose English-uk, English-us and Spanish.
The only thing I have found is in /system/build.prop: ro.product.locale.language=es and ro.product.locale.region=ES
Regards Svgt99

Only for real developers!

I want to change hardware keys function on my rom. So that when screen is off, volume buttons skip music. And also when phone is active, long press on power button opens statusbar instead of power menu and it's annoying. To open power menu i have to long press power button from lockscreen. How can i change button's funcions?
Tried hard reset?
XDRdaniel said:
I want to change hardware keys function on my rom. So that when screen is off, volume buttons skip music. And also when phone is active, long press on power button opens statusbar instead of power menu and it's annoying. To open power menu i have to long press power button from lockscreen. How can i change button's funcions?
Click to expand...
Click to collapse
Can't...
Sent from my GT-S5570 using xda app-developers app
try key remapping
manoj94 said:
try key remapping
Click to expand...
Click to collapse
Edit sec_key.kl in /usr/keylayout to your liking, is very easy to edit
Format (I believe) is the following
key # is what physical key is selected - action done by that key - if it should wake up the phone
Code:
key 158 BACK
key 102 HOME WAKE
key 139 MENU
key 107 POWER WAKE
key 115 VOLUME_UP WAKE
key 114 VOLUME_DOWN WAKE
key 28 DPAD_CENTER
key 106 DPAD_RIGHT
key 105 DPAD_LEFT
key 103 DPAD_UP
key 108 DPAD_DOWN
key 217 SEARCH
key 231 CALL
key 228 CAMERA
Then push it to your phone/put in your ROM and reboot.
Paul L. said:
Edit sec_key.kl in /usr/keylayout to your liking, is very easy to edit
Format (I believe) is the following
key # is what physical key is selected - action done by that key - if it should wake up the phone
Code:
key 158 BACK
key 102 HOME WAKE
key 139 MENU
key 107 POWER WAKE
key 115 VOLUME_UP WAKE
key 114 VOLUME_DOWN WAKE
key 28 DPAD_CENTER
key 106 DPAD_RIGHT
key 105 DPAD_LEFT
key 103 DPAD_UP
key 108 DPAD_DOWN
key 217 SEARCH
key 231 CALL
key 228 CAMERA
Then push it to your phone/put in your ROM and reboot.
Click to expand...
Click to collapse
that's not what i meant....
on certain miui roms, if you long press power button it collapses statusbar, instead of showing power menu. I think the command is somewhere in framework-res.apk, but i'm not sure.
XDRdaniel said:
that's not what i meant....
on certain miui roms, if you long press power button it collapses statusbar, instead of showing power menu. I think the command is somewhere in framework-res.apk, but i'm not sure.
Click to expand...
Click to collapse
Disable power control. Try play more with ROM !
F4uzan said:
Disable power control. Try play more with ROM !
Click to expand...
Click to collapse
you mean to do that by editing build.prop? Because i don't think power control can be disabled from settings....
XDRdaniel said:
you mean to do that by editing build.prop? Because i don't think power control can be disabled from settings....
Click to expand...
Click to collapse
Settings > Toggle. Play there.
XDRdaniel said:
I want to change hardware keys function on my rom. So that when screen is off, volume buttons skip music. And also when phone is active, long press on power button opens statusbar instead of power menu and it's annoying. To open power menu i have to long press power button from lockscreen. How can i change button's funcions?
Click to expand...
Click to collapse
For volume button music control search for a guide. Its somewhere in android.policy.jar
Sent from my GT-S5570 using xda app-developers app
arpitkh96 said:
For volume button music control search for a guide. Its somewhere in android.policy.jar
Sent from my GT-S5570 using xda app-developers app
Click to expand...
Click to collapse
That was the answer to both of my problems. I replaced android.policy.jar with one that i knew was working
thank you
XDRdaniel said:
That was the answer to both of my problems. I replaced android.policy.jar with one that i knew was working
thank you
Click to expand...
Click to collapse
Ma pleasure
Sent from my GT-S5570 using xda premium

Categories

Resources