|
|
Thread Tools | Search this Thread |
04-15-2013, 10:58 AM | #1 |
*
Posts: 35
Karma: 145852
Join Date: Apr 2013
Device: Kindle Touch
|
Notification about power button presses for the K5 and hopefully for the KPW
This requires a little bit of help from outside and I figured udev would be a good way to catch the event in the first place.
The following shell code from the WebLaunch start.sh script creates a udev rule that listens to 'yoshibutton' and executes a shell script. Code:
############################################################################### ## Register powerbutton handler FILE_RULES="/etc/udev/rules.d/98-yoshibutton.rules" FILE_NOTIFY="/lib/udev/bin/notifyyoshibutton" #------------------------------------------------------------------------------ # Rules if [ ! -f $FILE_RULES ] then mntroot rw echo "KERNEL==\"yoshibutton\", RUN+=\"$FILE_NOTIFY\"" > $FILE_RULES udevadm control --reload-rules mntroot ro fi #------------------------------------------------------------------------------ # Notifier if [ ! -f $FILE_NOTIFY ] then mntroot rw echo '#!/bin/sh' > $FILE_NOTIFY echo '/usr/bin/lipc-send-event com.lab126.system.event yoshibutton' >> $FILE_NOTIFY chmod +x $FILE_NOTIFY mntroot ro fi So when the app gets started ( 'go' event in a Kindle template ): PHP Code:
PHP Code:
This method is implemented in WebLaunch and works for me on the K5. As I developed this for the PaperWhite where there is no home button it would be nice if somebody with a PW could test it ( for example by testing the implementation in the WebLaunch application ). EDIT: It is now tested and works on the K5 and the KPW Thanks for testing twobob! Last edited by PaulFreund; 04-15-2013 at 02:00 PM. Reason: Now known to work with KPW |
04-15-2013, 11:27 AM | #2 |
but forgot what it's like
Posts: 741
Karma: 2345678
Join Date: Dec 2011
Location: north (by northwest)
Device: Kindle Touch
|
|
Advert | |
|
04-15-2013, 11:55 AM | #3 |
*
Posts: 35
Karma: 145852
Join Date: Apr 2013
Device: Kindle Touch
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Simulating Button Presses Externally | inuxy | Kindle Developer's Corner | 58 | 08-28-2012 01:55 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 |