custom actions like this for your hardware buttons should work with the existing buttons without the need for the hack. holding power on with some custom roms can be configured to have the flashlight on while it's held.
would be nice if an api for these buttons existed in the android sdk. anyone know if it's there?