Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Readers > Kobo Reader > Kobo Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 10-13-2018, 08:02 PM   #1
sherman
Guru
sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.
 
Posts: 850
Karma: 2641698
Join Date: Aug 2008
Location: Taranaki - NZ
Device: Kobo Aura H2O, Kobo Forma
Lazy Sunday idea - launching scripts/apps from Nickel

WARNING: The following post is a Lazy Sunday Idea. Something may or may not come of it.

So, this post sparked off an idea about a possible method of launching scripts or programs from within Nickel, without needing to monitor files.

The idea is as follows:
  1. The hypothetical launcher (HL) is started from the rc5 startup script.
  2. It then periodically searches for the battery icon. Once found, the position and (partial) outline is obtained. This outline (a three segment polyline perhaps?) and it's posistion does not appear to change throughout nickel, at least on my H2O and firmware.
  3. When the battery icon is detected onscreen, the status bar is showing. Draw the HL icon in around the centre of the status bar. Touching said icon will launch the launcher, where it grabs exclusive touch input etc.
  4. Unless the launcher has been invoked, we simply wait for touch events. When a touch event is detected, check for the existance of the battery icon. If found, see above step. If not found, disable/remove HL icon, and wait for next touch.
  5. So long as the battery icon does not change position, finding it should be a trivial, quick and non cpu intensive task. A couple of memory compares may be enough.

So, there's my idea for the day. Please feel free to poke holes in it, or suggest improvements.

If someone wants to run with it, go ahead. Otherwise, I may give it a go myself.
sherman is offline   Reply With Quote
Old 10-13-2018, 11:13 PM   #2
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,477
Karma: 26012492
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
We're still stuck on the "have to check the screen regularly" and/or "polling the screen even when not on the Home screen" issue, though, no?

And then you'd have to make up an UI yourself, too, although that may be the fun part for some .

Last edited by NiLuJe; 10-13-2018 at 11:17 PM.
NiLuJe is offline   Reply With Quote
Advert
Old 10-13-2018, 11:52 PM   #3
sherman
Guru
sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.
 
Posts: 850
Karma: 2641698
Join Date: Aug 2008
Location: Taranaki - NZ
Device: Kobo Aura H2O, Kobo Forma
I'm making a huge assumption that reading input events isn't a mess of expensive polling. If this is the case, there is no need to constantly check the screen, as the idea is to only check when a touch event occurs.

As far as I can tell, the status bar never vanishes of it's own accord when reading a book - only when one touches the screen. Therefore, one does not need to check regularly if the status bar is still available.

In other words, why bother with the homescreen if the status bar is available? One only needs room on the status bar for one icon for this idea to work.

As for creating the UI, that could actually be kind of fun. Can't be any harder than the on-screen keyboard I created (easier in fact), especially when a simple grid would suffice.
sherman is offline   Reply With Quote
Old 10-14-2018, 12:51 AM   #4
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,477
Karma: 26012492
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
Oops, rereading my previous message, yeah, I meant "polling the input device at all times", of course .

Because yeah, making the input poll the main looping mechanism is the "least worst" solution that came to mind the last time this came up .

(i.e., what I was actually meaning to say is: it'd be great if we actually *could* manage to only have to poll the input device while on the Homescreen, since that's the only place we're going to be caring about, but we're kind of stuck in a catch-22 ).

Last edited by NiLuJe; 10-14-2018 at 12:56 AM.
NiLuJe is offline   Reply With Quote
Old 10-14-2018, 01:36 AM   #5
sherman
Guru
sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.
 
Posts: 850
Karma: 2641698
Join Date: Aug 2008
Location: Taranaki - NZ
Device: Kobo Aura H2O, Kobo Forma
Ah, but combined with the idea in the thread that sparked this one (exclusive input grabbing), doing stuff while in a book suddenly becomes a lot more feasible. Just have to remember to save the state of the framebuffer (if needed) before launching any graphics is all.

(I'm going to do a bit of experimentation I think)
sherman is offline   Reply With Quote
Advert
Old 10-14-2018, 03:43 AM   #6
sherman
Guru
sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.
 
Posts: 850
Karma: 2641698
Join Date: Aug 2008
Location: Taranaki - NZ
Device: Kobo Aura H2O, Kobo Forma
A simple blocking read of the touch event file seems to do the trick just fine. No need for any polling, and Nickel is happy to keep processing touch events while doing so.

The test program doesn't even register in 'top', so hopefully this approach wouldn't be a battery hog.

Oh, and I've basically created a simple C touch "driver" that applications can integrate if they so desire (I ported my Go code to C). It needs a bit of tidying up before release however, and I'm not sure if I've accounted for all the different "protocols" correctly.
sherman is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Western Bower, B. M: Jean of the Lazy A. Jean of the Lazy A. v1. 11 Mar 2015 crutledge ePub Books 0 03-11-2015 05:50 PM
[Tutorial] - QT Apps without nickel koenieee Kobo Developer's Corner 3 01-04-2013 08:48 AM
Eink stanalone demo Qt eink driver for standalone qt apps ie no nickel nickel tonyv Kobo Developer's Corner 2 12-27-2012 09:35 AM
Kindle, Audible apps not launching tomsem enTourage eDGe 13 10-03-2012 02:27 PM
Those Lazy Sundays - Horror Novel - Free until Sunday, 5/20/2012 rooster3888 Self-Promotions by Authors and Publishers 7 05-19-2012 10:04 AM


All times are GMT -4. The time now is 04:52 AM.


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