![]() |
#1 |
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 416
Karma: 765432
Join Date: Apr 2016
Location: Italy
Device: Kindle PW3 5.8.5.0.1
|
Detect page changing
Hello there is any lipc event to detect when the user changes the "page" of a book?
Last edited by encol; 05-31-2016 at 02:45 AM. |
![]() |
![]() |
![]() |
#2 |
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 416
Karma: 765432
Join Date: Apr 2016
Location: Italy
Device: Kindle PW3 5.8.5.0.1
|
None?
![]() As alternative, any way to detect current page/position of the book? |
![]() |
![]() |
![]() |
#3 |
Carpe diem, c'est la vie.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,433
Karma: 10773670
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
There may be such an event (lipc or otherwise, such as a /proc or /sys file), but it would probably be different for different kindle models, and perhaps different firmware versions within a given model (not unknown for lab126 to make such changes in the past).
You might be able to find what you seek in the GPL source code for your firmware version, or in the firmware update*.bin file (root filesystem extracted with Kindletool), or in the de-obfuscated (if required) .jar files within that rootfs. |
![]() |
![]() |
![]() |
#4 |
Connoisseur
![]() ![]() Posts: 77
Karma: 150
Join Date: Jul 2014
Device: Kindel PW1, Voyager
|
or you can check /var/log/messages as it is used in the titlebar extension if there is a message for a page turn.
I also used this to trek the password dialogue on the screenserver. But as geekmaster said, that messages can/will change with different firmware versions. HaPe |
![]() |
![]() |
![]() |
#5 | |
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 416
Karma: 765432
Join Date: Apr 2016
Location: Italy
Device: Kindle PW3 5.8.5.0.1
|
Quote:
I tried geekmaster's suggestions with no luck (even if i'm not sure if i looked everywhere ![]() This is what i get when i go to the next page: Code:
160602:101443 cvm[4541]: I ContentPanel:UserActionInfo:PageTurnAction=NextPage: 160602:101443 cvm[4541]: I ReadingTimerController:Information::NextPage,Verdict:Processed,PageStartPos:MobiPosition: 330792,IntervalTime:29047,IntervalWords:80,IntervalWPM:165.24942334836646,ScreenStart:MobiPosition: 330072,ScreenEnd:MobiPosition: 330791,Interval%:0.001501664571158745,TotalTime:29120673,TotalWords:87503,TotalWPM:498.47944109174074,Total%:1.2977535599266443,BookInfoKnownWords:107098,BookInfoKnown%:1.6013863768321634,LogDataReturnCode:80,GlobalWPM:1996.070252681267,GlobalTime:29120673,GlobalWords:227962,CurrentPos:MobiPosition: 330792,EndPos:MobiPosition: 478702,PosLeft:147910,%Left:0.3089168382755293,CurrentPagePosDiff:661,TimeForPage:3.066024350485245,PosPassed:false,NewTimeLeft:2460,OldTimeLeft:6931,NextTOCEntry:null,CurrentPos:MobiPosition: 330792,EndPos:MobiPosition: 478702,PosLeft:147910,%Left:0.3089168382755293,CurrentPagePosDiff:661,TimeForPage:3.066024350485245,PosPassed:false,NewTimeLeft:2460,OldTimeLeft:6931,TimeLeftInBookString:Tempo alla fine del libro: 41 min.,TimeLeftInSectionString:Tempo alla fine del capitolo: 41 min.; ![]() |
|
![]() |
![]() |
![]() |
#6 | |
Carpe diem, c'est la vie.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,433
Karma: 10773670
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
Quote:
I will try to be more explicit in the future, but the reason I mentioned /proc and /sys is that the "next page" 'keypress' or touchscreen event may be found there, and lab126 is fond of putting things you would think belong in userland into their device drivers (such as screensaver management in the eink display driver). Not only can various log messages be prevented from being logged, but their format can change as well so even if logged, detecting them reliably could be tricky if you want your hack to continue to work across multiple devices and firmware versions, and not suffer "bit-rot" over time. I prefer the simplest solution whenever possible, but it must also be robust and reliable. Last edited by geekmaster; 06-02-2016 at 08:24 AM. |
|
![]() |
![]() |
![]() |
#7 |
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 416
Karma: 765432
Join Date: Apr 2016
Location: Italy
Device: Kindle PW3 5.8.5.0.1
|
Don't worry, geekmaster.
I appreciated your suggestions, and perhaps i missed something in my search. There was too many things for me to look into, and i wasn't able to deobfuscate completely jar files. I don't know if there is a simplier/more efficient method, and i'd prefer a lipc event for my code, but Hanspeter's one is the only working method i have found for now |
![]() |
![]() |
![]() |
#8 |
Carpe diem, c'est la vie.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,433
Karma: 10773670
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
Anything that works is a great place to start. As long as it works for your needs, no need to make it portable to other devices. Still worth sharing your results though. Keep us posted.
Last edited by geekmaster; 06-02-2016 at 11:52 AM. |
![]() |
![]() |
![]() |
#9 |
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 416
Karma: 765432
Join Date: Apr 2016
Location: Italy
Device: Kindle PW3 5.8.5.0.1
|
I'm working on a improved version of the "show time" extension, in order to call eips only when necessary.
As soon as i have a working version i'll post it ![]() Meanwhile... What's in your opinion the best way to check the /var/log/messages (better if only the lines added from the last check)? |
![]() |
![]() |
![]() |
#10 |
Carpe diem, c'est la vie.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,433
Karma: 10773670
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
Years ago, I tried "inotify" on a kindle, but it was mostly useless. Files changed without detection. Not sure if there is a reliable way other than to see if the logfile timestamp or size has changed, by periodic polling. Though you could try inotify again (but it may require linux kernel support). Others have discussed this issue as well:
How to notice log file changes with Linux standard tools? In Linux, how do I run a shell script when a file or directory changes https://en.wikipedia.org/wiki/Inotify Like I said, inotify did not work for me (but that was years ago), so tools based on inotify are likely to be unreliable too. YMMV Last edited by geekmaster; 06-02-2016 at 12:00 PM. |
![]() |
![]() |
![]() |
#11 |
BLAM!
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 13,506
Karma: 26047202
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
Using inotify is a bit tricky because of both the USBMS handling and the fuse layer proxy.
You basically have to watch out for unmounts, and re-create your watches when the userstore becomes available again (that takes care of the USBMS issue), and you have to setup your watches on base-us and not us (that takes care of the fuse proxy). See the <K5 screensavers hack for an example. Which also bundles the required inotifywait tools. See also the same basic principle on the other side of the fence for another example of how to deal with USBMS, in C this time. Last edited by NiLuJe; 06-03-2016 at 08:49 AM. |
![]() |
![]() |
![]() |
#12 |
Enthusiast
![]() Posts: 27
Karma: 12
Join Date: Jan 2016
Device: KT2
|
I used dbus-monitor to detect some lipc events (like going in/out of screensaver, hide/show title bar, ...). Perhaps you can find the page turn event there too.
Code:
dbus-monitor --system |
![]() |
![]() |
![]() |
#13 | |
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 416
Karma: 765432
Join Date: Apr 2016
Location: Italy
Device: Kindle PW3 5.8.5.0.1
|
Quote:
![]() However... Nice trick to discover lipc events ![]() Last edited by encol; 06-05-2016 at 04:27 AM. |
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
PRS-T1 PRS-T1 - Changing page margins prevents 'touch' page turning | Berzelius | Sony Reader | 2 | 08-24-2012 04:02 AM |
Changing default starting page | RTO | Recipes | 1 | 12-28-2011 10:21 PM |
Nook And Kindle Page Changing Question | NVash | General Discussions | 17 | 11-05-2010 12:55 PM |
PRS-900 Changing the home page | GatorLMHC | Sony Reader | 0 | 07-26-2010 07:30 PM |
pdf page changing speed ? | bugsbunny14 | Sony Reader | 15 | 10-19-2006 05:28 PM |