[Galaxy S II Q&A, Help & Troubleshooting] czesiu:
I have a creative 630i headset which button press gets detected as either a 226 or 240 scancode by the phone. I have added code 240 to keylayout so that the button always works but one problem remains. Holding the button when code 240 is detected "removes the device", that is, headset button does not work anymore and I have to disconnect and reconnect it.

Do any of you have an idea on how to disable dropping the device when '240' press and hold is detected?

Is it possible to force the phone to 'believe' that only code 226 is possible from the headset (convert all 240 to 226)?

from getevent:

add device 10: /dev/input/event3
name: "sec_jack"
/dev/input/event3: 0000 0000 00000000
/dev/input/event3: 0000 0000 00000000
/dev/input/event3: 0001 00e2 00000001
/dev/input/event3: 0000 0000 00000000
/dev/input/event3: 0000 0000 00000000
/dev/input/event3: 0001 00e2 00000000
/dev/input/event3: 0000 0000 00000000
/dev/input/event3: 0000 0000 00000000
/dev/input/event3: 0001 00e2 00000001
/dev/input/event3: 0000 0000 00000000
/dev/input/event3: 0000 0000 00000000
/dev/input/event3: 0001 00e2 00000000
/dev/input/event3: 0000 0000 00000000
/dev/input/event3: 0000 0000 00000000
/dev/input/event3: 0001 00e2 00000001
/dev/input/event3: 0000 0000 00000000
/dev/input/event3: 0000 0000 00000000
/dev/input/event3: 0001 00e2 00000000
/dev/input/event3: 0000 0000 00000000
/dev/input/event3: 0001 00f0 00000001
/dev/input/event3: 0000 0000 00000000
/dev/input/event3: 0001 00f0 00000000
/dev/input/event3: 0000 0000 00000000
/dev/input/event3: 0001 00f0 00000001
/dev/input/event3: 0000 0000 00000000
/dev/input/event3: 0001 00f0 00000000
/dev/input/event3: 0000 0000 00000000
/dev/input/event3: 0001 00f0 00000001
/dev/input/event3: 0000 0000 00000000
/dev/input/event3: 0001 00f0 00000000
/dev/input/event3: 0000 0000 00000000
/dev/input/event3: 0001 00f0 00000001
/dev/input/event3: 0000 0000 00000000
/dev/input/event3: 0001 00f0 00000000
/dev/input/event3: 0000 0000 00000000
/dev/input/event3: 0001 00f0 00000001
/dev/input/event3: 0000 0000 00000000
/dev/input/event3: 0001 00f0 00000000
/dev/input/event3: 0000 0000 00000000
/dev/input/event3: 0001 00f0 00000001
/dev/input/event3: 0000 0000 00000000
/dev/input/event3: 0001 00f0 00000000
/dev/input/event3: 0000 0000 00000000
/dev/input/event3: 0001 00f0 00000001
/dev/input/event3: 0000 0000 00000000
/dev/input/event3: 0001 00f0 00000000
/dev/input/event3: 0000 0000 00000000
/dev/input/event3: 0001 00f0 00000001
/dev/input/event3: 0000 0000 00000000
/dev/input/event3: 0001 00f0 00000000
/dev/input/event3: 0000 0000 00000000
/dev/input/event3: 0001 00f0 00000001
/dev/input/event3: 0000 0000 00000000
/dev/input/event3: 0001 00f0 00000000
/dev/input/event3: 0000 0000 00000000
/dev/input/event3: 0001 00f0 00000001
/dev/input/event3: 0000 0000 00000000
/dev/input/event3: 0001 00f0 00000000
/dev/input/event3: 0000 0000 00000000
/dev/input/event3: 0001 00f0 00000001
/dev/input/event3: 0000 0000 00000000
/dev/input/event3: 0001 00f0 00000000
/dev/input/event3: 0000 0000 00000000
/dev/input/event3: 0001 00f0 00000001
/dev/input/event3: 0000 0000 00000000
/dev/input/event3: 0001 00f0 00000000
/dev/input/event3: 0000 0000 00000000
/dev/input/event3: 0001 00f0 00000001
/dev/input/event3: 0000 0000 00000000
/dev/input/event3: 0001 00f0 00000000
/dev/input/event3: 0000 0000 00000000
/dev/input/event3: 0001 00f0 00000001
/dev/input/event3: 0000 0000 00000000
/dev/input/event3: 0001 00f0 00000000
/dev/input/event3: 0000 0000 00000000
/dev/input/event3: 0001 00f0 00000001
/dev/input/event3: 0000 0000 00000000
/dev/input/event3: 0001 00f0 00000000
/dev/input/event3: 0000 0000 00000001
remove device 10: /dev/input/event3