I've spent a lot of time editing /system/usr/keylayout/Generic.kl in trials to disable waking on sensor touch.
What I've learned is that MENU and SLEEP "buttons", when assigned to key 353 (which is my sensor) don't wake the device up, BUT they work as actual keys, which is unwanted.
So, what key should I assign to the sensor? I've tried avr, dvr, virtual, forward, media_close, meta_left, shift_left, escape, insert, button_l and a lot of other things. All of them wake the device, unfortunately.
P. S. Commenting or removing the line doesn't work either