Author Topic: Wake/suspend your Evo V using the camera button  (Read 3524 times)

iSKUNK!

  • Full Member
  • ***
  • Posts: 14
    • View Profile
Wake/suspend your Evo V using the camera button
« on: October 08, 2012, 10:28:40 PM »
The power button on the Evo 3D/V isn't the greatest. It lacks the solid, positive click-response of some other phones (HTC Incredible, iPhone), and so you can only tell how hard you need to press it by watching the screen for the intended result. This is made worse by the fact that the phone has no iPhone-like home button for waking the device---you're expected to use the power button for this purpose, so you could end up pressing it dozens of times throughout the day.

On first seeing the Evo 3D, I thought the big silver button on the side was there for waking the device. Of course, it didn't take long to learn this was the camera button, complete with half/full-press response. Sweet, I thought, though not a big deal; I'd have been fine with just tapping the screen like most folks do. But once I got to know the power button, how regularly it would be used, and how much nicer the camera button feels, I began to wish that my initial impression had been right.

Thanks to this thread on XDA, I've found a way to make it happen.

In one sentence: Edit the file /system/usr/keylayout/shooter-keypad.kl appropriately, and reboot.

Step-by-step commands

Code: [Select]

$ adb pull /system/usr/keylayout/shooter-keypad.kl

$ myeditor shooter-keypad.kl

$ adb remount

$ adb push shooter-keypad.kl /system/usr/keylayout

$ adb reboot


How to modify the file

I made changes only to the last part of the file. Here is what mine looks like, with the original key bindings commented out:

Code: [Select]

# CAMERA
#key 211   FOCUS
key 211   POWER             WAKE_DROPPED
#key 212   CAMERA
key 212   HOME

This allows a half-press of the camera button to wake/suspend the phone, while not doing much of anything on a full-press. I have not experimented with having a full-press do something useful, since the POWER action and/or the lock-screen is likely to interfere, but if anyone can make something of that I'd be glad to see it posted.

Note that if the phone has been left alone for a while, a longer press of the camera button may be needed. On some occasions, I've had to do a two-second press (or so) to rouse the phone. But it's never failed to work. I've never had to resort to the (real) power button to get things going.

(It goes without saying that this button-remapping hack has no effect in the bootloader or recovery, as well as when the phone is powered off. You'll still need the power button for some things.)

Attached to this post is my complete shooter-keypad.kl file, with the above-quoted modifications, plus a comment header describing the file and noting the XDA thread for reference.

MightyFalcon1

  • Registered User
  • *
  • Posts: 2
    • View Profile
Re: Wake/suspend your Evo V using the camera button
« Reply #1 on: March 22, 2013, 06:50:31 PM »
You sir, are a gentleman and a scholar. Now that I know the method, I'm going to play with a way to remote wake with fn key combos from my BT keypad

iSKUNK!

  • Full Member
  • ***
  • Posts: 14
    • View Profile
Re: Wake/suspend your Evo V using the camera button
« Reply #2 on: March 23, 2013, 11:15:37 PM »
Thanks for the kind words :)

Be aware that only certain keys can be used for waking, because other keys may not work at all when the phone is in sleep mode. For example, you can't use the Evo V's capacitive HOME key to wake the phone, because the digitizer is not active when the phone is asleep. (And keeping it active would drain the battery, which is why hacks like "Slide 2 Wake" are not all that impressive.) I suspect you might see the same issue with Bluetooth.

Also of note is that there are different levels of sleep, so it may work in some circumstances and not in others. I've found that putting the phone into airplane mode makes it go into deep-sleep mode fairly quickly, and that this is the most stringent form of testing a key (combo) for waking.