7

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

user3506467
  • 377
  • 1
  • 4
  • 12
  • why the close vote? The question seems to relate to the AOSP code itself, and is just as valid as any "I tried this code and xxx happened". – Richard Le Mesurier Apr 08 '14 at 13:31
  • This question doesn't seem unreasonable. As for the question it self, did you try doing a make installclean before the second build? – Andrew T. Apr 08 '14 at 13:55
  • Hi Andrew, Yes i tried make installclean, but because the keylayout files are in the out folder, its generated after make. So my modifications will be deleted. – user3506467 Apr 08 '14 at 14:40
  • Or am i doing something wrong?, if someone knows another solution to disable the hardware buttons i am happy to know =) – user3506467 Apr 08 '14 at 19:34
  • I honestly don't know but I do know you should not be editing files in out, you should edit the files that create out. I am very interested to find your results, I might start by looking at the .kcm and .kl files found in device? – Andrew T. Apr 09 '14 at 15:03
  • I am also doing this but i m unable to save the file can you please tell me what sould i do –  Dec 13 '20 at 21:21

2 Answers2

2

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

Hounge
  • 85
  • 5
0

once you edit the 3 keys and add # to them in the keylayout do the same thing in /system/usr/keylayout/sec_touchkey.kl and VOLLA!! it works like a charm.. working perfectly on my galaxy s3. once that is done.. download GES4 light control and turn off the lights on the keys too.