🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.mobile.android
Article #382

Re: Pushing power key may or may not blank screen

#382
From: Maria Sophia
Date: Sat, 24 Oct 2026 14:00
70 lines
4203 bytes
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.
Technical Details
Message-ID: <11bidlo$1dqe$1@nnrp.usenet.blueworldhosting.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!nnrp.usenet.blueworldhosting.com!.POSTED.p847012-ipxg03601okidate.aomori.ocn.ne.jp!not-for-mail
References: <X%NCS.6$Fux5.2@fx12.ams1> <nk1p71F2n6qU1@mid.individual.net>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!nnrp.usenet.blueworldhosting.com!.POSTED.p847012-ipxg03601okidate.aomori.ocn.ne.jp!not-for-mail
From: Maria Sophia <mariasophia@comprehension.com>
Newsgroups: comp.mobile.android
Subject: Re: Pushing power key may or may not blank screen
Date: Sat, 24 Oct 2026 10:00:24 -0400
Organization: BWH Usenet Archive (https://usenet.blueworldhosting.com)
Message-ID: <11bidlo$1dqe$1@nnrp.usenet.blueworldhosting.com>
References: <X%NCS.6$Fux5.2@fx12.ams1> <nk1p71F2n6qU1@mid.individual.net>
Reply-To: pusvul@getTjewytR4so+mqe2.invalid
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 24 Oct 2026 14:00:25 -0000 (UTC)
Injection-Info: nnrp.usenet.blueworldhosting.com; posting-account="l//KxG3Ge2LojWvwJg0Igv8F0ChK8RUC9RtOxMPUo3U"; posting-host="kDFbMLCayXSZqkA/GNCfbb/6QVvqMRZJtdlXDNEuzKE";
	logging-data="46926"; mail-complaints-to="usenet@blueworldhosting.com"
User-Agent: Mojibake 1p3
Cancel-Lock: sha1:FyvGSN8Ms1a6BJmEL5rmSW0TCig= sha256:tVevM/leK3iKjL/I8Bu2OpsS9Q1kZqAr9kH1dbf4yPw=
	sha1:kQK4mR2dZ0ajwtJ/DBwmzj0SEKY= sha256:WjjLQB9zW8AgcxkQazS81BwxIRol/9BypnH+i38wJxw=
Content-Language: en-GB