[MOD] Remap Any Key on Your G1 (v3, Now can play/pause/skip Music with Camera Key)

Search This thread

Geniusdog254

Retired Recognized Developer
Jan 2, 2009
1,110
169
St. Louis
NOTE: THIS IS JUST FOR WINDOWS
Although it is easily modded for other systems, but the fancy script doesn't work on its own. Just manually delete the versions of the files that are already there (only of the ones that are in this .zip, leave the others) and then push the new files there.

NOTE 2: This is just for the camera mod, to see how to remap any key see post 2 in this thread.

Thanks to Drizzy Drake Rogers this is now featured in the new Hero 1.79.482.3 .img files released by Haykuro & cooked up by Drizzy!

This is a mod that allows you to map the camera button as the search button.
It is very simple to understand what it does if you just look at the files included in it, so I don't want to write out a whole drawn out explanation here.

Let me start by explaining this, I loved the new global search feature in CM 3.9.11.2, but I hated not having a dedicated search button off the keyboard. So I looked at the keyboard layout files and modded them to change the rarely used camera button to a search button. Also, if you long press on whatever mode you choose, it will give you voice search.

Also, there are 2 modes for the camera button, FOCUS which is where it is pressed halfway down, this focuses in the camera app, and CAMERA which launches the camera app from anywhere on the phone & also snaps a pic in the camera app.

There are four versions of this file, each in it's own folder;

Both Search: Both FOCUS & CAMERA are mapped to search & bring it up.

Camera Search, Focus Normal: Only CAMERA is mapped to search, FOCUS
still focuses and takes a pic in the camera app.

Focus Search, Camera Normal: Only FOCUS is mapped to search, CAMERA
still launches the camera app from anywhere on the phone.

Stock: Pushes back the original files to an unmodded state.

To install it, just run Install.bat and press 1, 2, or 3 based on whatever choice you want. All this script does is use the copy of ADB found in the directory to remount the /system partition, delete the original files in /system/usr/keylayout/, push the new files, and reboot the device.

I hope you enjoy this mod and please post feedback.

EDIT: READ IF .bat DOESN'T WORK OR YOU AREN'T ON WINDOWS!

To do this manually, just follow these directions (assuming you have ADB set up, otherwise there are guides on XDA to set it up):

1. Go to the folder of the mod version you want.

2. Run the following commands in ADB:
adb remount
adb shell rm /system/usr/keylayout/trout-keypad.kl
adb shell rm /system/usr/keylayout/qwerty.kl
adb shell rm /system/usr/keylayout/trout-keypad-qwertz.kl
adb shell rm /system/usr/keylayout/trout-keypad-v2.kl
adb shell rm /system/usr/keylayout/trout-keypad-v3.kl
adb push trout-keypad.kl /system/usr/keylayout/
adb push qwerty.kl /system/usr/keylayout/
adb push trout-keypad-qwertz.kl /system/usr/keylayout/
adb push trout-keypad-v2.kl /system/usr/keylayout/
adb push trout-keypad-v3.kl /system/usr/keylayout/

3. Reboot your phone.

EDIT: Wooohoooo! Just leveled up to senior member, this was post #100 :D

V2 is now up. Includes the option to push the stock files back, so feel free to try any mods without worrying about reflashing.


SEE POST 34 FOR MUSIC PLAY/PAUSE/SKIP ABILITY!!
 
Last edited:

Geniusdog254

Retired Recognized Developer
Jan 2, 2009
1,110
169
St. Louis
Ok, just to clarify a little here. These files included can be changed to remap any key to any other key. I personally have also remapped the MENU key on the actual keyboard (not the button under the screen above the trackball) to be my shift key, since that is physically more comfortable.

To do this, just open the .kl files (from any mod version, just make sure you have a complete set of them) in your text editor of choice. Then, find the key you want to change, they have labels like this (this is how I changed the camera button):

key 211 CAMERA

change to: key 212 SEARCH

Also, you may notice that some keys have the WAKE tag next to them, add this tag to any key to set it to wake the phone when pressed. I'm not quite sure what the WAKE_DROPPED tag is though.

And, for those of you that are wondering, key 59 is currently marked as MENU, change it to SHIFT_LEFT to make it a shift key as well.
 
Last edited:

prash

Senior Member
Feb 7, 2009
565
16
Philadelphia
Awesome idea for remapping the menu key the shift key, I can see how that can be a littler easier on the hands. I may have to try this out.

Thank you for sharing your find! I would have figured this would have been harder than it seems.
 

xidominicanoix

Senior Member
Oct 9, 2006
1,080
4
FL
Awesome idea for remapping the menu key the shift key, I can see how that can be a littler easier on the hands. I may have to try this out.

Thank you for sharing your find! I would have figured this would have been harder than it seems.

believe it or not, but this is the first time i even noticed that menu key ;)
 

Geniusdog254

Retired Recognized Developer
Jan 2, 2009
1,110
169
St. Louis
did anyone try this on a Hero rom?
I haven't tested it on a Hero build, and probably won't as I need my G1 stable. However, there should be no issues with it unless it is changed in the ROM. Later today I will upload v2 that has the option to push the original files as well.

Is this only for the G1, or could this be adapted to any android device with a keyboard?
In theory, it should work on any With Google or standard Android build, and probably even custom mfg ROMs like Hero unless they choose to change the way they map the keys (think hard-coded values).
 

Dror520

Senior Member
May 28, 2009
384
4
this works on the Hero rom! and also when you long press the camera button it will give you the voice search! thanks! for this!
 

Bavilo

Senior Member
Apr 20, 2009
682
28
Marburg
There is one thing I have missed on the G1's keyboard since the day I got it. A proper Tabular key.

When we press tab now, it just adds about 4 spaces.

What I want it to do is jump to the next element. Just like in text areas where you can simply jump to the next field.
 

Geniusdog254

Retired Recognized Developer
Jan 2, 2009
1,110
169
St. Louis
There is one thing I have missed on the G1's keyboard since the day I got it. A proper Tabular key.

When we press tab now, it just adds about 4 spaces.

What I want it to do is jump to the next element. Just like in text areas where you can simply jump to the next field.

Unfortunately that is something that would require a code change instead of just a file mod, since that feature isn't in the Android OS. I guess they thought that since they require a 4-way+center button d-pad they figured that we wouldn't need a tab key, since you can just scroll with the trackball, or in the case of phones like the Galaxy, just press the arrow key or screen.
 

menzo44

Senior Member
Jan 31, 2009
137
2
44
Royal Oak, Mi
thank you so much for this mod. I have been hoping and wondering for awhile about this. XDA IS AWESOME!!! :D
 
Last edited:

menzo44

Senior Member
Jan 31, 2009
137
2
44
Royal Oak, Mi
can someone please help me getting this to work. I plugged my phone in and ran the bat file but get a error message...adb is not recognized as a internal or external command, operable program or batch file..... I did it with adb connected and not connected and got the same error. If i click on the adb.exe in the download I get another error? help me please
 

Geniusdog254

Retired Recognized Developer
Jan 2, 2009
1,110
169
St. Louis
^^^^

Thats strange, if its not working for you all you have to do is do it manually, here is a guide (this assumes you have ADB already set up, I won't say how to do that here, there are guides on XDA):

1. Go to the folder of the mod version you want.

2. Run the following commands in ADB:
adb remount
adb shell rm /system/usr/keylayout/trout-keypad.kl
adb shell rm /system/usr/keylayout/qwerty.kl
adb shell rm /system/usr/keylayout/trout-keypad-qwertz.kl
adb shell rm /system/usr/keylayout/trout-keypad-v2.kl
adb shell rm /system/usr/keylayout/trout-keypad-v3.kl
adb push trout-keypad.kl /system/usr/keylayout/
adb push qwerty.kl /system/usr/keylayout/
adb push trout-keypad-qwertz.kl /system/usr/keylayout/
adb push trout-keypad-v2.kl /system/usr/keylayout/
adb push trout-keypad-v3.kl /system/usr/keylayout/

3. Reboot your phone. It should all work.
 

CC CEO

Senior Member
Jan 14, 2008
144
1
so would this mod allow for the hardware buttons to be changed? id love for the TALK button to go straight to the dialer rather than 2 the call log in cyanogen/google based roms.
 

Geniusdog254

Retired Recognized Developer
Jan 2, 2009
1,110
169
St. Louis
so would this mod allow for the hardware buttons to be changed? id love for the TALK button to go straight to the dialer rather than 2 the call log in cyanogen/google based roms.

Again, this is a software issue, either in the dialer app or the main OS. This mod will allow you to assign any button to function as any other button, but it WILL NOT let you add a new function to a key, sorry.

menzo44 said:
thanks for the reply, yes i have adb setup and i am going to give it a try now. THanks
No problem, I want this to help other people as it has helped me. Let me know if it works.