You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
When the screen is off, if the screen turns on from a command in the PC, order it to turn back off #1573
Is your feature request related to a problem? Please describe.
Sometimes I get distracted by my phone when the screen turns back on and I'm working on it.
I have attention problems from flashing lights and moving things which atract me too much and the phone screen turning on and me having to act because of that is part of an issue to me.
Describe the solution you'd like
If these are true:
1.1 Ctrl+o or --screen-off (command line option) is more recent than Ctrl+Shift+o
1.2. A command is sent to the phone, through scrcpy that is known to turn the screen on.
1.3. The screen tries to turn on in the following X (maybe 5) seconds.
1.3.1. 1.1. is still true
---> Turn the screen back off ASAP
Describe alternatives you've considered
I tried to use an automation tool that detects right clicks and Ctrl+p on the desktop app but it works like a terrible hack. Sometimes the command goes too early, other times the second command is mixed together with something else I'm trying to do.
In those cases, I have already ended up giving orders for things I didn't mean to.
Extra:
I intent to implement this myself. It can also allow me to familiarize with these workings of android.
This issue is to confirm if I have green light for such feature in scrcpy
A command is sent to the phone that is known to turn the screen on.
You can't know, the user could press the physical power button for example.
Trying to work around the Android behavior, which is to reset the power mode to NORMAL when pressing the power button, with time-based heuristics looks very hacky/unreliable to me.
You can't know, the user could press the physical power button for example.
That is a problem outside the scope of this issue.
I guess I wasn't clear in the first comment, sorry. I'll try to change it.
Trying to work around the Android behavior, which is to reset the power mode to NORMAL when pressing the power button, with time-based heuristics looks very hacky/unreliable to me.
I think so too. I want to try finding something that doesn't look hacky like that.
Regardless, this is about actions done through this app and has nothing to do with what you do with your phone's physical buttons 👍
I just noticed the first part in this issue is the same as the other one. I think this was the automatic draft saving from the other issue and I was blinded from seeing it properly. I removed that part now.
@rom1v Do you know any way to know whether the screen is on or off?
All ways I got to find can't detect the screen off by changing the screen power mode, which is how scrcpy.
Maybe whatever solution I get may not use that.
Activity
rom1v commentedon Jul 7, 2020
This is related to #1572, right?
You can't know, the user could press the physical power button for example.
Trying to work around the Android behavior, which is to reset the power mode to NORMAL when pressing the power button, with time-based heuristics looks very hacky/unreliable to me.
Ref: #618 (comment)
Ref: #760
brunoais commentedon Jul 7, 2020
That is a problem outside the scope of this issue.
I guess I wasn't clear in the first comment, sorry. I'll try to change it.
I think so too. I want to try finding something that doesn't look hacky like that.
Regardless, this is about actions done through this app and has nothing to do with what you do with your phone's physical buttons 👍
brunoais commentedon Jul 8, 2020
I just noticed the first part in this issue is the same as the other one. I think this was the automatic draft saving from the other issue and I was blinded from seeing it properly. I removed that part now.
brunoais commentedon Jul 8, 2020
@rom1v Do you know any way to know whether the screen is on or off?
All ways I got to find can't detect the screen off by changing the screen power mode, which is how scrcpy.
Maybe whatever solution I get may not use that.
Keep the screen off if it was off when powering on
Keep the screen off on powering on
rom1v commentedon Aug 6, 2020
Merged cf9d449
Keep the screen off if it was off when powering on