No sleep when pressing power button

523 views
Skip to first unread message

Stavros Christodoulou

unread,
Nov 10, 2017, 5:49:45 PM11/10/17
to Android-x86

When pressing the power button, the device does not go to sleep. Instead I only get a power menu with Power Off and Restart. How can I enable sleep?

Stavros Christodoulou

unread,
Nov 18, 2017, 7:34:13 AM11/18/17
to Android-x86
Anyone? I have tried adding these lines in build.prop:

powerof.doubleclick=1
sleep
.earlysuspend=1

And now the power button does nothing, not even show the power menu on either single or double click. It only does a hard shutdown if kept pressed.

Kossuth

unread,
Nov 19, 2017, 2:48:45 AM11/19/17
to Android-x86
I'm currently using app from Playstore (Screen off, if I remember correctly) to put my machine to sleep. It works, but has the limitation, that if I move my mouse just after clicking it, it cancels the sleeping and wakes immediately back. If I wait couple of seconds, then I can move mouse without waking the machine. I can also put my machine to sleep from dedicated "sleep" button on my old keyboard that happens to have that.

Stavros Christodoulou

unread,
Nov 19, 2017, 6:36:41 AM11/19/17
to Android-x86
I am also having trouble with the keymap file.
In the online docs, the keycodes for power and volume buttons are 26, 24, 25. Volume buttons do show up when using a key tester, but not the power button, which probably gives code 26.
Now, the Generic.kl file has completely different keycodes, but changing the power & sleep codes, ie. changing all SLEEP codes to POWER and vice-versa makes a difference in power button behavior, even though the map has different assignments for key 26. Key 26 itself is assigned to LEFT_BRACKET.
So yeah, if anyone who knows about this could give some help, it would be very useful, because I am really confused.

Stavros Christodoulou

unread,
Nov 19, 2017, 12:45:35 PM11/19/17
to Android-x86
For now a workaround is to remap the POWER button to SLEEP so a single click of the power button puts the device to sleep, but removes the long-press power menu. Taskbar has an option to show the power menu, so at least I get the ability to suspend the device quickly, and only make shutting down a bit more complicated.

Chih-Wei Huang

unread,
Nov 20, 2017, 1:28:40 AM11/20/17
to Android-x86
2017-11-18 20:34 GMT+08:00 Stavros Christodoulou
<christodou...@gmail.com>:
> Anyone? I have tried adding these lines in build.prop:
>
> powerof.doubleclick=1

Should be poweroff.doubleclick=1

> sleep.earlysuspend=1
>
> And now the power button does nothing, not even show the power menu on
> either single or double click. It only does a hard shutdown if kept pressed.



--
Chih-Wei
Android-x86 project
http://www.android-x86.org

Stavros Christodoulou

unread,
Nov 20, 2017, 3:54:54 PM11/20/17
to Android-x86
Sorry, just a post typo, it is written correctly in grub.cfg.

Chih-Wei Huang

unread,
Nov 20, 2017, 10:00:04 PM11/20/17
to Android-x86
2017-11-21 4:54 GMT+08:00 Stavros Christodoulou
<christodou...@gmail.com>:
> Sorry, just a post typo, it is written correctly in grub.cfg.

In grub.cfg?
No. This is a property which should go into /system/build.prop.
Reply all
Reply to author
Forward
0 new messages