10-17-2013, 10:16 AM | #1 |
ebook fan
Posts: 735
Karma: 2528718
Join Date: Dec 2010
Device: PocketBook 301+, Kindle 3 Wi-Fi, Onyx Boox A62, Kindle Touch
|
Power button handling
Hi!
How to handle the "POWER" button on KT/KPW? I tried /dev/input/eventN but no success. |
10-17-2013, 10:19 AM | #2 |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
|
Advert | |
|
10-17-2013, 11:06 AM | #3 |
ebook fan
Posts: 735
Karma: 2528718
Join Date: Dec 2010
Device: PocketBook 301+, Kindle 3 Wi-Fi, Onyx Boox A62, Kindle Touch
|
|
10-17-2013, 11:31 AM | #4 |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
OH,
Did you mean "how to handle power button EVENTS" ? There are threads on that subject here. And an event handler or two. Any more of an answer would require some details on what you mean by "handle". http://www.gerv.net/hacking/how-to-ask-good-questions/ |
10-17-2013, 12:08 PM | #5 | |
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Týr
Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
|
[!]131017:160326 KERNEL: I pmic: PWRON1 event: is what showlog chucks out.
I personally use the builtin /usr/bin/powerd_test tried strings on it... Quote:
that fell out.. (amongst other rubbish) |
|
Advert | |
|
10-17-2013, 12:08 PM | #6 | |
ebook fan
Posts: 735
Karma: 2528718
Join Date: Dec 2010
Device: PocketBook 301+, Kindle 3 Wi-Fi, Onyx Boox A62, Kindle Touch
|
Quote:
|
|
10-17-2013, 12:35 PM | #7 |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
And what sort of "Handling" do you have in mind.
If you would just read and follow the directions in the link I gave you, this could go much faster. And how do you plan to monitor for a 'power on' event when the cpu is halted? |
10-17-2013, 03:17 PM | #8 | |
ebook fan
Posts: 735
Karma: 2528718
Join Date: Dec 2010
Device: PocketBook 301+, Kindle 3 Wi-Fi, Onyx Boox A62, Kindle Touch
|
Quote:
There is no need to monitor power event when cpu is halted because this event resumes cpu. twobob, thanks. I think it's not a good idea to launch process every time I want to find out power status... Do you know how to monitor the PWRON1 event? Last edited by sergeyvl12; 10-17-2013 at 03:22 PM. |
|
10-17-2013, 03:24 PM | #9 |
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Týr
Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
|
ah right. it's available to look at in one of the err.. sys? proc? locations
knc1 has posted a thread about that before, would have to find it. when I have fixed my mangled debian and eaten my dinner I'll have a look for it |
10-17-2013, 03:55 PM | #10 | |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Quote:
No need to monitor the power status - if its off, there isn't anything user accessible still running. Conversely, if any thing at all runs, then the power is on. check the /sys sub-tree for what you can monitor and what you can change Last edited by knc1; 10-17-2013 at 03:59 PM. |
|
10-17-2013, 04:13 PM | #11 | |
ebook fan
Posts: 735
Karma: 2528718
Join Date: Dec 2010
Device: PocketBook 301+, Kindle 3 Wi-Fi, Onyx Boox A62, Kindle Touch
|
Quote:
Now I implemented sleep by timeout in kindle and it works well. Power button resumes device and I close the screen saver. I just want to make suspend by pressing the power button and by sleep cower. Last edited by sergeyvl12; 10-17-2013 at 04:20 PM. |
|
10-17-2013, 07:04 PM | #12 |
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Týr
Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
|
|
10-18-2013, 11:55 AM | #13 |
ebook fan
Posts: 735
Karma: 2528718
Join Date: Dec 2010
Device: PocketBook 301+, Kindle 3 Wi-Fi, Onyx Boox A62, Kindle Touch
|
Thanks, twobob, knc1!
|
11-13-2013, 09:41 AM | #14 |
ebook fan
Posts: 735
Karma: 2528718
Join Date: Dec 2010
Device: PocketBook 301+, Kindle 3 Wi-Fi, Onyx Boox A62, Kindle Touch
|
Code:
lipc-wait-event -m com.lab126.powerd goingToScreenSaver,outOfScreenSaver Code:
# prevent screensaver activation lipc-set-prop com.lab126.powerd preventScreenSaver 1 ... # restore screensaver lipc-set-prop com.lab126.powerd preventScreenSaver 0 So, I can get power button release event using netlink socket: code sample Spoiler:
Message for power button is: "virtual/misc/yoshibutton" Probably it will be useful for sombody else. It works at least for KT and KPW-1. KPW-2 seems to use another approach (through event-N). Now I need to get the sleepcover event also. But the main problem that I have no sleep cover on my KT. Please, I need to know, does sleep cover use the same approach? Last edited by sergeyvl12; 11-13-2013 at 09:43 AM. |
11-13-2013, 09:45 AM | #15 |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Get a small "refrigerator" type magnet - place on lower right corner of benzel -
Pretend that is the cover magnet - "on" == closed, "off" == open It is just a Hall Effect device on the underside of that corner. |
Thread Tools | Search this Thread |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
PRS-505 Power button not shutting off | Atagahi | Sony Reader | 2 | 11-16-2012 05:48 PM |
PRS-T1 How can I use back button as power button? | younghere | Sony Reader | 1 | 03-12-2012 06:37 PM |
Trouble With K4 Power Button? | lindnet | Amazon Kindle | 5 | 01-03-2012 06:45 AM |
Trouble with the Power Button | Davimee | Astak EZReader | 16 | 05-04-2010 07:29 PM |
power button stuck | Utahcowboy | Bookeen | 10 | 03-13-2008 01:42 PM |