[HOW-TO] Remap capacitive (if you have(or any other)) buttons on any Android device - Android General

My original article on this was made for a Galaxy S3/S4/S5/S6/S7 devices because I didn't know that root directory organisation is almost the same.
This tutorial/how-to will guide you trough the process of remapping you capacitive buttons (or any other, I assure you'll figure it out!).
This however does not work on some chinese phones as I was told. Be careful when doing this, you can cause critical or even permanent damage to your device even if you do a smidge wrong.
HOW TO REMAP CAPACITIVE BUTTONS ON ANY ANDROID PHONE
If you're left handed like me, then you might wanna remap your capacitive buttons if you use the back key more often than the multitask button.
You can remap many other buttons such as volume keys and the power button, just use some logic and you'll figure it out.
As we progress on, you'll realize that there are many more things you can remap other than the physical buttons.
!!!DISCLAIMER!!!
I'm not responsible if this doesn't work for you!
I'm not responsible if your capacitive buttons don't work!
!!!DISCLAIMER!!!
1. You'll need root access for this, otherwise it won't let you edit the file
2. Go to Play Store and download any file manager app that supports root access (Best: ES File Explorer, Total Commander, Root Browser)
3. Open the file manager, and go to the root directory
4. Grant it root permissions if it doesn't ask in the begining
5. Go to the system folder, then to the usr folder and then to the keylayout folder
6. Long press on the Generic.kl file and click on Open as, then on Text and then select your prefered text editor
7. Now click on the search option if you have (otherwise you're gonna have a bad time searching)
8. Search for the word BACK, but search for the whole words
9. Change it to APP_SWITCH (make sure it's capitalized!)
10. Search again for the word MENU and change it to BACK (there may be two MENU words in the file so search twice)
11. Search for the word APP_SWITCH and change it to BACK
12. Save the fie
13. Exit and close the file manager
14. Reboot your device and enjoy!​

Nifty little guide! I'd been itching to figure out how to change the hard-mapped ExpressKeys on my Wacom Cintiq Companion Hybrid for a while now!
The only catch is that with this thing, you have to change those mappings in a file called "gpio-keys.kl" instead of "Generic.kl", which only seems to cover USB/Bluetooth keyboard and game controller mappings. At least it's a neat reference for potential key bindings, though by no means a full list.
In other words, if you can't find what you're looking for in Generic.kl, check gpio-keys.kl or even the other .kl files in that directory. You might just find your physical button mappings there.

NamelessFragger said:
Nifty little guide! I'd been itching to figure out how to change the hard-mapped ExpressKeys on my Wacom Cintiq Companion Hybrid for a while now!
The only catch is that with this thing, you have to change those mappings in a file called "gpio-keys.kl" instead of "Generic.kl", which only seems to cover USB/Bluetooth keyboard and game controller mappings. At least it's a neat reference for potential key bindings, though by no means a full list.
In other words, if you can't find what you're looking for in Generic.kl, check gpio-keys.kl or even the other .kl files in that directory. You might just find your physical button mappings there.
Click to expand...
Click to collapse
Thanks for letting me know, the same thing happened to my brother, he owns a sony xperia s or sl i can't remember

i want to add long press menu button for menu and single tap for recent apps. Help
i.e. menu key >long press > menu
---------- Post added at 04:07 PM ---------- Previous post was at 03:53 PM ----------

Hello!
I bought a EP online, but the power button its damaged,it press it self. I managed to root the device and deactivate the press power option by putting a # before the number of the key.
That worked now the phone is not pressing the key multiple times(it does but the action its null)
The problem its that the continuos Hold of the power key its making the phone to be rebooted, even after the power key its "DEACTIVATED" Is there any name for the action of reset that i can deactivate by doing the # thing?
please help!! this is driven me crazy..

Related

Re-mapping keys / Creating or re-assigning keyevent

OK, I've looked around but can't find an answer. Or at least an answer that I can understand. Basically what I'm trying to do is add the ability to quit/exit an app. I've read all about the differing opinions on quitting an app versus pressing back. However, just for my own self-teaching purposes, I want to learn how to do this. I'd like to be able to long-press or double tap a key to either immediately exit an app, or bring up an alternate pop-up menu that allows you to choose an action.
I am thinking specifically in relation to the Browser. The quit option was more necessary pre-CM6 because often times, it would take forever to load the home screen after pressing "home" in order to stop using the browser. A simple exit/quit option that some apps have, usually acts much quicker. Everyone knows that if you've been browsing through a bunch of webpages, hitting the back button repeatedly is a pain in the ass. The other option is to hit menu-->windows-->then close all the open windows-->then hitting the back button once the new window pops up because browser automatically opens a new page once all open windows have been closed.
Another annoyance is not being able to quickly get to your home page. Is there a way to remap/reassign/whatever, keys so that on long-press or double-tap of say, menu, or trackball, a menu pops up which has a "exit/quit" option and a "home page" option?
Another option is to add to the menu (when you hit menu), a "quit/exit" or "homepage" option.
Any help would be appreciated.
So much for a "supporting community". Way to help each other out.
What your trying to do should be located in the /system/usr folder. It has the key information you are trying to edit.
bubonik said:
So much for a "supporting community". Way to help each other out.
What your trying to do should be located in the /system/usr folder. It has the key information you are trying to edit.
Click to expand...
Click to collapse
Yeah, most people are probably trying to figure out a way to tell me I posted in the wrong section or that I need to use the search function. Thanks for your answer but I am familiar with the /system/usr files...I don't see anything in there relating to an action that quits/exits an app. Is there a specific action that is called when someone presses menu while using an app, and the menu brings up options including quit/exit?
Really? Nobody?
The keymap files are stored in /system/usr/keylayout, open them up and have a look at the things you can assign to keys.
Pull-edit-push the correct version for your handset hardware and reboot, changes will take effect. Obviously Magics are sapphire-keypad.kl and G1s are one of the trout files. Most G1s are trout-keypad-v3.kl though you can confirm your specific hardware version with getprop.
Have a search for "keymap" and "keylayout", you'll find there's already a bit of work been done of this, for example this auto key-changer.
I appreciate the help but I guess I'm not explaining myself properly. I have looked at the files in /system/usr/. I know how to remap a key so that, say...volume down = pause music, or change the menu key to have it end a call if I wanted...I know I'm not using the correct terminology all the time but when looking at the various .kl files, there are various "actions" that can be attributed to a particular key. For instance, keys 107 & 62 = Endcall, key 158 = Back, key 10 = the number 9.
In the column next to the numerical keycode in each of the .kl files, there is an "action" that results from pressing the particular key. The action I am looking for is a "quit" and/or "exit" action to apply to a particular key. Let's say I wanted to have key 231 in the sapphire keypad, kill the app I am using. Right now, pressing key 231 = CALL button. Is there a keyevent such as Kill_app or something to that affect that I could put in place of the CALL action so that key 231 = Kill app?

[TUT] Tasker - Hardware Button Control | Screen Off Media Player [BETA]

WARNING! THIS PROFILE IS IN BETA. DO NOT INSTALL UNTIL YOU HAVE READ BELOW!
Beta
When creating this profile I experienced bootloops and splash-screen freezes. If you are not comfortable with how to restore your device from these states, then please wait until it has been thoroughly tested before applying the profiles and tasks.
Testers
If there are any of you left after reading the above I was unable to totally identify what caused the crashes. I hope that through my own testing I have removed the probable causes, but I cannot promise. Read on if you’re still game and post below to let me know you’re in!
New to Tasker? Download your free trial from here
Theory
Have full media control using your device’s hardware buttons when the screen is off. Normal functionality restored when the screen is on.
Current Shortfalls/Work-in-progress
Fast reboot required to allow for system changes (15 second reboot).
- To my knowledge, system changes require this to take effect. Please tell me if you know different? As a consequence, the profiles take about 25 seconds from start to finish to activate and deactivate.
Hardware keys control media at all times, not just when the screen is off.
- A revert profile currently takes care of this, so it’s still more than usable.
Unable to configure hardware keys to only perform actions on long-hold
- I’m working on this, but I think it may be down to Gingerbread/kernel restrictions?
Unable to get trackpad click to perform an action
- Again, Gingerbread/kernel/ROM restrictions?
Ability to skip music folder commands unknown
- I’m working on this
Pop up menu tasks are ugly
- I’ll sort out a suitable background image and work out how to change the icons.
Preparation
This may look like another mammoth, ball-ache of a tutorial, but it’s pretty simple really – make yourself a coffee and by the time you’ve finished it, you’ll be done.
You must have full root read/write access.
1) Ensure you are running the latest version of busybox free from the Market. Even if your current ROM comes with it preinstalled, the Market version allows for this and will update it according. This is essential, as a probable cause of the bootloops I experienced. Reboot after updating it.
2) Install the Locale Execute Plugin free from the Market
3) Download Button Saviour Root free from the Market. We will be messing with the hardware keys, so if you lose control of them, this application will save you by displaying them on the screen. Have a play with this application and make sure you are fully versed with using it just in case.
4) Nandroid backup after you’ve done the above so you don’t have to reinstall everything again should things go wrong {We will be mounting the system for full write access}.
Installing and Customisation
Basically, we will be creating a file with the media controls in and asking Tasker to overwrite the existing file when we want to use it – simple.
Using a file explorer, create a folder within the sdcard/Tasker folder called ‘mediacon’. Within this folder, create another called ‘orig’. Navigate to
Code:
system/usr/keylayout/
Take a copy of the file bravo-keypad.kl (bravo will be replaced with your device name (unless you have a bravo!)). Paste it in the ‘mediacon’ folder you created. Paste another copy in the ‘orig’ folder. Open the file in the mediacon folder with a text editor on your phone (or alternatively copy/push it to your pc and view it there).
From the .zip file below, view the bravo-keypad.kl file on your pc using an application such as Notepad ++ (download free from here) or a simple text editor (although the layout may be a little confusing).
You’ll need to compare the two and see what the differences are. The most important additions to the bravo-keypad.kl to enable the media actions on the hardware keys are:
Code:
key 139 MENU WAKE_DROPPED
key 158 BACK
key 217 SEARCH
To:
Code:
key 139 MEDIA_PLAY_PAUSE WAKE
key 158 MEDIA_PREVIOUS WAKE
key 217 MEDIA_NEXT WAKE
The hardware key numbers and the remaining content of the file will no doubt be different from device to device, I assume it will also be different betweens ROMs and user settings too. You will need to preserve the remainder of the file.
Please can I ask you to post the contents of this file in ‘code’ tags if you can’t see that someone has done this for your device already. Could you also detail your ROM and Kernel. It will help others to quickly edit the file with the correct settings without scratching their heads too much – community spirit and all of that.
As you can see all we are doing is changing the three hardware buttons (menu, back and search) to perform media controls instead. You’ll need to edit the file in the ‘mediacon’ folder (either on your device or drag/push to your pc and then back again) to reflect this. Make sure you do not change the file in the ‘orig’ folder! Remember, your device may have different key numbers for the hardware buttons, this won’t matter, just edit the ones listed as menu, back and search and not the ones that have a # before them.
So, now you have your edited file done and your original file stored safely. We’re nearly there!
Install the profiles and tasks and make sure they are unchecked until you have edited them for your needs. The Tasker Media Control V1.zip folder contains the following two profiles:
MediaBoot
MediaControl
It contains the following 8 tasks:
ResetMedVar
MediaMenu
MediaContBoot
MediaContOff
MediaContOn
FastReboot
FastBootConfirm
ContState
The triggers for the tasks are:
Device Boot
Headset Plugged
If you currently have any other profiles that load music apps or perform other tasks when the headset is connected, please disable these.
Firstly, open the task MediaContOn. Click on action 4 (execute action) and select edit. You’ll see two mentions of the bravo-keypal.kl. Replace ‘bravo’ with your device name, or alternatively with whatever the original file was named in system/usr/keylayout/ (I assume it is your device name?). You’ll need to press the back button once you’re done.
Secondly, do exactly the same in the task MediaContOff.
Finally, open the task MediaContBoot and alter action number 2 to the music application you use (if you don’t use the stock android player).
That’s it! You’re done!
Terminal Command Information
There will be a number of terminal commands running, to copy and overwrite files which will mount the /system as read/write. This of course always has its risks, so ensure you have that nandroid backup just in case….
In the task FastReboot, there is the terminal command
Code:
Killall system_server
This command is not without its risks too, but it is the only way to avoid a full reboot in order to apply the system changes.
Running the task for the first time.
In the profiles and tasks, two variables are created:
%EARP – This is set to 2 when the headset is connected and 1 when it is disconnected. By removing the headset (%EARP =1), you will trigger the exit task which will begin to revert the media button changes.
%MEDIACONT – It was necessary to create this variable to avoid Tasker reacting to the headset plugged trigger after the reboot and wanting to start copying the files all over again. If %MEDIACONT = 2, Tasker will therefore know you are already controlling the hardware buttons and it will prevent the headset profile running again. The variable is changed to a value of 1, once the button controls are returned to normal. Simple hey…
When testing, sometimes these variables were showing the wrong value, due to the options to ‘cancel’ at various stages of the tasks. Before you connect your headset and run the profiles for the very first time only, you will need to open the task ResetMedVar and click on ‘test’. This will set both values to 1. At any point, if your variables go out of sync, you can repeat this exercise so the headset connected/disconnected will trigger the profile/exit task accordingly.
So, open ResetMedVar and click test to set the variables to 1. Tick the MediaBoot and MediaControl profiles to activate them and apply to exit Tasker. Insert your headset!
You’ll be prompted with the first pop-up asking if you want to active the media controls. Click to activate (it will disappear in ten seconds and cancel otherwise). Shortly after, a confirmation pop-up will confirm the files have been copied correctly. Shortly after that, another pop up will confirm you wish to proceed with the fast reboot. Click to activate and you’re device will reload the system. It should take around 15-20 seconds.
When the device boots back up, the Button Saviour application will be loaded, to ensure you have button control if things go wrong. Pressing the little arrow on the right hand side of the screen will enable a back button that you can press to back out of the screen. You media player should then load. Choose a happy tune (from a folder/album/artist that has more than one song) (not forgetting you can’t use the back button other than on the screen!) and turn the screen off.
Hopefully, search will skip forward a track, back will skip back a track and menu will play/pause the playback. WHOOP!
When you’ve finished testing, switch the screen back on, unlock it if necessary and then remove the headset. Tasker will then perform the above steps again, replace the files back to the original ones before confirming the fast reboot.
15-20 seconds later, hopefully all of your hardware buttons will then perform as normal!
Job done.
Extras
I couldn’t get the trackpad/optical joystick to perform an action on my device. There is an entry at the very end of MediaContOn and MediaContOff after the STOP. These entries copy and reversely delete a curcial-oj.kl file to /system/usr/keylayout/ that is supposed to enable the trackpad to work. Drag these to position 5 if you’d like to test them on your device to see if they work. Let me know!
Credits
localh0st for the curcial-oj.kl file here
Decad3nce for his key remapping guide here
The mass of other threads I read through on XDA to gain the knowledge to do this and the devs of the free apps mentioned above - I'm sure they'd appreciate a donate.
Oh and of course the dev of Tasker! What an application.... (I'm not on commission I promise!)
FAQ
Q) I have many other Tasker questions, can I post them here??
A) To avoid clutter, probably best to use this official Google group
Q) Where can I learn more about Tasker?
A) The manual and Profiles and step-throughs on the Tasker wiki and you’ll be up to speed in no time.
Change Log
Confirming pop up tasks may be removed in V2.
Bugs
Let me know...
Future Changes/Requests
Find another way to apply system changes without the need of fast reboot.
Hardware keys to only control media when the screen is off.
Configure hardware keys to only perform actions on long-hold to avoid 'pocket-presses'.
Get trackpad/optical joystick click to perform an action
Enable the ability to skip music folders and/or directories.
Pop up menu tasks need sprucing up.
Installation Instructions
In menu options/profile data 'Import One Task':
ResetMedVar
MediaMenu
MediaContBoot
MediaContOff
MediaContOn
FastReboot
FastBootConfirm
ContState
In menu options/profile data 'Import One Profile':
MediaBoot
MediaControl
The thanks meter lets me know I'm appreciated!
Heh, looks like Brandall is taking Tasker to new heights.
Nice work mate, but I just have to add something though...
Using this can help, BUT, it can also "cripple" those Tasker scripts you've posted about battery saving.
Using Tasker for zipping files and extracting them loads my CPU to the max, also, anything that uses notifications and file reads/writes does that too, eventually, using more battery...
Using this I can see a situation where some user might just lock/unlock their screen very often and rapidly, this might cause a major stress on the CPU, ultimately, nulling and voiding your battery saving scripts and potentially causing harm to CPU/battery/device.
And in any case, turning the screen on to switch tracks is really not that much of a hassle, for me anyway.
This is how I see it, just my 2cents.
But keep up the good work buddy, you seem to have been able to utilize Tasker to a MUCH greater extent than what I was able to, will definitely follow your posts.
Gramlengo said:
Heh, looks like Brandall is taking Tasker to new heights.
Nice work mate, but I just have to add something though...
Using this can help, BUT, it can also "cripple" those Tasker scripts you've posted about battery saving.
Using Tasker for zipping files and extracting them loads my CPU to the max, also, anything that uses notifications and file reads/writes does that too, eventually, using more battery...
Using this I can see a situation where some user might just lock/unlock their screen very often and rapidly, this might cause a major stress on the CPU, ultimately, nulling and voiding your battery saving scripts and potentially causing harm to CPU/battery/device.
And in any case, turning the screen on to switch tracks is really not that much of a hassle, for me anyway.
This is how I see it, just my 2cents.
But keep up the good work buddy, you seem to have been able to utilize Tasker to a MUCH greater extent than what I was able to, will definitely follow your posts.
Click to expand...
Click to collapse
Hi Gramlengo, I guess I can count you out as a Beta Tester!?
The logcat/zipping entries should be deleted from the other profiles if you aren't analysing them anymore to see what your phone is up to. As you said, you will use much less resource that way (they will be removed in next release)!
I do a lot of running, so being able to skip track through my pocket (without waking the phone) is essential = my motivation for working this out. For me, being in screen off state therefore won't clash with the other profiles... although saving battery power wasn't a consideration in this profile - there is plenty to spare these days The notifications are for testing and user interaction - I don't use them in my profile, it just overwrites the file and reboots...
I'm running out of ideas for the next profile, I'm open to suggestions! Good to hear you're following my posts, I'll look forward to your feedback - now sign up for this beta, you know you want to....!
Heh, I'd love to be beta testing your ideas!
Gramlengo said:
Heh, I'd love to be beta testing your ideas!
Click to expand...
Click to collapse
Looks like you might be alone there!!
Alright, finally got a time to test this one:
First, I plugged in my headset and got the two pop-up questions which I clicked activate on. Then, nothing happened. After about 10-15 seconds I got a superuser request for the locale execution plugin which i clicked allow and remember my choice on. Still nothing happened. After another 10-15 seconds I got another superuser request from busybox and quickly after a superuser request from locale execution plugin, both which I clicked allow and remember my choice on.
Then the phone finally fast-rebooted. When it was back up and fully loaded, the music application started. I started a tune, switched off my phone screen, and clicked the back button, nothing happened. I clicked the search button, nothing happened. I turned the screen back on, and hey, the back button still functioned as a back button, and the search button still worked as a search button.
What did I do wrong?
My device is a desire HD running leedroid Hd (latest version and kernel).
Does this have something to do with the Desire HD having capacitive buttons?
Will try again, but this time by remapping the physical volume buttons and the physical power button.
I have also attatched the original keymapping file, and my modified one.
Edit: That didn't work. Opened root explorer to see if the values were right, and they were. I also noticed another keymapping file called "spade-keypad-v0.kl" (without the "). Will try to edit the values in this file to see if that will work.
Edit2: Editing the back,menu and search button in spade-keypad-v0.kl didn't work. Will try to remap the volume and power keys.
Edit3: Ok, two more combinations to test: Editing the capacitive buttons in both files, and afterwards editing the physical keys.
Edit4: No luck, I have attatched the other spade-keypad-v0.kl for you to look at. Hope you can fix this!
torsrex said:
I have also attatched the original keymapping file, and my modified one.
Edit: That didn't work. Opened root explorer to see if the values were right, and they were. I also noticed another keymapping file called "spade-keypad-v0.kl" (without the "). Will try to edit the values in this file to see if that will work.
Edit2: Editing the back,menu and search button in spade-keypad-v0.kl didn't work. Will try to remap the volume and power keys.
Edit3: Ok, two more combinations to test: Editing the capacitive buttons in both files, and afterwards editing the physical keys.
Edit4: No luck, I have attatched the other spade-keypad-v0.kl for you to look at. Hope you can fix this!
Click to expand...
Click to collapse
Appreciate your testing torsrex. Nothing's ever simple is it... Did you fast reboot every time you applied changes to the files?
In the file spade-keypad-v0.kl, did you set them like this:
Code:
key 102 HOME WAKE_DROPPED
key 139 MEDIA_PLAY_PAUSE WAKE
key 158 MEDIA_PREVIOUS WAKE
key 217 MEDIA_NEXT WAKE
Check they had applied with a file explorer first and then fast rebooted?
Let me know!
I checked that the files were changed every time with root explorer. I also tried a normal reboot if the fast reboot didn't work (Did this all the times I had changed a file), and I tried copying the files manually with root explorer.
I tried to change the values of the spade-keypad-v0.kl to what you typed, but that didn't work either. Maybe I should also mention that after I changed the back-key, menu-key and the search-key to media controlls, the home button also won't work.
Does this have something to do with having capacitive buttons and not physical buttons (I think the button turns them self off when I put on the screen lock)?
torsrex said:
I checked that the files were changed every time with root explorer. I also tried a normal reboot if the fast reboot didn't work (Did this all the times I had changed a file), and I tried copying the files manually with root explorer.
I tried to change the values of the spade-keypad-v0.kl to what you typed, but that didn't work either. Maybe I should also mention that after I changed the back-key, menu-key and the search-key to media controlls, the home button also won't work.
Does this have something to do with having capacitive buttons and not physical buttons (I think the button turns them self off when I put on the screen lock)?
Click to expand...
Click to collapse
Ok, sounds like you've been pretty thorough. I knew the set-up would be different device to device, but didn't think it would be difficult to establish how.
I guess all we can do is use an app to discover the changes that need to be applied on your device. Check out ButtonRemapper and after it applies the updates, take copies of the files it has adjusted (assuming the app works for you!). Let me know!
Tried the buttonRemapper application from the market, and It worked! The buttons (menu, back and search) got remapped, but I noticed that the screen needed to be turned on before I could press them (no need to enter any pin code or dragging down the slider, just pressing the unlock button). I have atattched all of the kl-files.
torsrex said:
Tried the buttonRemapper application from the market, and It worked! The buttons (menu, back and search) got remapped, but I noticed that the screen needed to be turned on before I could press them (no need to enter any pin code or dragging down the slider, just pressing the unlock button). I have atattched all of the kl-files.
Click to expand...
Click to collapse
Ok, I'm confused now... I can't see any difference between what you did to what the app has done...? Can you?
When the changes are applied in the app, it must take a copy of the original files it's about to change and store them somewhere. Is there a ButtonMapper folder on the SD card? Perhaps have a look in there when the controls are changed for media? See if there is just one file, or if there's an additional one we haven't considered..?
Then we'll solve the screen off use!
Hm, can't find the backup folder, it isn't on the sd card and it's not in the keylayout folder.
torsrex said:
Hm, can't find the backup folder, it isn't on the sd card and it's not in the keylayout folder.
Click to expand...
Click to collapse
Damn it! I'm going to have a search around and see what I can come up with... I'll be back...
Is your device fine after the fast reboots? That's why I put this as a beta as I didn't know how stable it would be compared to a full reboot...
Using the buttonremapper application, I didn't face any issues. Using the tasker-profiles (editing the files manually) caused the home button, back button, menu button and search button to not function any more and I had to restore a nandroid backup. Maybe you should get the correct setup files for each phone before you take it out of beta
By the way, I sent a message to the developer asking him where the buttonremapper application saves it's backup-files, hopefully I will get a quick answer!
torsrex said:
Using the buttonremapper application, I didn't face any issues. Using the tasker-profiles (editing the files manually) caused the home button, back button, menu button and search button to not function any more and I had to restore a nandroid backup. Maybe you should get the correct setup files for each phone before you take it out of beta
By the way, I sent a message to the developer asking him where the buttonremapper application saves it's backup-files, hopefully I will get a quick answer!
Click to expand...
Click to collapse
Good work! And thanks for testing... I need a lot more volunteers like you for each different device, but I don't see them flocking!
Just got a reply from the developer: "in its data directory in the subdirectory files: /data/data/com.beansoft.buttonremapper/files."
So here you go.
torsrex said:
Just got a reply from the developer: "in its data directory in the subdirectory files: /data/data/com.beansoft.buttonremapper/files."
So here you go.
Click to expand...
Click to collapse
Good work again Sir! I'll take a look at the files and see what else is needed for devices with capacitive buttons (which I'm hoping is the only difference...).
Someone just released a trackpad wake for all AOSP ROMs (without messing with the kernel?) over in the Desire forum, so I'm currently looking at that too...
Always something to do... speaking of which, I need you over here next
So I was bored tonight and thought I'd try and revive this project.
What I've got is still a work in progress, but it basically involves using Buttonremapper to reassign volume_up and volume_down to fast_forward and rewind, then use Tasker's 'state: media button pressed' to forbid any other apps from responding to those two buttons and have them act out Tasker tasks only.
One button is set to play/pause media (if screen is off) and raise volume (if screen is on) and the other set to skip forward media (if screen is off) and lower volume (if screen is on). The end result is almost full media control from hardware buttons without having to look at the phone or take it out of your pocket: use the volume up and down buttons to skip and pause tracks, or press power to turn the screen on and change their function to volume up or down temporarily before reverting back to skip and pause as the screen times out. You don't need to be looking at the screen while this is happening.
The problems at the moment are:
1) While two buttons have effectively been made into four, there are five necessary functions - volume up, volume down, play/pause, next track, previous track. I figured previous track was the least important but it would be nice to have it as well.
2) Normally the volume buttons in Android are context-sensitive, changing media or system or whatever volume depending on where you are. With this they're always assigned to media volume, so you'd need an app like Audiomanager or something to change the volume of other things.
3) Other problems that I haven't realised yet.
One other thing, Tasker's 'state: media button pressed' lets you set both long presses and short presses, but they don't seem to play nice together. I think both the long press and short press tasks activate and conflict when the button is held down, but I haven't had a look at this yet.

[MOD] External Search Key (Switching jump key and Search Button)

With this you can simply have your search key where the jump key is.
i decided to do this when i figured out that the search key can also jump to the apps you set your jumpkey to jump to (making me think WTF do i need the jump key for then?) but its used to jump back to recent apps. i just use "prehome" from the market for this (double tapping home bring up recent apps like the way holding home on other android phones would do)
basically you dont loose anything and this mapping is easy to adjust to.. you can still jump back into apps but you have to use the keyboards seach button to launch the jumpkey app. both of them (search and jumpkey) launch apps when pressed with another button combo if you have a jump set. i Just think its smart/convenient to have a External search button Like most phones do. Also holding the jumpkey will activate voice search
First you need to be rooted.. then download super manager (or a root file explorer like root explorer) Open Super manager and tap the setting icon and enable root.
Then just download the file below
Unzip it, put the File on your SD card
With Super manager Take the file and place it in system/usr/keylayout .. overwriting the existing file. then reboot and your done.
Works great! Now I don't have to flip my keyboard open to do a voice search lol
would there be any way to set the trackball click to search instead? It was discussed in another thread but idk if anyone tried it.

Broken Capacitive Button Workaround!

Alright, the Galaxy series, although awesome, suffers from some issues. None are as frustrating as when the damn capacitive (bottom) buttons stop working!
Normally it seems that all four bottom buttons don't fail at the same time, just one or two. This doesn't seem to be as much of a physical problem as a software one, probably an application running in the forefront that is blocking them. Now it is hard to do much of anything if the settings button (left side) fails, as you cannot access most settings for your apps. Both my outside buttons rarely work, the aforementioned settings button (left) and the search button (right). Search button doesn't matter to me, I can call up search on screen easily enough. The other two are home and back buttons. Back is more necessary than home. So to work around this Samsung-induced-pain-in-the-ass, I swapped the search button function for the home.
Here's how:
Make sure you are roted and have a rooted file manager. Root Explorer tends to work best.
1. Open Root Explorer, and make sure it is mounted r/w.
2. Navigate to /system, /usr, /keylayout.
3. Tap/hold Broadcom_Bluetooth_HID.kl, and select 'Open in Text Editor'. If you get a Warning message, that means you are mounted r/o so you just need to click the Mount R/W button above.
4. Change key 139 to read HOME instead of MENU.
Change key 102 to read MENU instead of HOME.
Hit the back capacitive button and choose to save. It will create a Broadcom_Bluetooth_HID.kl.bak file also so if you want to undo this then just erase the new Broadcom_Bluetooth_HID.kl file and then erase the .bak off the other file.
5. Now open the melfas_touchkey.kl file the same way by holding it until it allows you to select 'Open in Text Editor'.
Change key 139 to read HOME instead of MENU.
Change key 102 to read MENU instead of HOME.
Hit the back capacitive button and choose to save. It will also create a .bak file.
6. Open the qwerty.kl file by holding it until it allows you to select 'Open in Text Editor'.
Change key 102 to read MENU instead of HOME.
Change key 139 to read HOME instead of MENU.
Hit the back capacitive button and choose to save. It will again create a .bak file.
7. Back out of Root Explorer and restart your phone.
Now, when you push your home button it will bring up your settings menu in whatever application is open, and your settings button will do the home function (or nothing, as my outside buttons do as they don't usually work). I now use my back button to get me to home, it just takes a few more pushes as it goes one step at a time. Not as much of a pain as not being able to set program functions, that's for sure!
Note: Depending on your setup, the file names might be slightly different on other Android devices, but they will always be very similar. They'll all have a bluetooth.kl, touchkey.kl and qwerty.kl (or whatever your keyboard layout might be). You can also fool around with other key settings if you wish to experiment, depending on what is and is not working at the current time. Just save your original .bak files so you can put it back to normal easily. If you alter the .kl file more than once, it will overwrite the .bak file again (which is not used by the phone) so make sure you copy the .bak's to another directory (such as /sdcard/backups or your regular computer).
Hope this makes your lives easier and don't forget to thank me if I helped you.
Modified Home key acting up
So after using this mod for a little while, it has been working well except for some slight stalling of response from the capacitive buttons (which was happening before the mod) and an awfully annoying habit of backing out of programs by itself due to the modified left button which was originally Settings but I changed to Home with the above mod. When this happens, I can see the left button go dark as if it's been physically pressed, so obviously there is some electrical or software malfeasance happening there.
The fix to this problem is to navigate to your /system/usr/keylayout folder again and:
Delete: "key 139 HOME"
In each of these three folders we altered earlier:
Broadcom_Bluetooth_HID.kl
melfas_touchkey.kl
qwerty.kl
The result is that no action is associated with the leftmost capacitive button, which is fine because it wasn't working properly in the first place. This was becoming problematic as I typed in Terminal or while using my Ubuntu build on the phone.
Now, if there was also a problem with the search popping up by itself then you would just have to delete "key 217 SEARCH". Remember why I initially did this was because the outside capacitive buttons were not functioning properly and I needed the settings button more than home while in programs.
Fully Functioning Capacitive Button Workaround
I actually found a specific need for the home key.
When in Terminal Emulator, if I want to back out to the main screen and access another application, I have to use my back button. Trouble is, the back button also closes out the terminal session, which is a pain in the *ss if I want to just look up something in my browser and then go back to it. I have to then restart my session and retype on the small as hell keyboard. So I was thinking, how am I going to implement a home key function in my drop-down start menu which is always accessible and low-and-behold, here it is:
SoftKeys for Root Users
https://market.android.com/details?...EsIm5ldC5ob29wYWpvby5hbmRyb2lkLlNvZnRLZXlzIl0.
This is a great app. Solves the problem. Starts immediately on boot.
There's also this for just a home key in the start menu drop-down, no start on boot though:
BK Softhome
https://market.android.com/search?q=bk+softhome&c=apps
Problems solved! I now have disabled all 4 capacitive buttons while using Softkeys for Root Users for all functions. (Delete: key 102, key 139, key 158, and key 217 in all three folders listed in original post)

[Q] button remap?

Is it possible to remap the menu button on the verizon s 3 to multitasking?
I'm going to think your going to have to be rooted, and maybe change something in the build prop.
Apex launcher let's customize buttons in the settings.. Just download it from the play store!
http://forum.xda-developers.com/showthread.php?t=1789000
Check out this thread. This app remaps home button but on the app Page in play store the same dev also has an app that remaps other buttons if I'm not mistaken.
Hope this helps.
Home2shortcut
Sent str8 from my half eaten Banilla Ice Cream Samich
Yes, its possible, I have my buttons totally remapped with:
Menu button - Home/Multitasking
Home button - Menu/whatever holding it down does
Back - Back
I also made it so that the home button doesn't wake the phone as well.
In a couple days (or whenever i have time really) im gonna put a guide together how to do this in detail (i havent seen an extensive one yet).
BEFORE DOING THIS, BACK UP EVERYTHING!!! I'M NOT RESPONSIBLE FOR ANY PROBLEMS OR MISHAPS.
Also, you need root for your phone to mount the system as writable.
NOTE when i first did this, i only changed one at a time, and made the mistake as not having a Menu button (i had two home buttons and a back button) which proved tricky to find a way around. Just be very careful!
In short, modify the files sec_touchkey.kl and sec_keys.kl within ES File Explorer or Root Explorer under ~/system/usr/keylayout/ . As soon as you edit these and save them, the App will automatically create a sec_touchkey.kl.bak or sec_keys.kl.bak file next to your modified file. After an edit, you'll need to reboot your phone for the changes to be in effect.
I would advise to look at these files in detail before mounting the system as writable, to avoid mistakes.
Good luck!!
usatf1290 said:
Yes, its possible, I have my buttons totally remapped with:
Menu button - Home/Multitasking
Home button - Menu/whatever holding it down does
Back - Back
I also made it so that the home button doesn't wake the phone as well.
In a couple days (or whenever i have time really) im gonna put a guide together how to do this in detail (i havent seen an extensive one yet).
BEFORE DOING THIS, BACK UP EVERYTHING!!! I'M NOT RESPONSIBLE FOR ANY PROBLEMS OR MISHAPS.
Also, you need root for your phone to mount the system as writable.
NOTE when i first did this, i only changed one at a time, and made the mistake as not having a Menu button (i had two home buttons and a back button) which proved tricky to find a way around. Just be very careful!
In short, modify the files sec_touchkey.kl and sec_keys.kl within ES File Explorer or Root Explorer under ~/system/usr/keylayout/ . As soon as you edit these and save them, the App will automatically create a sec_touchkey.kl.bak or sec_keys.kl.bak file next to your modified file. After an edit, you'll need to reboot your phone for the changes to be in effect.
I would advise to look at these files in detail before mounting the system as writable, to avoid mistakes.
Good luck!!
Click to expand...
Click to collapse
Nice! So it's possible to map the menu key to "open apps" after all? I tried messing with those files awhile ago but couldn't get the menu remapped to recent apps and hold home for menu.
I've looked all over, and tried a lot of things, and its proving more difficult than i had thought to simply remap menu longpress to recent apps, and home longpress to menu.
I tried lots of things such as switching around the order, adding "APP_SWITCH" After HOME, and "RECENT" after HOME.
It seems to me there is no command that would readily do this.
In order to do this, I'll have to dig and find where the command "HOME" actually is, take out the recent apps section from that, and add it to the location of the "MENU" command.
However, if you don't mind using the Menu button as a home button (for now), and the home button as a menu button, its as simple as switching HOME and MENU within the sec_touchkey.kl file (then rebooting).
Bumpers
Try downloading nova launcher. You can remap the keys inside its settings. I used it to set the home key to google voice search.
werked said:
http://forum.xda-developers.com/showthread.php?t=1789000
Check out this thread. This app remaps home button but on the app Page in play store the same dev also has an app that remaps other buttons if I'm not mistaken.
Hope this helps.
Home2shortcut
Sent str8 from my half eaten Banilla Ice Cream Samich
Click to expand...
Click to collapse
Good find! thanks for that. This seems to be a good app, however it is not working the way i want it to. I have Nova launcher pro installed, and the ported version of Google Now. I wanted to map the double press to launch Google now, but could not make it work. I could remap anything else though, so this is a good app to have.
---------- Post added at 01:31 PM ---------- Previous post was at 01:21 PM ----------
kmdtcs said:
Try downloading nova launcher. You can remap the keys inside its settings. I used it to set the home key to google voice search.
Click to expand...
Click to collapse
I as well have Nova Prime. I could remap the home button, but not the double tap on home button. (maybe this will help someone else out as well)

Categories

Resources