Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable hardware keys android rom

I want to disable the Home, Menu and Back button in my custom AOSP rom. I´ve seached on the internet, and saw i can disable buttons after a succesfull build in the key layout files found in out/target/product/generic/system/usr/keylayout. The file i´m editing is: Generic.kl Now i´ve commented out these buttons:

  • # key 139 MENU WAKE_DROPPED
  • # key 158 BACK WAKE_DROPPED
  • # key 172 HOME

Then i restarted the emulator, and the buttons still work... Is there something i am missing?

Thanks, Stefan

like image 323
user3506467 Avatar asked Apr 08 '14 09:04

user3506467


People also ask

How do I turn off the hardware keys light?

You have to remove ">" from the chmod command line and change 755 to 644. BTW: for CM based ROMs, there is a tweak, too (using the file "brightness" etc.), but it's more easy to just use the app "Keyboard Backlight Controller" from the market.

How do I disable the lock button on my Android?

Navigate to Android > Restrictions > Basic and click on Configure. Under Allow Device Functionality, you'll have the options to disable Home/Power button. Home Button-Uncheck this option to restrict users from using the Home Button. Power Off-Uncheck this option to restrict users from turning their devices off.


1 Answers

here is a good place to look for editing the file PRIOR to compiling

http://www.kandroid.org/online-pdk/guide/keymaps_keyboard_input.html

In the source you will find the default keymap under /device/vendor/product/ and it will be the file(s) ending in .kl

If you have a rooted device you can always edit the /system/usr/keylayout/qwerty.kl file on the actual device with a root file explorer.

I was looking for the answer myself and hopefully shared the correct information

Edited Also I'm pretty sure unless you do some modding to the emulator before you run it the changes made do not persist after reboot

Edited If you are looking to edit files on the device in the ROM before compiling try looking at the device.mk file for instance:

device/lge/hammerhead/gpio-keys.kl:system/usr/keylayout/gpio-keys.kl

this line from the make file for the nexus 5 indicates that system/usr/keylayout/gpio-keys.kl is derived from device/lge/hammerhead/gpio-keys.kl in the source code

like image 186
Hounge Avatar answered Oct 05 '22 23:10

Hounge