[RFC] Remapping volume buttons - Galaxy Note GT-N7000 Android Development

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.

Related

[APP+DRV] [Keys remapper] Raphael Keyboard Controller GSM/CDMA v1.4

This is what many touch pro/fuze owners want to have - ability to get full control over their keyboards.
This is for Raphael only! Do not try to install this on other devices!
Do not ask me to make a version for other device since my remappers are driver dependent and this can be very and very complicated without real device (if possible at all).
So, what is it ? It's a modified keyboard driver with configurator application for keys setup. Any key (yeah, i mean ANY, including Home and Back keys) can be reassigned to perform desired actions. Keys on a QWERTY keyboard are not an exception, they might be remapped too.
If any key has an action configured and is defined to be processed by my driver extension, it wouldn't go into the system. That is to say no one program even like AEButton will see key events processed by my driver.
Driver extension also can vibrate on any key press.
Modified drivers were tested on many ROMs based on different OEMs, so they would work in most cases.
Thanks dcd1182 for CDMA version testing.
Features:
Different event types supported: single, double and triple clicks, long presses
Two modes of key mapping: three actions per key or direct key mapping
Key repeats in direct key mapping mode
Actions sequence repeats in actions mode
Key combinations using FN modifier
Default key behaviour action - you won't loose key's default behaviour if you just want to add double click or long press to it
Different key behaviour depending on foreground process/window class/window text
Multiple rules for each key to provide different behaviour for each application you want
Multiple actions for each event
Different predefined actions:
Run program
Key press emulation
Send symbol/text to active window
Close active window
Switch to window by class/text
Terminate data connection
Wi-Fi toggle
BT toggle
Screen rotation
Power management (screen power toggle, suspend, reset)
Exceptions lists which are used to deny key remapping depending on foreground process/window class/window text
Configurable long press and double click duration
Configuration import/export in configurator
Changelog is located here.
Configurator UI localization support information is located here.
Requirements:
- .NET CF 2.0 (for configurator app)
- WM 6.1/6.5 compatible
Usage:
- Install SdkCerts.cab
- Install RaphKbdControl_XXX.cab
- Soft reset
- Check if keyboard works by pressing hardware buttons and seeing if they do their work, if not - uninstall cab, this wouldn't work on your current ROM
- If it works - go to the control panel and find "Keyboard Config" on a System page
How to define key processing:
- Run configurator (Control Panel -> System -> Keyboard Config)
- Press Menu -> Add key
- When dialog asking you to press key appears press and release desired key
- Set up needed options in key setup dialog and press OK (left softkey)
- In configurator's main window press left softkey "Update settings" to let new configuration take place (reboot is not needed, coz new settings will work immediately after saving)
What to do if keyboard doesn't work after uninstallation of this software:
- in any way stop device "KBD1:"
- for example, you can use Dotfred's TaskManager - navigate to Devices tab and find the KBD1: string, then press Stop
- delete files \Windows\keypad.dll and \Windows\kbdcntrl.dll
- soft reset
How to add new button to Buttons applet and get it working:
- add or copy existing key [HKLM\Software\Microsoft\Shell\Keys\40CX], where X is 1-6
- under this key add next values:
* Name - display name of the button in list (doesn't matter what you write here, it's only for you)
* Icon - path to icon for this button
- goto configurator and define an 'emulate key press' action for any button you want and set these values here: key code - 'App X' and check 'Win' checkbox - only in this case button will work
- save settings and enjoy newly created button
TODO:
- optimization
- Shift+?? key combinations support (if there would be requests on this)
- more actions
- other useful things
- your suggestions ?
Backup before installing of modified driver is strongly recommended.
Be careful when downloading the cab, make sure you choose the correct version suitable for your device.
Also, here is small collection of AltTab programs attached.
You can use any of them assigned as 'run program' action to desired key to switch between running programs.
well im going to try this right now, thanks
tested and works great.
side note: under the todo list adding different key behaviours depending on active window would be great
thanks
Push!
What a great app ! Couold you try to add something like multi-pressd ?
Glad to see something like this come along.
Curious, any plans to integrate with the Buttons applet found in Settings?
Cheers,
Again, excellent work!
luciusz said:
Couold you try to add something like multi-pressd ?
Click to expand...
Click to collapse
Do you mean key combinations ? I will think about it.
hilaireg said:
Curious, any plans to integrate with the Buttons applet found in Settings?
Click to expand...
Click to collapse
No. Although buttons applet and my extension do similar work, they work in different ways, so it's not possible to integrate them at this moment.
It is very cool program.
But it is not work with russian keyboard on official Rom
Or it's my mistake?
after uninstall app and soft reset do not work hardware keyboard,
and keys: on/off device (on the top side) and loudness (on left side)
What can I do?
Cool tool!!! If you implement to configure different behaviour for different programs that would be really nice!
Wow; this really does sound like the tool I was hoping for. (The hardware keyboard and the home/back etc keys? Perfect!)
Sadly, seems like the rom I am using (MightyROM5, for CDMA and Sprint) wasn't one of them... oh, well. If anyone else with CDMA has a ROM and tries this successfully, though, I'd love to know so I can try a different one.
For me, the hardware keys worked again after an uninstall and soft reset. (To turn the screen back on after it fell asleep while I was doing this, I had to hold the power key down as if I was going to force it to turn off, only longer than normal -- just a FYI if someone else has the same issue.)
ldrn said:
Sadly, seems like the rom I am using (MightyROM5, for CDMA and Sprint) wasn't one of them... oh, well.
Click to expand...
Click to collapse
Could you send me keypad.dll (hope CDMA version has the same name as for GSM) file from your ROM ?
is there a way to make a tab key ? i really would like one . i hate having to touch the screen to change entry feilds on the internet ,usually when i log into xda or myspace or anywhere that has a forums ..... i use it tons on my computer and thats pretty much my only complaint about the fuze keyboard ...NO TAB !
tarkim said:
Could you send me keypad.dll (hope CDMA version has the same name as for GSM) file from your ROM ?
Click to expand...
Click to collapse
This is the keypad.dll from MightyRom 4.16 (CDMA):
Two requests:
1.
Please let me execute .lnk files also, not only .exe files
2.
I cannot use arguments when calling exe files. Please support arguments when calling exe files in the next version.
Thanks for listening!
Oliver
gmanfuzing said:
is there a way to make a tab key ? i really would like one . ....
Click to expand...
Click to collapse
owilsky said:
Two requests:
1. Please let me execute .lnk files also, not only .exe files
2. I cannot use arguments when calling exe files. Please support arguments when calling exe files in the next version.
Click to expand...
Click to collapse
All these would be implemented in new version which I'm currently working on. Wait a few days and you'll get it
mcw
tnx for driver, will se what I can do
Nice!
Will this app let me remap the Volume Up/Down to Scroll Up/Down?
tarkim said:
mcw
tnx for driver, will se what I can do
Click to expand...
Click to collapse
Wow, thank you for taking a look at this! (And thanks Mcw for posting it.)
kusbainian said:
Will this app let me remap the Volume Up/Down to Scroll Up/Down?
Click to expand...
Click to collapse
yes
ldrn
i've analyzed CDMA keypad driver that mcw posted here, it's 90% similar to GSM version
i will patch it in a free time like my one, but i haven't a CDMA device to test it so you will need to test patched driver
Amazing app, exactly what I dream about, thanks!
I would also like to propose some more functions than just running app with keypress, like for example closing window, closing app, opening start menu, etc...
And, if anybody knows standalone symbols keypad replacement, with your superb program we can get rid of this problem: http://forum.xda-developers.com/showthread.php?p=3911050
I have an issue with this app, dunno why but only my storage card is available to search exe from, I'm unable to search exe from main memory, how comes?
Thanks

How to remap the G-key to any app?

I saw threads remap the g-key to camera. But I want to map it to a volume app.
Thanks for the help.
Here is what i found;
1.Firstly, you need a rooted LG Optimus Black.
2.Find the file“TWL4030_Keypad.kl”, it’s in /system/usr/keylayout/
3.Backup the file, copy or rename.
4.Then open the “TWL4030_Keypad.kl”, scroll down to 3rd line from the bottom, it should be “key 95 GESTURE”.
5.If you want to use your phone’s “G Button” as camera button, change it to “key 95 CAMERA WAKE_DROPPED” (Once you launch the camera app, you can press the “G button” to take a picture immediately)
6.If you want to use use your phone’s “G Button as power/lock button, change it to “key 95 POWER WAKE_DROPPED”
7.Save the changes and reboot the device.
also found in here : http://forum.xda-developers.com/showthread.php?t=1194058
You get the trick right? With a little luck you can remap it to anything you want. You can write volume i guess... But volume has 2 options "+" and "-". So even if you manage to do it you will only be able to remap one of them. It's either "volume +" or "volume -" Since G is only one button.
Thanks a lot man!
The Volume i mean is just an ordinary app from the market called "volume toggle free". So an instruction about remapping the gkey to any app should work. How?
BoyBawang2 said:
Thanks a lot man!
The Volume i mean is just an ordinary app from the market called "volume toggle free". So an instruction about remapping the gkey to any app should work. How?
Click to expand...
Click to collapse
Sorry for the confusion. I just saw the volume part. But no need to get excited, i just wanted to help. I'm sure someome knows it and will post it. Good day, man...
do you how to change "g" key to wake up the screen. I'm using marvel 4

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

Is there a way to wake the device using the volume buttons?

I'm thinking of buying this device when it will become available but I have one think that bothers me. The position of the power button is not well enough and makes it annoying when one needs to wake the device. Since htc was "kind" enough to void the warranty on rooting the device, is there a way to wake the device using the volume keys without rooting?
I also found an app called "no lock" on the play store. Does this work with the one? Thanks in advance.
I'm not even sure what that app does exactly. Removes the lock screen?
It also says it doesn't work on certain phones so hopefully someone who owns the HTC One will test it for you.
there is an app i used to use for my sensation but drained battery widget locker i think
Use the smart screen off LITE free from play store it's work perfectly with flip cover, it's use proximity sensor, when you close flap it's off the screen and on when open but can't lock screen, I use screen off and lock app to secure lock the phone with just one click or confiigure using any gesture if you use apex launcher which much battery friendly and lots of customization option if you don't like blink feed
Sent from my HTC One using xda app-developers app
Απ: Is there a way to wake the device using the volume buttons?
onlinejobwork said:
Use the smart screen off LITE free from play store it's work perfectly with flip cover, it's use proximity sensor, when you close flap it's off the screen and on when open but can't lock screen, I use screen off and lock app to secure lock the phone with just one click or confiigure using any gesture if you use apex launcher which much battery friendly and lots of customization option if you don't like blink feed
Sent from my HTC One using xda app-developers app
Click to expand...
Click to collapse
I'll take my chances and not use a cover or case of any kind. Hopefully someone will try the app I mentioned.
I know OP is asking about a no-root, app solution for this, but is there anyway at all of mapping the volume keys to power on device, even if it requires root and/or flashing files?
Cm usually has it in settings
Sent from my Galaxy Nexus using xda premium
Απ: Is there a way to wake the device using the volume buttons?
moeahmad1995 said:
Cm usually has it in settings
Sent from my Galaxy Nexus using xda premium
Click to expand...
Click to collapse
Cm is goodbye warranty. I intend to do that after at least a year.
bouss said:
Cm is goodbye warranty. I intend to do that after at least a year.
Click to expand...
Click to collapse
Oops, I forgot to quote the guy above me, he was wondering if it was even possible, even with root
Sent from my Galaxy Nexus using xda premium
Anyone got any other suggestions that dont involve root ???
App from market called Tap Tap.
Sent from my HTC Sensation 4G using Tapatalk 2
Wake on volume keys research
gustav30 said:
App from market called Tap Tap.
Sent from my HTC Sensation 4G using Tapatalk 2
Click to expand...
Click to collapse
Tried many of those apps using the proximity sensor to turn on the screen. I reall hate them because :
1- None of them would have a very high accuracy. Mostly due to the sensors on most of the phones beeing not very accurate to detect multiple wave in a short time frame. It's not their initial purpose anyway.
2- The sensor is at the far top left of the screen which does not help in any way to use turn on the screen with one hand.
3- The fact that you have to swipe 2 or 3 times in front of the sensors which are not very accurate makes it equal in time if not longer than using your 2nd hand to reach the power button.
I believe these apps are not that useful and would prefer something to wake the screen with volume keys or tactile keys at the button.
For the moment I use an app called Flip Flap which is working pretty well. You jsut have to do a quick shake like if you suddenly had to take a look at your wrist watch while holding your phone. It's a half second movement and it unlocks/locks your screen with a movement that you will not trigger by accident so it's kinda nice and quick.
But still, it's not as good as volume keys which are perfectly placed to turn on the thing.
So my phone is rooted now and I've looked into a few things.
I've read that the file handling the keymapping would be in there : /System/Usr/Keylayout and the file to be modified would be l0-keypad.kl
Unfortunately the file is simply not existing on my phone. (Maybe it's got something to do with the fact I do not use the original Android keyboard but Swiftkey instead ? Dunno.
So here is the full list of file I've got in this /System/Usr/Keylayout :
Sorry guys you'll have to enter the h before my links to see them as I don't have 10 posts and can't use external links yet
ttp://i.imgur.com/wkPts92s.png and ttp://i.imgur.com/Ab5sI3Rs.png
Unfortunately I can't find eaxctly which one is used by the phone to map the volume keys exactly.I tried to modify the Generic.kl file :
ttp://pastebin.com/0JdTHwsy
Lines 136 and 137 seems to be mapping the volume keys :
key 113 VOLUME_MUTE
key 114 VOLUME_DOWN
I have tried to add "WAKE" in the same way it is written for the POWER key : key 116 POWER WAKE
Saved the file, restarted the phone but then the file was reset to its intial value so I don't think we can modify this one.
Then I checked another folder : /sys/keyboard/
This one contains a file named vol_wakeup. Was pretty happy to find that one.
It only contains a single character : "0"
The most obvious thing was to try and replace that 0 by a 1 to enable the option but same thing as last time. After saving and restarting the phone this file was restored to its inital value with the 0 in it.
At this point I simply don't have the knowledge to go further. Blocking points :
- I don't know if physical keys like volume are mapped in a generic keyboard file or in a file specific to the virtual keyboard the user has chosen (Android default keyboard or Swiftkey or any other...). This would mean editing different files after identifying them.
- I don't know why the files I've tried to modify went back to their initial states. My phone is rooted, I used ES Explorer to get to the root folder and ES Notepad to edit them and save. I had no error message on saving so I don't think it's got anything to do with access rights.
Could use anyone's help
I was unable to find the app called flip flap. Are you sure that's it's name?
bouss said:
I was unable to find the app called flip flap. Are you sure that's it's name?
Click to expand...
Click to collapse
Nop sorry it's called Justflip :
https://play.google.com/store/apps/...MsIm5ldC5qdXN0bmljZS5hbmRyb2lkLkp1c3RGbGlwIl0.
And the review I posted about it :
"Works great on the new HTC ONE. The Roll is not very precise but the pitch trigger is very accurate. It is also easier on this phone to flip its top/bottom than rolling sideways so no trouble there. Settings for me are the following and I find it great that way : Roll tolerance 15% Pitch Tolerance 48% 500ms Would be the perfect app if it was allowign us to use volume keys (instead of the power key) to turn ON the phone screen."
iKoyy said:
Tried many of those apps using the proximity sensor to turn on the screen. I reall hate them because :
1- None of them would have a very high accuracy. Mostly due to the sensors on most of the phones beeing not very accurate to detect multiple wave in a short time frame. It's not their initial purpose anyway.
2- The sensor is at the far top left of the screen which does not help in any way to use turn on the screen with one hand.
3- The fact that you have to swipe 2 or 3 times in front of the sensors which are not very accurate makes it equal in time if not longer than using your 2nd hand to reach the power button.
I believe these apps are not that useful and would prefer something to wake the screen with volume keys or tactile keys at the button.
For the moment I use an app called Flip Flap which is working pretty well. You jsut have to do a quick shake like if you suddenly had to take a look at your wrist watch while holding your phone. It's a half second movement and it unlocks/locks your screen with a movement that you will not trigger by accident so it's kinda nice and quick.
But still, it's not as good as volume keys which are perfectly placed to turn on the thing.
So my phone is rooted now and I've looked into a few things.
I've read that the file handling the keymapping would be in there : /System/Usr/Keylayout and the file to be modified would be l0-keypad.kl
Unfortunately the file is simply not existing on my phone. (Maybe it's got something to do with the fact I do not use the original Android keyboard but Swiftkey instead ? Dunno.
So here is the full list of file I've got in this /System/Usr/Keylayout :
Sorry guys you'll have to enter the h before my links to see them as I don't have 10 posts and can't use external links yet
ttp://i.imgur.com/wkPts92s.png and ttp://i.imgur.com/Ab5sI3Rs.png
Unfortunately I can't find eaxctly which one is used by the phone to map the volume keys exactly.I tried to modify the Generic.kl file :
ttp://pastebin.com/0JdTHwsy
Lines 136 and 137 seems to be mapping the volume keys :
key 113 VOLUME_MUTE
key 114 VOLUME_DOWN
I have tried to add "WAKE" in the same way it is written for the POWER key : key 116 POWER WAKE
Saved the file, restarted the phone but then the file was reset to its intial value so I don't think we can modify this one.
Then I checked another folder : /sys/keyboard/
This one contains a file named vol_wakeup. Was pretty happy to find that one.
It only contains a single character : "0"
The most obvious thing was to try and replace that 0 by a 1 to enable the option but same thing as last time. After saving and restarting the phone this file was restored to its inital value with the 0 in it.
At this point I simply don't have the knowledge to go further. Blocking points :
- I don't know if physical keys like volume are mapped in a generic keyboard file or in a file specific to the virtual keyboard the user has chosen (Android default keyboard or Swiftkey or any other...). This would mean editing different files after identifying them.
- I don't know why the files I've tried to modify went back to their initial states. My phone is rooted, I used ES Explorer to get to the root folder and ES Notepad to edit them and save. I had no error message on saving so I don't think it's got anything to do with access rights.
Could use anyone's help
Click to expand...
Click to collapse
What you are doing is perfectly valid, but system is protected with the stock kernel and all changes to the /system partition are reverted on boot.
Yeah thanks for the update. I've learned a lot this week while looking a way to enable wake on vol.
Most of the ROMs developped for the One so far have it working, although it does not work when the phone goes to deep sleep. The HTC One source code was released by HTC yesterday so it's only a matter of time until we see many unprotected kernels popout.
The OrDroid ROM is the one with which I had the most successful experience so far : not a single problem, very close to stock ROM and wake on vol is working 9 times out of 10.
So I'd recommend everyone to check it out : http://forum.xda-developers.com/showthread.php?t=2191358

[MOD] Use camera "focus" (halfpress) button as back key

I got annoyed with reaching over our huge screen to press the back button, so I made a mod to re-map the half keypress of the hardware camera button to a back key. Holding the camera button from the home screen still launches the camera app correctly and pressing the camera button all the way still takes a picture as normal. To focus you can tap on the screen instead.
Download:
http://d-h.st/6uJ
Installation:
Flash from recovery
Update:
Apparently the zip is hosed. Download this:
http://d-h.st/8UG
and put it in /system/usr/keylayout
Gives error at flashing....
POWER1FM said:
Gives error at flashing....
Click to expand...
Click to collapse
+1
Well, I'm at a loss. I think it's a Windows EOL problem, but I've recreated the updater script in linux and it doesn't fix it. Here's the actual file:
http://d-h.st/8UG
Put it in /system/usr/keylayout

Categories

Resources