Jump to content

Media Keys not working in Sleep


Recommended Posts

If there's a way to force a phone to take input from "MEDIA_" keys while in sleep mode, it would be much appreciated, as no device I use seems to take them without setting it specifically.

I tried the Poweramp wakelock tweak, but it doesn't do the trick.

Because I'm walking 10-12 miles outside, if I want to change the song while it's raining, I can't take out my phone.

Instead I have Bluez IME rigged to a wiimote, binding _PLAY_PAUSE to A, _STOP to B, _FAST_FORWARD and _REWIND to left and right (actually up and down since the wiimote is held on its side).

_VOLUME_UP and _VOLUME_DOWN are bound to Up and down (left and right technically). Plus and Minus are _PLAY and _PAUSE (incase I want to force one specifically and not alternate between Play and Pause with A).

Home is HEADSETHOOK, which actually works when the screen is on, since 90% of Android apps kill their audio when headphones are unplugged. Hitting it again makes the apps think it's plugged back in.

1 and 2 are _PREVIOUS and _NEXT, respectively.

This all works flawlessly when the screen is turned on, but when the device is in sleep no apps take any key inputs.

I have BlueZ setting the screen to Wakelock, screen on but dim.

I also specifically tried Tincore because it allows you to take input while the device is in sleep mode, but Poweramp doesn't read it.

So I have to have my phone in the right side front hand pocket of my jacket, holding it in my hand, the screen facing away from my palm and not hitting the jacket, combined with Poweramp set to it's own Wake screen, which goes to the default android wake screen for double layer protection. Meanwhile my Wiimote is in my left side front pocket.

Thanks to the tactile feedback of actual buttons, this system actually works flawlessly without having to take my phone out in the rain to do anything.

Buuuut Android is stupid about taking keypresses in sleep mode.

I tried this with physical devices the android natively supports and not just the IME emulation apps, it doesn't work.

Link to comment
Share on other sites

Poweramp should accept regular device keypresses while the screen is asleep. I use cabled headset buttons all the time (with the three buttons set as MEDIA_NEXT, MEDIA_PLAY_PAUSE and MEDIA_PREVIOUS), and also Bluetooth commands from my car stereo, all while the phone screen stays off (Galaxy Note 3, KitKat).

As you say you've already checked that the settings in the PA Headset/Bluetooth menu are enabled, and you've got Wakelock and Keep Service ticked, I'm not sure what to suggest.

Andre

Link to comment
Share on other sites

Headset buttons (including bluetooth headset buttons) and hardware buttons (power, vol up, vol down) are actually an entire other function outside of a normal IME (input method).

 

You can't actually replicate them with an IME unless your IME specifically is programmed to do that (which is unlikely), and the triggering of them is actually separate from a regular IME.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...