[Q] Remapping hw buttons via kernel - Android Q&A, Help & Troubleshooting

I have an android device running gingerbread (2.3.6) my power button (which also serves the purpose of unlocking the device) is broke so basically what am trying to do is to wake the device up using volume buttons instead of power. The things I've tried so far:
*a few apps from store like - button saviour /proximity unlock etc some of them do work but they drain battery like hell moreover are useless in waking from homescreen
*a Google search showed me many a guides on button remapping so i tried modifying /usr/keylayout files but there seems to be no effect whatsoever
What am looking for :
*i think remapping via kernel is ma last hope so I've synced sources and setup the environment but don't know how to proceed. Any links/leads or help in this regard is highly appreciated

I am also searching of this. My device has a camera button and i would like to change the power button with the camera button.
Anyone knowing where to look in kernel?

Related

[Q] Hook into power button

If I write an app, is it possible to to override the default functionality of the hardware power button?
I only found this on google, but it didn't work:
stackoverflow.com/questions/3703071/how-to-hook-into-the-power-button-in-android
Thank you!
I would be interested in an app to do this, as well as bringing up the power menu as holding the power button usually does.
The power button on my Desire has issues letting go... the phone seems to think that the button is always pressed, effectively making me unable to "press" the button when I want. Pretty certain it is mechanical failure, since if I take the battery out and then put back in, the phone turns on without my doing anything else. So, I cannot shutdown via the power menu... tried apps which use SU to power off/reboot, but they are causing problems with Data2Ext and A2SD+ filesystems. I also cannot do anything from hboot or fastboot... must enter recovery through a root app.. which is not always helpful.
Been looking for several months
Baschdard said:
If I write an app, is it possible to to override the default functionality of the hardware power button?
I only found this on google, but it didn't work:
stackoverflow.com/questions/3703071/how-to-hook-into-the-power-button-in-android
Thank you!
Click to expand...
Click to collapse
I would really like for this too.
I am trying to do an in-dash install of a 7inch tablet and it is unable to sense when the power is removed. I have also tried running Tasker but it says 'Application not installed'.
So I would like to send a pulse to the power button and trigger a shutdown app. Otherwise I will just be cutting power which is sure to corrupt things
It's Needed!!!
Please see my other post in this thread:
http://forum.xda-developers.com/showthread.php?t=1052451
Thanks!!

[Q] Legend&Cyanogen questions - wake up/redial

Hi,
I've got CM7 on my legend and I would like to know if the following features are possible and how:
- I want to be able to wake the device (turn on the screen) using only the trackpad button and not the power button. (the power button is quite proeminend and it gets pressed randomly in the pocket causing battery to drain)
- redial the last number by pressing twice the answer button from the headset (very useful when travellling on bike), as it is by default in the original sense ROM (actually in all sense ROM's that I have tried)
Thanks !
1) can be found in the cyanogenmod settings => input (i think thats the name in english) => trackball wake
2) not sure if its possible
Thanks for the reply but I knew about that option.
What I want is to wake the device ONLY with trackball. Basically to disable power button for unlock.

[Q] MOD: Can hardware buttons be swapped?

I haven's seen this mod on sgs2, but it would be great to swap som buttons around, especially now on the sgs3...
Unfortunately Samsung have chosen a pretty bad setup now that we're running ics on our phones. The menu button is included in most updated apps these days, so to have a dedicated hardware button for this is very counter productive. And having to hold home, wait seconds to multitask is just plain stupid.
Alas, that's the way it is.
BUT could it not be possible to mod a Rom so that the menu button brings up multitask (currently: "hold home") and holding home brings up menu?
Basically it's just a swapping of the button functions. I guess it can cause some issues with the doubble tap to "siri" voice actions, but I'd happily loose that for better multitask.
Can anybody share some advice on this? Or even create the mod?
-E
Theoretically, yes it's possible.
On my Desire only the power button could wake the phone, but I flashed a mod which enabled wake using the center button.
So for the S3, if there's a dev who wants to swap the keys, he can make one. You can try putting in a request in the Developers section a week or so from when the phone releases.
g4rvd4 said:
Theoretically, yes it's possible.
On my Desire only the power button could wake the phone, but I flashed a mod which enabled wake using the center button.
So for the S3, if there's a dev who wants to swap the keys, he can make one. You can try putting in a request in the Developers section a week or so from when the phone releases.
Click to expand...
Click to collapse
I remember when that mod came, it made using the desire a lot more efficient. It was a script edit, similar to the one for headphone button support if I remember correctly. I do think this button swapping on the sg3 will be a bit more challenging than that though, but we'll see.
I'll ask around a bit once I get the phone.
Hopefully more people than me will think this is something worth "fixing"

How to get Volume buttons to wake phone in Lolipop (CM12.1)?

Edit: this is no longer an issue in CM13.0 snapshot. I went ahead and upgraded and can confirm volume rocker wake (and double tap to wake) work.
Hi All I'm on CM12.1 (MT2L03 cm-12.1-20151117-SNAPSHOT-YOG7DAO1K2-mt2) and can't seem to figure this out. I had the volume buttons waking the phone from screen off in 4.3 working great...I used that for quite a while (since I used the option to end calls with power button need volume buttons to wake screen also saves wear to power button) so the hardware supports it but not sure how to get it working on lolipop (CM12.1).
In Jellybean, I just had to add 'WAKE' after the volume keys like:
key 115 VOLUME_UP WAKE (in /system/user/keylayout to the kl files)
I tried this for CM 12.1 and it doesn't seem to work. Since it worked before I suppose it could work again if a setting is changed or something.
Also I tried adding:
ro.config.hwfeature_wakeupkey=1
to my build.prop and rebooting and that didn't work either. (Setting it to 0 disables volume key waking)
The xposed module XUtilities option: Volume rocker wake also did not work.
The xposed module GravityBox doesn't have the option or I didn't see it there.
There's this reference:
http://cyanogenmod.github.io/cm_pla...ers/CMSettings.System.html#VOLUME_WAKE_SCREEN
which refers to VOLUME_WAKE_SCREEN setting (in CM API)
In the Buttons section of CM's settings, I have the End call (Pressing the power button will end the current call) option ON. One would think this would allow the volume buttons to wake the screen if the screen goes off during a phone call so you can wake it back up without ending the call. Also with this option on, on more than one occasion I went to turn my phone on just as an incoming call came in and used the power button which ended the call...so I've gotten in the habit of using the volume up/down buttons to turn on the screen getting around that issue (also saving wear and tear on my power button).
There's an app in the play store that can do what I want called DTSO (fails after time) VPL by prasi but it stays running and uses more battery power. The hardware solution that was working in 4.3 didn't require a background app to allow this feature and also didn't require extra battery power. So this isn't ideal. I'd rather have Cyanogenmod ROM directly support it or have a way to use it with it.
I want to be able to press the volume buttons and the screen come on like it used to. How?
Thank you for any suggestions :fingers-crossed::good:

[HELP] Remap Powerbutton - UMI Zero

Hello,
recently the power button stopped working properly on my UMI zero phone.
1.) I am looking for a solution to remap the power button function to a different key. (for example volume down or up key) - The phone should be able to be powered up by the remapped key when powered off by low battery etc.
If not possible to remap the key completely
2.) A autostart function would solve this problem too. for example when a charger is connected to the phone. I just want to avoid any lockout situation where my battery drains and I am not able to power the phone up anymore.
Any ideas?
Thanks
Any Ideas? Power Button stopped working completely now.

Categories

Resources