- Joined
- Mar 18, 2010
- Messages
- 844
- Reaction score
- 1
Ok, so it looks like my little trick was found so I guess it's time to explain myself. :icon_eek:
I came up with a way to use the hardware keys to make services (a.k.a. scripts) run. It was rumored that these options were already built into Froyo and/or used in Cyanogen Mod, neither being true. This is just one of those ideas I wake up with in my head. After playing with it a few minutes it worked flawlessly.
To add these options to your boot.img add the following lines to your preferred init script inside the ramdisk before compiling.
#shutdown options by pete
service poweroff /system/bin/shutdown
disabled
keycodes 107 211
service reboot /system/bin/shutdown -r
disabled
keycodes 107 114
service recovery /system/bin/shutdown -rr
disabled
keycodes 107 115
Obviously you can make these do different things other than shutdown. You can even choose different keys to make them run (hint dont use the half press camera button or people go crazy! lol)
As always please be respectful and atleast put idea by Pete or some sort of credit to make me feel happy if you use it.
I came up with a way to use the hardware keys to make services (a.k.a. scripts) run. It was rumored that these options were already built into Froyo and/or used in Cyanogen Mod, neither being true. This is just one of those ideas I wake up with in my head. After playing with it a few minutes it worked flawlessly.
To add these options to your boot.img add the following lines to your preferred init script inside the ramdisk before compiling.
#shutdown options by pete
service poweroff /system/bin/shutdown
disabled
keycodes 107 211
service reboot /system/bin/shutdown -r
disabled
keycodes 107 114
service recovery /system/bin/shutdown -rr
disabled
keycodes 107 115
Obviously you can make these do different things other than shutdown. You can even choose different keys to make them run (hint dont use the half press camera button or people go crazy! lol)
As always please be respectful and atleast put idea by Pete or some sort of credit to make me feel happy if you use it.