Andy Burns wrote:
>> Are there rules for when the power key will make the screen go blank?
> > Every time.
It looks like others have answered the "are there rules" question. To always strive to add value that wasn't already there, everything below is a suggestion for blanking the screen w/o touching buttons. Some phones come native with a button to lock the screen at will. <https://mcmw.abilitynet.org.uk/how-to-enable-the-accessibility-menu-in-android-12> Some launchers (Nova Launcher, Lawnchair) and OEM skins (Samsung One UI, Xiaomi/HyperOS, OnePlus/OxygenOS) apparently support double-tapping a blank space on the home screen or the status bar to put the device to sleep. <https://www.samsung.com/in/sustainability/accessibility/mobile/assistant-menu/> <https://www.samsung.com/au/support/mobile-devices/enable-double-tap-to-turn-off/> <https://gadgetstouse.com/blog/2025/05/07/enable-double-tap-to-sleep-on-any-android-phone/> etc. Gravity Screen or Smart Screen Off use the phone's built-in proximity and accelerometer sensors and 'Hey Google, lock screen' works I'm told (if you set it up ahead of time, I think, as I don't use "Hey Google"). I might approach this problem by turning off the screen with a widget. <https://play.google.com/store/apps/details?id=com.jordigordillo.dtswidget> <https://play.google.com/store/apps/details?id=com.redmanit.lockscreen> <https://play.google.com/store/apps/details?id=dev.qt.hdl.lockscreen> etc. <https://play.google.com/store/search?q=screen%20off%20button&c=apps> They use an accessibility service that simulates a power-button press, since Android doesn't let normal apps turn the screen off directly . However, Tasker, MacroDroid, Automate, or Shortcuts can call Shizuku's shell API to get a home-screen tile that blanks the screen with one tap. . Also, plenty of apps on the phone will blank the screen, using adb. # in ladb on the phone adb shell input keyevent 223 # in Termux, on the phone (pkg install android-tools) adb pair <phone-ip>:<pair-port> adb connect <phone-ip>:<port> adb shell input keyevent 223 .# In Termux, with Shizuku remote interactive shell rish -c "input keyevent 223". Or, if a desktop is handy (the phone can be on Wi-Fi or USB). 1. Blank the screen (sleep, no lock) adb shell input keyevent 223 -> KEYCODE_SLEEP, turns the display off 2. Wake up the screen adb shell input keyevent 224 -> KEYCODE_WAKEUP 3. Sleep & lock (same as pressing power) adb shell input keyevent 26 -> KEYCODE_POWER 4. Let it fall asleep on its own over a given time adb shell settings put system screen_off_timeout 1000 adb shell svc power stayon false -> short timeout, then normal sleep behavior
-- Every post to Usenet should strive to add value that wasn't there.