Hello, I just managed to wake my milestone with the camera key, without installing any applications but root required. The method is to modify the "keylayout" according to the Android Development Guide Keymaps and Keyboard Input | Android Open Source, by setting the "FOCUS" key with "WAKE" flag.
Before that, we can install some apps like "lockbot" to manages the camera key that can wake the phone. Not sure, but probably it will keep a "wake lock" that prevents your device to go into sleep mode, and so keep draining your battery.
By modifying the "keylayout", the camera key (focus key) can wake your device with the Android OS nativelly, therefore no extra battery drain (just press and raise an interrupt to wake the CPU like your power key !!).
Tutorial on this thread is provided "as is". Use at your own risk.
THIS TUTORIAL IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1.) Root your droid.
2.) Connect your droid with the computer in USB debugging mode.
3.) Pull the corresponding keylayout file from your device. Since I am using Motorola Milestone, as I don't know if the Droid keylayout setting is same as Milestone, so here advised to check and pull the corresponding keylayout file.
4.) Modify the pulled file "c:\keypad.kl".# Using "adb shell".
# Grant the "su" right (you may need to press the button "Always" on Droid, as well as retry few times until the prompt becoming from "$" to "#").
# First, check out which file that your device is using.
# Copy the corresponding file to /sdcard/, as "keypad.kl".
cp /system/usr/keylayout/`cat /proc/device-tree/System@0/Keypad@0/name`.kl /sdcard/keypad.kl
# Exit and "su" and the "adb shell", so that we will go back to Windows command prompt.
# Pull the corresponding keylayout file from /sdcard/keypad.kl
adb pull /sdcard/keypad.kl c:\keypad.kl
5.) Push the modified keylayout file to your sdcard.*** Warning: Modify the file using an text editor which support the Linux line-feed (\n), otherwise may corrupt the keypad file. ***
Find the line "key 211 FOCUS", and append the flag "WAKE" after "FOCUS", so it will becoming:
key 211 FOCUS WAKE
PS. CAMERA KEY won't work, as like VOLUME KEY not working too, probably Motorola exceptionally marked these keys in their keypad driver, in order to let the volume key working when using music player in screen off mode (don't wake the screen when playing music).
6.) Remount the "/system" partition with "rw" mode.adb push c:\keypad.kl /sdcard/keypad.kl
7.) Copy the modified keylayout file to "/system/usr/keylayout".# Go into "adb shell".
# Grant the "su" permission.
# Remount the /system partition with rw mode.
mount -o remount,rw -t yaffs2 /dev/block/mtdblock6 /system
8.) Remount the "/system" partition with "ro" mode.cd /system/usr/keylayout
# Create backup of the existing keylayout file.
mv `cat /proc/device-tree/System@0/Keypad@0/name`.kl `cat /proc/device-tree/System@0/Keypad@0/name`.kl.bak
# Copy the modified keylayout file from /sdcard/keypad.kl
cp /sdcard/keypad.kl `cat /proc/device-tree/System@0/Keypad@0/name`.kl
# Change the permission to 644
chmod 644 `cat /proc/device-tree/System@0/Keypad@0/name`.kl
9.) Exit the "adb shell" by typing "exit" few times until returning to the windows command prompt.cd /
mount -o remount,ro -t yaffs2 /dev/block/mtdblock6 /system
10.) Reboot your droid.
11.) Try to wake your droid with the camera key.