UPDATE: This issue was fixed in CyanogenMod 4.2.6.

When I moved to CyanogenMod from Amon_RA’s 1.6.2 Donut, I realized that the volume keys on the phone don’t work when the screen was locked and also my USB Headset remote keys didn’t work at all. Finally today I pushed /system/usr/keylayout/sapphire-keypad.kl from RA-IONv1.6.2H and my volume keys started working while the screen was locked. Then I pushed /system/usr/keylayout/h2w_headset.kl from hofo303 and my USB Headset remote works as well now. Happy Days!! (I have an HTC Magic 32A)

There’s an updated patch file at XDA for this now (Only for 32A Magics, do NOT apply on 32B).

You dont necessarily need to use recovery to update these files. Just download the zip and extract the files to your computer (This should work 32B as well, but I haven’t tested it myself). Then use adb from a command prompt to push the files to the phone:

adb remountadb push h2w_headset.kl /system/usr/keylayout/adb push sapphire-keypad.kl /system/usr/keylayout/