Remapping the Physical Buttons

Search This thread

idiotzach15

Senior Member
Apr 7, 2012
450
83
Laurel, MD
OnePlus 8T
Google Pixel 6
well, recently I've been trying to remap the softkeys on the note II, and I'm just not making progress. My goal is to create a small mod that turns the softkey lights off, and remaps the menu key for the back key, and the back key to recents, as well as somehow changing the home button longpress to a google now shortcut.

After doing some research, I figured changing the Generic.kl (/system/usr/keylayout/) lines 139 and 158 would make progress. However, all I've accomplished so far is disabling the softkeys.

Any help or information on this subject would be greatly appreciated.

Thanks in advance.


- and yes, I tried the ButtonRemapper apk
 
  • Like
Reactions: nutpn

Cruiserdude

Senior Member
Jul 13, 2010
500
338
I made this file months ago, and it's worked on every TW rom I've had, since I HATE the backwards button layout Samsung chose. Download this file, go to your /system/usr/keylayout folder, rename your existing sec_touchkey.kl to sec_touchkey.kl.bak, then move the file I gave you into that folder. Set permissions and reboot, and you'll have the setup you want.

Obviously, just turn the backlights off in the Display settings. Do note that you won't have a menu button after you do this, I just use Button Savior to put a little shortcut off to the side. But if you come up with a more elegant solution, please feel free to let me know.

That file should do what you want, all I ask is that you credit me if you share it with anyone, put it in a rom, or whatever.

http://db.tt/RzSutNxL

Sent from my SCH-I535 using Tapatalk 2
 

idiotzach15

Senior Member
Apr 7, 2012
450
83
Laurel, MD
OnePlus 8T
Google Pixel 6
I made this file months ago, and it's worked on every TW rom I've had, since I HATE the backwards button layout Samsung chose. Download this file, go to your /system/usr/keylayout folder, rename your existing sec_touchkey.kl to sec_touchkey.kl.bak, then move the file I gave you into that folder. Set permissions and reboot, and you'll have the setup you want.

Obviously, just turn the backlights off in the Display settings. Do note that you won't have a menu button after you do this, I just use Button Savior to put a little shortcut off to the side. But if you come up with a more elegant solution, please feel free to let me know.

That file should do what you want, all I ask is that you credit me if you share it with anyone, put it in a rom, or whatever.

http://db.tt/RzSutNxL

Sent from my SCH-I535 using Tapatalk 2

Thanks a bunch!
 

elesbb

Senior Member
Jun 20, 2010
7,883
5,324
I'll be creating a flash zip for this "fix" soon. Does anyone know where I'd change the longpress on the homebutton action?

/system/framework/android.policy.jar/PhoneWindowManager.java

At leasts thats what i can remember lol. Thats what i had to edit on my Tablet to make long press on home function as long press search.
 

Cruiserdude

Senior Member
Jul 13, 2010
500
338
Yeah, I'd love to find a way to enable a long press of the right hand capacitive button (back button stock, but it's the task switcher with that file I posted) to act as a menu button. That would be awesome.

Alternatively, I'd love to figure out how to change the TW soft keys to AOSP theme and layout. I love using soft keys, but I can't stand the backwards layout Samsung has chosen, and can't bring myself to using it if I can help it.

Sent from my SCH-I535 using Tapatalk 2
 

elesbb

Senior Member
Jun 20, 2010
7,883
5,324
Yeah, I'd love to find a way to enable a long press of the right hand capacitive button (back button stock, but it's the task switcher with that file I posted) to act as a menu button. That would be awesome.

Alternatively, I'd love to figure out how to change the TW soft keys to AOSP theme and layout. I love using soft keys, but I can't stand the backwards layout Samsung has chosen, and can't bring myself to using it if I can help it.

Sent from my SCH-I535 using Tapatalk 2

You can add your own methods to the android.policy.jar file to handle different on hold actions.

Sent from my SGH-T999

"So I put my phone into airplane mode and threw it... worst transformer ever. -.-" -My friend
 

tonyf7

Senior Member
Jul 21, 2012
80
18
/system/framework/android.policy.jar/PhoneWindowManager.java

At leasts thats what i can remember lol. Thats what i had to edit on my Tablet to make long press on home function as long press search.

Every file editor I try is unable to open/edit the android.policy.jar file. How do I edit it?
 

shaxs

Senior Member
Aug 16, 2010
655
66
You can add your own methods to the android.policy.jar file to handle different on hold actions.

Sent from my SGH-T999

"So I put my phone into airplane mode and threw it... worst transformer ever. -.-" -My friend

Is it possible to add a method that when back is pressed twice it launches an app? Or can I modify long press to launch an app like voice commands?
 

iba21

Senior Member
Jul 1, 2010
2,829
1,586
Venice
hi guyz.. one question.. i'd want to remap the buttons with this logoc

1 press menù -> multitasking tab
long press menù -> menù
long press home buttons -> gvoice

any idea how to use it?

i'm on swift rom v3 + perseus kernel and, i don't have the sec_touchkey file! o.o

how to?

i'd want to use the stock tw launcher, not another one..

thanks

---------- Post added at 03:58 PM ---------- Previous post was at 03:21 PM ----------

Ok i edited the file and puted it in right folder.. now i have the multitasking in normal menù press, but NOT the menù in the hold.. what could i do?
 

Shekar.m1986

Senior Member
May 23, 2012
84
11
Bangalore
hi, is there any way to wake-up screen without home key, power key and volume key? actualy my home button is now not as hard as it was before, i am afraid it may damage some day, so does power key, i know about few apps which wakes up using sensor, but it's not for me, it drains battery too much, i want something like waking up phone with capative touch keys, or swiping them, is it possible to change key 172 which is home button to a menu key for waking up? in system/usr/keylayout/ ?
 

iba21

Senior Member
Jul 1, 2010
2,829
1,586
Venice
hi, is there any way to wake-up screen without home key, power key and volume key? actualy my home button is now not as hard as it was before, i am afraid it may damage some day, so does power key, i know about few apps which wakes up using sensor, but it's not for me, it drains battery too much, i want something like waking up phone with capative touch keys, or swiping them, is it possible to change key 172 which is home button to a menu key for waking up? in system/usr/keylayout/ ?

the situation is simple.. ALL IS POSSIBLE..
i you know java code as advance user, i can send you files witch you should recompile

but.. the situation is simple.. if you always turn on the soft buttons, you'll lose a lot of energy, since ALL screen is alimented..

Soft touch buttons uses the same touch as screen, so, you always have to aliment it

ok.. 2 issues:
1) if leg touch the soft button, screen will be turned on
2) showp-1984 creates the swipe2wake, for htc phones, you need a lot of c++ knowledge to recompile it

But.. in my opinion, buttons are "immortal" than soft touch..
I have an old keyboard.. it had about 12 years.. and works good.. and.. i used it for 6 years til change, so, dont be scary, i don't think you are breaking your buttons!!

---------- Post added at 02:03 PM ---------- Previous post was at 01:57 PM ----------

Btw.. i find the code witch is the governor of the buttons.. it's in android.policy.jar file.. and.. i tryed to force the hold home button to hold menù button, and sure, it worked, with one issue: menù always had the search function

So.. the situation is simple... i don't know how to code with java, and sure, i need a good java programmer to do what i whould do.. at last.. only one "stupid thing".. change the hold home button app switch to menù.. so.. i could have:

Menù button as app switch with 1 press (easy to do)
standard press of home as move home function and hold it for the android MENU
And back as always

I only need one coder witch can modify me the @8 VALUE

Any good person?? :D
 
  • Like
Reactions: Shekar.m1986

Shekar.m1986

Senior Member
May 23, 2012
84
11
Bangalore
the situation is simple.. ALL IS POSSIBLE..
i you know java code as advance user, i can send you files witch you should recompile

but.. the situation is simple.. if you always turn on the soft buttons, you'll lose a lot of energy, since ALL screen is alimented..

Soft touch buttons uses the same touch as screen, so, you always have to aliment it

ok.. 2 issues:
1) if leg touch the soft button, screen will be turned on
2) showp-1984 creates the swipe2wake, for htc phones, you need a lot of c++ knowledge to recompile it

But.. in my opinion, buttons are "immortal" than soft touch..
I have an old keyboard.. it had about 12 years.. and works good.. and.. i used it for 6 years til change, so, dont be scary, i don't think you are breaking your buttons!!

---------- Post added at 02:03 PM ---------- Previous post was at 01:57 PM ----------

Btw.. i find the code witch is the governor of the buttons.. it's in android.policy.jar file.. and.. i tryed to force the hold home button to hold menù button, and sure, it worked, with one issue: menù always had the search function

So.. the situation is simple... i don't know how to code with java, and sure, i need a good java programmer to do what i whould do.. at last.. only one "stupid thing".. change the hold home button app switch to menù.. so.. i could have:

Menù button as app switch with 1 press (easy to do)
standard press of home as move home function and hold it for the android MENU
And back as always

I only need one coder witch can modify me the @8 VALUE

Any good person?? :D
I see, actually you're right, i forgot that we have to decompile android.policy.jar to be able to change wake up keys, i remember it when i saw someone changed wake-up key to volume buttons through android.policy.jar, it's quite strange that with samsung decvices which uses physical home button to screen wake, doesn't have any mod to alternative method, one you already mentioned sweep2wake, a pleasent feature to relief power button of htc devices, what about the relief for Samsung's physical home key? i am not so fussed about other use of physical key, i only want to change screen wake key to capacitive menu key or something like sweep2wake..i can see after sometime, lots of users complain about home key, so a handy mod should be there.

by the way can you send me an edited file with menu (capacitive button) wake up enabled?
 
Last edited:

iba21

Senior Member
Jul 1, 2010
2,829
1,586
Venice
I see, actually you're right, i forgot that we have to decompile android.policy.jar to be able to change wake up keys, i remember it when i saw someone changed wake-up key to volume buttons through android.policy.jar, it's quite strange that with samsung decvices which uses physical home button to screen wake, doesn't have any mod to alternative method, one you already mentioned sweep2wake, a pleasent feature to relief power button of htc devices, what about the relief for Samsung's physical home key? i am not so fussed about other use of physical key, i only want to change screen wake key to capacitive menu key or something like sweep2wake..i can see after sometime, lots of users complain about home key, so a handy mod should be there.

by the way can you send me an edited file with menu (capacitive button) wake up enabled?

I'd want but, i'm not a java programmer, i don't know how to do to remap a button, do you think i know how to force the electromagneticity on?? ;)

I think is not easy whaylt ypu would do.. and sure.. you have to modify more than 1 jar file.. because.. i ONLY have to REMAP a button, so, stock, only have to do ANOTHER THING... you want to change a power features.. i think you have to modify the kernel (sweep 2 wake is a feature of the kernel, not of the rom.. kernel is writed in c++.. android is writed in java, uses the java machine)

---------- Post added at 09:05 PM ---------- Previous post was at 08:22 PM ----------

Oh right.. one thing.. emh.. in my opinion.. button is a button, and samusung did some test about the resistence of the button

Sure.. time destroys all.. so.. you could have a softly botton after 12 months.. but.. i don't think you'll damage it soon..

Warranty is here.. you can send phone to the costructor if you have a problem

P.s. i have old phones, as like a siemens s10.. and.. ALL buttons are ok..
That phone was used by:
Dad > mom > me > brother > second brother

It has about, 8years of usage.. no prob..

Dont know why you are so worried!
 
  • Like
Reactions: Shekar.m1986

Shekar.m1986

Senior Member
May 23, 2012
84
11
Bangalore
I'd want but, i'm not a java programmer, i don't know how to do to remap a button, do you think i know how to force the electromagneticity on?? ;)

I think is not easy whaylt ypu would do.. and sure.. you have to modify more than 1 jar file.. because.. i ONLY have to REMAP a button, so, stock, only have to do ANOTHER THING... you want to change a power features.. i think you have to modify the kernel (sweep 2 wake is a feature of the kernel, not of the rom.. kernel is writed in c++.. android is writed in java, uses the java machine)

---------- Post added at 09:05 PM ---------- Previous post was at 08:22 PM ----------

Oh right.. one thing.. emh.. in my opinion.. button is a button, and samusung did some test about the resistence of the button

Sure.. time destroys all.. so.. you could have a softly botton after 12 months.. but.. i don't think you'll damage it soon..

Warranty is here.. you can send phone to the costructor if you have a problem

P.s. i have old phones, as like a siemens s10.. and.. ALL buttons are ok..
That phone was used by:
Dad > mom > me > brother > second brother

It has about, 8years of usage.. no prob..

Dont know why you are so worried!
This is an expensive phone, so we would definitely worry about it :) i know it does rarely broken, but it does more or less, i don't know why samsung intend to choose physical home instead of capacitive, i had HTC Sensation, and i was glad to use sweep2wake on it to save power button, samsung's power button gives loose feeling right out of the box like it'll break anytime, so samsung needs sweep2wake or something like that much more than HTC devices, hopefully some devs will look at it, THIS WAKE-UP KEY NEED TO BE HACKED AND REPLACED, simple is that, although soft keys gives it little bit relief, but we have to wake-up device atleast 30-50 times in working days, so that's why i am really looking forward to it, can we both join hands to bring developers attention toward it? if you also want to wake-up screen with anything other than physical keys :) i'm sure you must be missing sweep2wake in note 2 :D
 

iba21

Senior Member
Jul 1, 2010
2,829
1,586
Venice
I didn't use s2w.. why? It uses too mouch energy in standby :D

showp is one of my great friends in xda, and i love his kernel + his MPDECISION code

Btw, for me, you are crazy :p
Never ever had problems with phone buttons.. i had an n95, i sent about 1 bilion of sms.. here in italy vodafone created a promo witch gives about 100free sms per day.. i used everytime all the sms.. and.. sure.. i had to press the send button 2 timed every sms + all the other

I used that phone for 3 years.. changed it with an hd2... bought the first day (n95) and hd2 used.. 365 days x 3 = 1095.. 1095 x 100 = 19500 x 2 = 219,000 + all the other used to navigate in menù

Btw.. n95 was broken in display cable.. all buttons perfect!!
 

Top Liked Posts

  • There are no posts matching your filters.
  • 3
    I made this file months ago, and it's worked on every TW rom I've had, since I HATE the backwards button layout Samsung chose. Download this file, go to your /system/usr/keylayout folder, rename your existing sec_touchkey.kl to sec_touchkey.kl.bak, then move the file I gave you into that folder. Set permissions and reboot, and you'll have the setup you want.

    Obviously, just turn the backlights off in the Display settings. Do note that you won't have a menu button after you do this, I just use Button Savior to put a little shortcut off to the side. But if you come up with a more elegant solution, please feel free to let me know.

    That file should do what you want, all I ask is that you credit me if you share it with anyone, put it in a rom, or whatever.

    http://db.tt/RzSutNxL

    Sent from my SCH-I535 using Tapatalk 2
    1
    well, recently I've been trying to remap the softkeys on the note II, and I'm just not making progress. My goal is to create a small mod that turns the softkey lights off, and remaps the menu key for the back key, and the back key to recents, as well as somehow changing the home button longpress to a google now shortcut.

    After doing some research, I figured changing the Generic.kl (/system/usr/keylayout/) lines 139 and 158 would make progress. However, all I've accomplished so far is disabling the softkeys.

    Any help or information on this subject would be greatly appreciated.

    Thanks in advance.


    - and yes, I tried the ButtonRemapper apk
    1
    hi, is there any way to wake-up screen without home key, power key and volume key? actualy my home button is now not as hard as it was before, i am afraid it may damage some day, so does power key, i know about few apps which wakes up using sensor, but it's not for me, it drains battery too much, i want something like waking up phone with capative touch keys, or swiping them, is it possible to change key 172 which is home button to a menu key for waking up? in system/usr/keylayout/ ?

    the situation is simple.. ALL IS POSSIBLE..
    i you know java code as advance user, i can send you files witch you should recompile

    but.. the situation is simple.. if you always turn on the soft buttons, you'll lose a lot of energy, since ALL screen is alimented..

    Soft touch buttons uses the same touch as screen, so, you always have to aliment it

    ok.. 2 issues:
    1) if leg touch the soft button, screen will be turned on
    2) showp-1984 creates the swipe2wake, for htc phones, you need a lot of c++ knowledge to recompile it

    But.. in my opinion, buttons are "immortal" than soft touch..
    I have an old keyboard.. it had about 12 years.. and works good.. and.. i used it for 6 years til change, so, dont be scary, i don't think you are breaking your buttons!!

    ---------- Post added at 02:03 PM ---------- Previous post was at 01:57 PM ----------

    Btw.. i find the code witch is the governor of the buttons.. it's in android.policy.jar file.. and.. i tryed to force the hold home button to hold menù button, and sure, it worked, with one issue: menù always had the search function

    So.. the situation is simple... i don't know how to code with java, and sure, i need a good java programmer to do what i whould do.. at last.. only one "stupid thing".. change the hold home button app switch to menù.. so.. i could have:

    Menù button as app switch with 1 press (easy to do)
    standard press of home as move home function and hold it for the android MENU
    And back as always

    I only need one coder witch can modify me the @8 VALUE

    Any good person?? :D
    1
    I see, actually you're right, i forgot that we have to decompile android.policy.jar to be able to change wake up keys, i remember it when i saw someone changed wake-up key to volume buttons through android.policy.jar, it's quite strange that with samsung decvices which uses physical home button to screen wake, doesn't have any mod to alternative method, one you already mentioned sweep2wake, a pleasent feature to relief power button of htc devices, what about the relief for Samsung's physical home key? i am not so fussed about other use of physical key, i only want to change screen wake key to capacitive menu key or something like sweep2wake..i can see after sometime, lots of users complain about home key, so a handy mod should be there.

    by the way can you send me an edited file with menu (capacitive button) wake up enabled?

    I'd want but, i'm not a java programmer, i don't know how to do to remap a button, do you think i know how to force the electromagneticity on?? ;)

    I think is not easy whaylt ypu would do.. and sure.. you have to modify more than 1 jar file.. because.. i ONLY have to REMAP a button, so, stock, only have to do ANOTHER THING... you want to change a power features.. i think you have to modify the kernel (sweep 2 wake is a feature of the kernel, not of the rom.. kernel is writed in c++.. android is writed in java, uses the java machine)

    ---------- Post added at 09:05 PM ---------- Previous post was at 08:22 PM ----------

    Oh right.. one thing.. emh.. in my opinion.. button is a button, and samusung did some test about the resistence of the button

    Sure.. time destroys all.. so.. you could have a softly botton after 12 months.. but.. i don't think you'll damage it soon..

    Warranty is here.. you can send phone to the costructor if you have a problem

    P.s. i have old phones, as like a siemens s10.. and.. ALL buttons are ok..
    That phone was used by:
    Dad > mom > me > brother > second brother

    It has about, 8years of usage.. no prob..

    Dont know why you are so worried!