Swap recent and back keys and kill the lights on both buttons.

Search This thread

Chronzy

Senior Member
Jun 28, 2010
877
482
Austin, TX
Got flashable zips working using the init.d method.

Confirmed working after dirty flashing Lee R86. Any testers interested in confirming?

ButtonSwapLights0% - Swaps back & recents, kills button backlight
ButtonsDefaultLights0% - Default button order, kills button backlight
ButtonsDefaultLights50% - Default button order, backlight brightness 50%
ButtonsDefaultLights100% - back to normal

Probably works on ICE, don't know about Viper, nandroid and see.

For reference, I'm
S-off
decrypted
system-based root
Lee R86
 

dlads

Senior Member
Aug 24, 2010
16,763
6,470
Liverpool
Nothing Phone 2
Got flashable zips working using the init.d method.

Confirmed working after dirty flashing Lee R86. Any testers interested in confirming?

ButtonSwapLights0% - Swaps back & recents, kills button backlight
ButtonsDefaultLights0% - Default button order, kills button backlight
ButtonsDefaultLights50% - Default button order, backlight brightness 50%
ButtonsDefaultLights100% - back to normal

Probably works on ICE, don't know about Viper, nandroid and see.

For reference, I'm
S-off
decrypted
system-based root
Lee R86
Thank you very much for this. [emoji106]
 

dj_chapz

Senior Member
Jun 1, 2011
276
112
Frankfurt am Main
@dladz I would like to mention a really cool thing that would be nice if you could add it to the first post.
First of all, you can enable on-screen keys by simply adding a line to build.prop:
qemu.hw.mainkeys=0
And after that, it doesn't really make sense to have double keys, so using your method you can then easily assign other actions to capacitive keys.

My setup is now having the on-screen keys displayed, back button is now play/pause (MEDIA_PLAY_PAUSE) and recents key as camera (CAMERA).
Note that camera is activated on long press, so tapping the button assigned as a camera key won't do anything.

Since camera and media keys work, so should all of the keys from here, just type the string after KEYCODE_
so for ex. KEYCODE_CALCULATOR should be only CALCULATOR in cypress-cap-sensor.kl

EDIT: It seems that camera freezes when taking pictures after this mod... So for now don't use camera as a shortcut key.

And of course, reboot.

Cheers and happy modding! :)
 
Last edited:

dlads

Senior Member
Aug 24, 2010
16,763
6,470
Liverpool
Nothing Phone 2
@dladz I would like to mention a really cool thing that would be nice if you could add it to the first post.
First of all, you can enable on-screen keys by simply adding a line to build.prop:
qemu.hw.mainkeys=0
And after that, it doesn't really make sense to have double keys, so using your method you can then easily assign other actions to capacitive keys.

My setup is now having the on-screen keys displayed, back button is now play/pause (MEDIA_PLAY_PAUSE) and recents key as camera (CAMERA).
Note that camera is activated on long press, so tapping the button assigned as a camera key won't do anything.

Since camera and media keys work, so should all of the keys from here, just type the string after KEYCODE_
so for ex. KEYCODE_CALCULATOR should be only CALCULATOR in cypress-cap-sensor.kl

EDIT: It seems that camera freezes when taking pictures after this mod... So for now don't use camera as a shortcut key.

And of course, reboot.

Cheers and happy modding! :)
Cheers mate..

I actually only wanted to swap out the keys then I had the dilemma of the lights and it looking odd, I think if you have a nav bar then yea its a good idea to make use of the other keys, personally I don't use the nav bar so it's not double keys.

Might look into different assignments when I get the chance to.

Thanks for the idea [emoji6] [emoji106]
 

Chronzy

Senior Member
Jun 28, 2010
877
482
Austin, TX
My setup is now having the on-screen keys displayed, back button is now play/pause (MEDIA_PLAY_PAUSE) and recents key as camera (CAMERA).)

I like this idea.. I like the xtra screen real estate that using capacitive keys offers, but reassigning them + soft keys sounds like a nice combo... didn't think of that.

Does the play/pause you have assigned to back work with screen off? If so, is it sensitive in pocket?

Cool creative idea though, thanks for posting.
 

dj_chapz

Senior Member
Jun 1, 2011
276
112
Frankfurt am Main
I like this idea.. I like the xtra screen real estate that using capacitive keys offers, but reassigning them + soft keys sounds like a nice combo... didn't think of that.

Does the play/pause you have assigned to back work with screen off? If so, is it sensitive in pocket?

Cool creative idea though, thanks for posting.

The on screen keys are awesome and I'm definitely keeping them.

Regarding the soft keys, the camera turns out not to be broken because of the key that I assigned but because some other mods I was trying out, so technically using them as camera buttons does work.

As for the media keys, the issue is that whichever media key you assign, it will start media playback (next/prev will just skip track and start playing) and the issue is that you might often press it by accident and music will start playing. Although, they do work.

Unfortunately there arent many useful predefined keys provided by the OS and for other functions we have to either wait for custom roms, or maybe make something with IFTTT (for ex. assign NUM_LOCK to the back key and make a rule to start Chrome when num lock is pressed)
 

j to the 4n

Recognized Developer
Oct 18, 2012
16,205
44,288
Germany
The on screen keys are awesome and I'm definitely keeping them.

Regarding the soft keys, the camera turns out not to be broken because of the key that I assigned but because some other mods I was trying out, so technically using them as camera buttons does work.

As for the media keys, the issue is that whichever media key you assign, it will start media playback (next/prev will just skip track and start playing) and the issue is that you might often press it by accident and music will start playing. Although, they do work.

Unfortunately there arent many useful predefined keys provided by the OS and for other functions we have to either wait for custom roms, or maybe make something with IFTTT (for ex. assign NUM_LOCK to the back key and make a rule to start Chrome when num lock is pressed)

What about:

Skip to 1:00

(-;
 
Last edited:

hovercraftdriver

Senior Member
Sep 27, 2010
497
155
Panama City
You can use init.d script to prevent brightness changing on every reboot, i.e

"#! /system/bin/sh

echo 0 > /sys/class/leds/button-backlight/brightness

echo 0 > /sys/class/leds/button-backlight/max_brightness"


Create a file in /system/etc/init.d and paste the above lines (without quotes), and give 755 permission, itll set to 0 before boot Everytime :)

If on stock rom dont have init.d support then use superSu's su.d, place same file to /system/su.d folder

Sent from my Redmi Note 3 using Tapatalk

So this doesn't work with Verizon stock rooted rom, the file exists after flashing the swapbuttons.zip and has the correct values; any ideas?
 

benj!

Senior Member
Jul 4, 2013
292
102
London
Just updated to 1.90.401.3 and flashed MaximusHD, plus the swap buttons and lights 0 zip, and the lights are also not disabled any more here. Buttons still swapped, though.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 27
    Having used Samsung's before and other devices, I've become accustomed to the back button being on the right.

    I was hesitant about changing this as it would mean that you'll have a back symbol on the left and recent's on the right, even though they've switched, which would look a bit crap to be honest.

    Anyway, disabling the backlight's will make it look a lot better whilst you have your buttons swapped :)

    To do this you'll need to be rooted, that's it.


    :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D




    Flashable Zip Method


    Here are some zips for flashing via recovery should you not want to edit these files yourself.


    ButtonSwapLights0% - Swaps back & recents, kills button backlight
    ButtonsDefaultLights0% - Default button order, kills button backlight
    ButtonsDefaultLights50% - Default button order, backlight brightness 50%
    ButtonsDefaultLights100% - back to normal


    :)


    Manual Method



    Download a text editor capable of altering system files, i personally used QuickEdit which is free in the play store.

    Once that's installed

    To disable the back light go here with a text editor.

    /sys/class/leds/button-backlight/max_brightness change the number in here which will be 255 to 0.

    This will switch off the lights immediately.

    If you'd like to swap out the buttons so that back is recent and recent is back,.

    Go to cypress-cap-sensor.kl which is in

    system/user/keylayout/cypress-cap-sensor.kl

    and find then simply reverse the text from the following two lines (there's only two in the file anyway)


    key 158 BACK VIRTUAL
    key 580 APP_SWITCH VIRTUAL

    to

    key 158 APP_SWITCH VIRTUAL
    key 580 BACK VIRTUAL

    Reboot the device and the keys will be switched

    Enjoy ;)

    Thanks to @LeeDroid for putting me onto the location of the recents and back button file. :good:

    Another big thanks to @Chronzy for making these zips, very much appreciated :good:

    Update : These same zips work with Nougat on both cm and sense based roms.. Can be flashed at the same time of a Rom.
    7
    You can use init.d script to prevent brightness changing on every reboot, i.e

    "#! /system/bin/sh

    echo 0 > /sys/class/leds/button-backlight/brightness

    echo 0 > /sys/class/leds/button-backlight/max_brightness"


    Create a file in /system/etc/init.d and paste the above lines (without quotes), and give 755 permission, itll set to 0 before boot Everytime :)

    If on stock rom dont have init.d support then use superSu's su.d, place same file to /system/su.d folder

    Sent from my Redmi Note 3 using Tapatalk
    4
    Got flashable zips working using the init.d method.

    Confirmed working after dirty flashing Lee R86. Any testers interested in confirming?

    ButtonSwapLights0% - Swaps back & recents, kills button backlight
    ButtonsDefaultLights0% - Default button order, kills button backlight
    ButtonsDefaultLights50% - Default button order, backlight brightness 50%
    ButtonsDefaultLights100% - back to normal

    Probably works on ICE, don't know about Viper, nandroid and see.

    For reference, I'm
    S-off
    decrypted
    system-based root
    Lee R86
    4
    @dladz I would like to mention a really cool thing that would be nice if you could add it to the first post.
    First of all, you can enable on-screen keys by simply adding a line to build.prop:
    qemu.hw.mainkeys=0
    And after that, it doesn't really make sense to have double keys, so using your method you can then easily assign other actions to capacitive keys.

    My setup is now having the on-screen keys displayed, back button is now play/pause (MEDIA_PLAY_PAUSE) and recents key as camera (CAMERA).
    Note that camera is activated on long press, so tapping the button assigned as a camera key won't do anything.

    Since camera and media keys work, so should all of the keys from here, just type the string after KEYCODE_
    so for ex. KEYCODE_CALCULATOR should be only CALCULATOR in cypress-cap-sensor.kl

    EDIT: It seems that camera freezes when taking pictures after this mod... So for now don't use camera as a shortcut key.

    And of course, reboot.

    Cheers and happy modding! :)
    3
    Made the init.d file, just seeing if it works.

    Will upload once i'm in work.

    EDIT: Nah didn't work mate.

    Permissions in root explorer are 4 places and not 3.

    so 755 comes out like 0755

    @Adarsh1998 thanks for your tip, exactly what this mod needed.

    Got it to work in system/etc/init.d, had to enable all permissions: read, write, & exec for all 3 user groups: owner root, group root, and global.... 0777.
    It's survived 2 reboots now and the lights are staying off. I might try to scale back the permissions one by one... don't know if there is any danger to leaving all off those permissions enabled.

    Thank you both for the info, this is something I wanted to do since I bought the phone (on other devices as well) because i'm used to the Samsung (also older HTC) setup. The no lights looks so slick and the button swap feels perfect. Thanks again!