• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Root [ROM Modification]-Remapping the Search Button

Hashtag

Android Enthusiast
Ok, so I've been messing around with remapping the search button, and it wasn't working out the way I wanted it to work. So, rather than changing the function to a camera button, I modified the boot.img to run a script when the button is pressed. From this script, you CAN just open an app if you want, or you can have it do anything else you want it to do. For example, you could have it kill unnecessary background processes(if you're that type of person), mute all audio, switch the CPU governor between powersave/performance without opening a CPU app, and do anything you can possibly do with a script(which is just about everything). There isn't any sort of script manager or notification that pops up to say you pressed the button, it just happens in the background.


To set it up, you have to go through 3 steps.

1st- Download the modified kernel and put it into your ROM.

2nd- Make a script called "elitescript" in /system/bin/, and chmod 755 it to give the file proper permissions.

3rd- Go to /system/user/keylayout/, open up "touch_mcs8000.kl" in a text editor, and delete the bottom line that says "key 217 SEARCH WAKE_DROPPED"


After you do that and restart, the elitescript will run everytime you press the search key. For example, if you want it to open up the camera application, then open the elitescript and type in...
Code:
#! /system/bin/sh
am start -n com.lge.camera/com.lge.camera.CameraApp

If you decide that you just want the search button to be the search button, simply delete all text inside elitescript, and add the bottom line back to the "touch_mcs8000.kl" file.

Download the boot.img here-https://docs.google.com/open?id=0ByIGr8SqtN0cSy1XdE0yWE01azQ

Big thanks to giantpune for his kernel, and big thanks to the people in the Sleipnir thread for discussing this.
 
OK so the only part that confuses me is having to chmod 755 the "elitescript" how would I do this? Sorry if that's a dumb question

Edit: never mind I found out it was just setting permissions to rwx r-- rwx
 
I was able to finally get it working, with Hashtag's help, on ROM install, for anyone interested the details are in the Hydra thread :) As opposed to doing it post-install :p
 
What would it take to map a button to an action inside an app...say like an actual camera snap button.

Considering the remap required a kernel modification, I would say it would require a kernel modification for that as well.
 
I've been messing with this today a little bit. I'm trying to map an app to the search button but not the camera. How do I figure out what to put in the script?
 
I just went ahead and tried it with the camera app just to see if I could get it to work. I can get the script to run with Script Manager and it opens the camera app, but it's not working with the search button.

I started with Aeneas btw.
 
I just went ahead and tried it with the camera app just to see if I could get it to work. I can get the script to run with Script Manager and it opens the camera app, but it's not working with the search button.

I started with Aeneas btw.

I realize I'm a bit late, but did you ever figure this out?

If not, did you make sure to chmod the elitescript?
 
No I didn't get it to work, and yes I did chmod the elitescript.

I had the brilliant idea of remapping the search button to a task switcher app, and then I realized that long pressing the home button brings up recent apps which is basically the same thing, so I abandoned that project.

I have the search button mapped to power by changing SEARCH to ENDCALL and I'm pretty happy with that.
 
Back
Top Bottom