Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > Amazon Kindle > Kindle Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 03-01-2016, 12:38 AM   #1
d0ugparker
Born empty--part full...
d0ugparker began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Feb 2016
Location: Henderson, NV, USA
Device: Kindle Paperwhite
Script simulating PW3 keypress, PDF slideshow

This link is a thread on simulating keypresses:

https://www.mobileread.com/forums/sho...d.php?t=118480

and calls out an old line of code that reportedly simulates a keypress:

Code:
echo "send 104" > /proc/keypad
"old," because it corresponds to an older model than the PW3--on the PW3 there doesn't appear to be a /proc/keypad device directory. I think I'm saying that correctly.

The same thread lists a web page URL for device names and keycodes from two .ini files from their related projects:

http://info.iet.unipi.it/~luigi/kindle

First, I have to figure out what to send.

I have run some tests on the PW3 to check for scancode values being generated through

/dev/input/event0

on a multi-page PDF using evtest, but its output wasn't providing any clues to 1) what codes needed to be sent to forward paging through a displayed PDF file, 2) what codes were needed for backward paging, nor 3) to what device or character stream they needed to be directed.

Ultimately, I'd like to get enough of the puzzle pieces to create a UNIX script, programmed to run self-contained on the Kindle, making a displayed PDF document go forward x pages, then backward x pages, then repeating until I hit the home button.

I will have an SSH connection to set things up, get it running, then disconnect and let it run.

Can anyone help provide the pieces I need? Thanks.
d0ugparker is offline   Reply With Quote
Old 03-01-2016, 12:56 AM   #2
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Previous discussion: https://www.mobileread.com/forums/sho...d.php?t=267995

Last edited by eschwartz; 03-01-2016 at 12:59 AM.
eschwartz is offline   Reply With Quote
Advert
Old 03-03-2016, 04:19 PM   #3
d0ugparker
Born empty--part full...
d0ugparker began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Feb 2016
Location: Henderson, NV, USA
Device: Kindle Paperwhite
[Solved] Working PDF slideshow

Quote:
Originally Posted by eschwartz View Post
Thanks for the link. I was able to get most of the pieces in place. The basics are working 100% for an even this Saturday.

I used a hex editor to skinny down the Right and Left command text files making them as short as possible.

One thing I did differently that's worth passing on comes from this posting on the thread noted above:

Quote:
Originally Posted by peterson View Post
Okay, I widened my search and found a solution for the Kobo that works on the PW2 as well:

Record the touch by:
  1. cat /dev/input/event1 > touch.txt
  2. performing the touch on the device (keep it short)
  3. ctrl+c

Play it back by executing echo touch.txt > /dev/input/event1

(Source)
Not me. I played the script back on the PW3 using more instead of echo:

more touch.txt > /dev/input/event1

My loop repeats forward to the end, then backwards back to the beginning, then repeats.

Tips for those who follow:
  1. Turn the screen saver off from the Helper menu first.
  2. Turn on USBNet--I occasionally have to turn it off, then back on to connect.
  3. Connect using your favorite method. I used PuTTY.exe.
  4. Run the triggering script in the background--using an ampersand.
  5. Stress test your implementation.

I'd like to have a more elegant way to activate and deactivate the script from the Helper menu, or in a menu of my own. My script loops permanently until I power it down to shut it off--programmer I'm not... yet. I'm on the Wiki https://wiki.mobileread.com/wiki/KUAL_What%27s_New looking for how to customize KUAL for my purposes.

Another helpful change will be figuring out how to merge the thread that discusses disabling the screen's touch interface--the untouchable kindle:

Quote:
Originally Posted by eschwartz View Post
Thanks to everyone that contributed.
d0ugparker is offline   Reply With Quote
Old 03-03-2016, 04:39 PM   #4
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
You will want to kill the process then, using `pkill -f scriptname.sh`

It shouldn't be hard to make a few KUAL buttons to start and stop the script.
eschwartz is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Simulating input on KV via SSH tommyderami Kindle Developer's Corner 5 02-07-2017 07:46 AM
Troubleshooting Kindle 3 (keyboard) erratic keypress behavior wirawan0 Amazon Kindle 2 04-24-2014 07:23 AM
ePUB + PDF creation script Trouhel ePub 30 07-28-2012 09:02 AM
Delete books with a single keypress? MikeOxlittle Calibre 6 07-08-2011 10:41 AM
JetBook PDF antialiasing script syrex314 Ectaco jetBook 7 05-18-2010 07:23 PM


All times are GMT -4. The time now is 09:36 AM.


MobileRead.com is a privately owned, operated and funded community.