3

Since I have a broken back button I have remapped my buttons in such a way that my original volume up button functions as a menu button, and my original menu button as the back button. I've done this by changing the key values in /system/usr/keylayout/generic.kl.

The problem is, I've flashed a new ROM so I had to do it again, but now it doesn't work anymore. The changed values are persistent but my phone ignores it, it seems.

And yes, of course I've rebooted after making the changes again.

Anyone have an idea?

2 Answers 2

0

Without knowing which phone you have, which rom, or what version, it's hard to tell you exactly why, but the simplest explanation is that you are editing the wrong key layout file. Cyanogenmod roms tend to support various key layouts specific for certain devices, and those take precedence over the Generic.kl file, for obvious reasons. Key layout files are mapped to individual device types. There may be other .kl files that are specific for your buttons, like sec_key.kl, sec_jack.kl (for Samsung hard buttons and headset buttons), cyttsp-i2c.kl (for Cypress TrueTouch e-ink display controllers used in the B&N Nook), gpio-keys.kl, etc etc.

So you need to see which ones are there, which one is for your specific device (hopefully it's commented), and edit that one.

-1

I would guess that the keymappings are only read at the first boot after flashing the ROM and will be stored in a database on the /data partition. This database won't be updated when the values in generic.kl are changed. You can test this thought by doing a data wipe. This will trigger reading your changed values from generic.kl (AFTER DELETING ALL YOUR USERDATA!). Another way would be finding this database and editing it by hand or just removing it and rebooting for a re-read of generic.kl.

2
  • Thank you, that seems like the solution if i can find that database. Do you have any idea or guess where to find it?
    – Bart
    Commented Sep 30, 2014 at 20:10
  • That's absolutely not how android handles the key layout and key char map files.
    – cde
    Commented Dec 27, 2015 at 11:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .