This object is in archive! 

Hardware controller - Screen on/off only ON

40° shared this problem 3 years ago
Closed

I found that when using "HARDWARE CONTROLLER-Screen on/off", the screen only turns off. You can't turn on the screen with the same button. I disabled the lock screen feature, but it didn't help. I think this problem has been around for a very long time. I used to use another remote control that had a separate power button on the screen. The remote broke, and I bought another device.Using the remote control without the ability to turn on the screen is very problematic. Help. Locus version 3.50.1.

Replies (5)

photo
1

Hello,

I remember we already received a similar bug report a few months ago, but I'm unable to find it now.

Anyway, as I know, some devices have a problem with delivering key events to the application, which is put in the background (sleeping). I'm testing it on own Pixel 2 device and it seems to work correctly, but your device probably stops sending events to the Locus Map app, because it is no longer a main visible application that should otherwise receive these key events.

Same problem when you start any bigger service, like "Track recording"?

I'm really worried, I won't be able to help here. Maybe some experiments with how the app is put into sleep. You may also give a try to Tasker that should be able to do this as well, and maybe better.

Maybe some other user here has any experience with it and provide some insight here?

Jiří M. aka Menion

photo
1

1. Yes, my device most likely does not send events to the Locus Map app when the screen is off. Also, my device doesn't send events to the "KeyEvent Display" app when the screen is off. But other apps get events when the screen is off without any problems. For example:

a. Media player

b. MacroDroid.


2. MacroDroid solved my problem with a simple macro:

trigger "Media button v2 "

action" Turn on screen"


But still, using "tasker" is a temporary workaround and can be difficult for many users.


3. The facts from points 1 and 2 mean that events are received on the device, but not all applications can accept them.


4. I really, really want my favorite Locus to be able to hear such events too. :-)

photo
1

Hi,

sorry for the delay with my answer.

I'm worried I do not have a simple solution here. From what I've found, only media-based key events are delivered to apps for 100% when put in the background (to be able to control media applications).

This is definitely a problem that I would like to solve, so when some solution appears, I'll for sure do it. For now, I see no simple working solution, sorry.

photo
1

I think I have discovered the reason for this behavior of the program. If you are interested, I will write in detail.

photo
1

Hi, if there is something I may improve on my side, I'm of course interested. Thanks.

photo
1

This is an example of pressing the "Pause" button. Code 85.


130|P2a42:/ $ logcat -c

P2a42:/ $ logcat *:D | grep "=85"


If the screen is in the "On" state when the button is pressed, then logcat receives four events:

11-26 15:17:00.357 1269 1648 D WindowManager: interceptKeyTq keycode=85 interactive=true keyguardActive=false policyFlags=22000001

11-26 15:17:00.358 1269 1647 D WindowManager: interceptKeyTi keyCode=85 down=true repeatCount=0 keyguardOn=false mHomePressed=false canceled=false

11-26 15:17:00.495 1269 1648 D WindowManager: interceptKeyTq keycode=85 interactive=true keyguardActive=false policyFlags=22000000

11-26 15:17:00.495 1269 1647 D WindowManager: interceptKeyTi keyCode=85 down=false repeatCount=0 keyguardOn=false mHomePressed=false canceled=false


If the screen is in the "Off" state when the button is pressed, then logcat receives two events:

11-26 15:17:07.266 1269 1648 D WindowManager: interceptKeyTq keycode=85 interactive=false keyguardActive=false policyFlags=2000001

11-26 15:17:07.316 1269 1648 D WindowManager: interceptKeyTq keycode=85 interactive=false keyguardActive=false policyFlags=2000000


I think Locus handles the interceptKeyTi event, which only appears when the screen is on.

If Locus handled the interceptKeyTq event, then everything would work regardless of the screen state.


I use Tasker to track the interceptKeyTq event and it works fine.

photo
1

Hi, this is intersting. I'm trying to find out difference between two types you write about and can't find any. Isn't your solution again based on the fact, your device is rooted? Because only what I've found is info, that only rooted devices are able to capture key events even when application is not in the foreground.

photo
1

here is a profile that responds to a button click:

Profile: ScreenOnOff

Settings: Restore: no

Event: Logcat Entry [ Output Variables:* Component:WindowManager Filter:keycode=85 Grep Filter (Check Help):Off ]


I do not know if ROOT is needed to watch events in logcat.

photo
1

Ah so it is based directly on the logcat texts. Then yes, even a logcat messages are no longer available for apps without a root. Sorry.

Jiří M. aka Menion

photo
1

very sorry.

I did everything I could. :-(

Replies have been locked on this page!