Tips - use G button as camera button / lock screen (change key binding)

Search This thread

asdfasd2

Senior Member
Aug 26, 2008
68
10
Anyone got this working in CM10? I read through the thread and only saw posts with CM7. Thanks
 

dcop7

Senior Member
Jul 5, 2011
3,217
1,923
Leiria
Did anyone successful change the G button to lock/unlock in CM10?

I played a bit with the files and I only ended up with my hardware keys not working hehe
 

asdfasd2

Senior Member
Aug 26, 2008
68
10
Never mind, I got time to try it myself with the method below and it works (the camera).

Thx, worked with cm7 rc1 and Huexxx modified custom kernel.

BTW: there was no " TWL4030_Keypad.kl", just a "qerty.kl". I modified the querty.kl with track13's method and made a copy of this file naming it into TWL4030_Keypad.kl. I don't know which file made the affect but it works. I also deleted the stock key 95 entry.

Sent from my LG-P970 using Tapatalk
 

Android_ICS

Member
Aug 1, 2012
34
9
Nuernberg
Recent Apps

Does anyone know, which command/code would turn the g-button to a "recent-apps"-button. I know that this was a function in one of the roms, but hardly can´t rember in which one... :confused:
 

dcop7

Senior Member
Jul 5, 2011
3,217
1,923
Leiria
To set the G button to lock/unlock in CM10 do this:
go to /system/usr/keylayout and open Generic.kl

Edit the line that starts with "key 95" and change to this:
key 95 POWER WAKE_DROPPED

Set permissions: rw-r--r-- and reboot :)
 
Last edited:

Cazuo

Senior Member
Jun 1, 2012
51
9
do you know if the g button can take pictures in cm10 with that edition from first post?

Sent from my LG-P970 using xda app-developers app
 

rv0000s

Senior Member
Sep 22, 2012
259
177
New Delhi
I found it in a chinese forum (bbs.gfan.com/android-2014369-1-1.html)

I'm sure most people found the G button useless, so it would be nice to change that. The following is my experience with it:

The position of the G button make it perfectly useful as lock/unlock button, you can use it to shutdown as well, but cannot use it to switch on the phone, I guess it is electrically hardwired to the power button at the top.

Not too bad for camera, long press it will launch the camera app, but it don't have 2 levels so press it once and it will start auto-focus and take picture immediately, similar to touch and release shutter button in camera app, which mean you can't "dis-engage" a failed focus attempt.

here is the method:
1. make sure you have root and r/w to system partition
2. the file in question is "TWL4030_Keypad.kl", it's in /system/usr/keylayout/
3. before making any changes, copy the file to SDcard as a backup
4. open the file with any text editor, scroll down to 3rd line from the bottom, it should be "key 95 GESTURE"
5. if you want to use it as camera button, change it to "key 95 CAMERA WAKE_DROPPED"

if you want to use it as power/lock button, change it to "key 95 POWER WAKE_DROPPED"

6. save the changes, reboot to see the changes.

To set the G button to lock/unlock in CM10 do this:
go to /system/usr/keylayout and open Generic.kl

Edit the line that starts with "key 95" and change to this:
key 95 POWER WAKE_DROPPED

Set permissions: rw-r--r-- and reboot :)

you can also use G-button for ending and answering call:D........also as home,back or menu button using -
"CALL WAKE_DROPPED"
"ENDCALL WAKE_DROPPED"
"HOME WAKE"
"MENU WAKE_DROPPED"
"BACK WAKE_DROPPED"

Me using g-button for answering calls and power button for ending calls(from accessibility menu in cm10):D:D
 
Last edited:
  • Like
Reactions: dcop7

dcop7

Senior Member
Jul 5, 2011
3,217
1,923
Leiria
I tried to do the same with the search key, to lock the device, but I didn't have much luck...

Did you manage to do that?
 

atillaahun

Senior Member
Jul 15, 2011
361
101
Hungary
you can also use G-button for ending and answering call:D........also as home,back or menu button using -
"CALL WAKE_DROPPED"
"ENDCALL WAKE_DROPPED"
"HOME WAKE"
"MENU WAKE_DROPPED"
"BACK WAKE_DROPPED"

Me using g-button for answering calls and power button for ending calls(from accessibility menu in cm10):D:D

And if I want both answering and ending a call with G button, how can I add that to the file?
And maybe for wake up and turn off the device too? I guess it's applicable for multiple actions, isn't it?
 

e1forall

Senior Member
May 22, 2012
148
24
Hello

I am on cm10 20121026 nightly and i too cant change the g button structure..

tried changing in the generic.kl and got all my hardware buttons unusable.. had to reflash using smartflash and then restore nandroid backup to get my phone back.. as usb adb is not working with cm10 in my case
 

shivraj3192

Senior Member
Aug 10, 2012
157
29
Bangalore
Redmi Note 10 Pro
Hello

I am on cm10 20121026 nightly and i too cant change the g button structure..

tried changing in the generic.kl and got all my hardware buttons unusable.. had to reflash using smartflash and then restore nandroid backup to get my phone back.. as usb adb is not working with cm10 in my case

I too experienced the same thing. For that I restarted the phone using vol + and power button and the set screen time out to max as screen should not turn off then installed rom manager, from rom manager I went to recovery to flash the nightly and got my phone back...

Sent from my LG-P970
 

Top Liked Posts

  • There are no posts matching your filters.
  • 53
    I found it in a chinese forum (bbs.gfan.com/android-2014369-1-1.html)

    I'm sure most people found the G button useless, so it would be nice to change that. The following is my experience with it:

    The position of the G button make it perfectly useful as lock/unlock button, you can use it to shutdown as well, but cannot use it to switch on the phone, I guess it is electrically hardwired to the power button at the top.

    Not too bad for camera, long press it will launch the camera app, but it don't have 2 levels so press it once and it will start auto-focus and take picture immediately, similar to touch and release shutter button in camera app, which mean you can't "dis-engage" a failed focus attempt.

    here is the method:
    1. make sure you have root and r/w to system partition
    2. the file in question is "TWL4030_Keypad.kl", it's in /system/usr/keylayout/
    3. before making any changes, copy the file to SDcard as a backup
    4. open the file with any text editor, scroll down to 3rd line from the bottom, it should be "key 95 GESTURE"
    5. if you want to use it as camera button, change it to "key 95 CAMERA WAKE_DROPPED"

    if you want to use it as power/lock button, change it to "key 95 POWER WAKE_DROPPED"

    6. save the changes, reboot to see the changes.
    5
    To set the G button to lock/unlock in CM10 do this:
    go to /system/usr/keylayout and open Generic.kl

    Edit the line that starts with "key 95" and change to this:
    key 95 POWER WAKE_DROPPED

    Set permissions: rw-r--r-- and reboot :)
    3
    Very good.
    In fact, I may even use this on nova.
    1
    30b

    Sorry for bad english
    Ruth, a Root Explorer in \ system \ usr \ keylayout copy and save files: lgosp-hid.kl and TWL4030_Keypad.kl.
    in lgosp-hid.kl looking line key 95 GESTURE WAKE change on key 95 CALL WAKE_DROPPED (like it's not, I added this line)
    TWL4030_Keypad.kl looking at line 95 GESTURE key change on key 95 CALL WAKE

    Now the key G has a 'green button'. When you click on it unlocks the screen, and the incoming call can be answered. When the screen is unlocked, then G opens the call log.