[FIX] Prevent home button from waking device, add support for HTC headset button
Hi all!
By altering the key layout files I have managed to
a) prevent the device form waking up by pressing the home button. I was very annoyed by the fact that I almost always turned on the device when pulling it out of my pocket.
b) Enable support for HTC headset buttons
Because I have moved form HTC to the SGSII I had a leftover HTC headset with one button and a 3,5mm extension jack (see attached picture).

Over the stock SGSII headset the option to use custom earpieces is a great benefit in my opinion. The sound and microphone part of the HTC headset worked out of the box, but the SGSII did not react to button press from the headset.
Prevent wake on home button, alter system/usr/keylayout/sec_key.kl
(Remove wake from key 102)
Code:
key 115 VOLUME_UP WAKE
key 114 VOLUME_DOWN WAKE
key 102 HOME
key 107 ENDCALL
key 105 DPAD_LEFT
key 106 DPAD_RIGHT
key 103 DPAD_UP
key 108 DPAD_DOWN
key 232 DPAD_CENTER
key 116 POWER WAKE
key 212 CAMERA WAKE
Support for HTC headset, alter system/usr/keylayout/sec_jack.kl
(Add key 76)
Code:
key 163 MEDIA_NEXT WAKE
key 165 MEDIA_PREVIOUS WAKE
key 226 HEADSETHOOK WAKE
key 76 HEADSETHOOK WAKE
Regards,
PK
------------- Devices ---------------
HTC One
Sony Xperia Z Returned
Samsung Galaxy SII | Samsung Galaxy Tab 10.1 | HTC Desire HD | HTC Desire
HTC HD2 | HTC Diamond2 | HTC Diamond Pro | HTC P3300 | Qtek S100
|