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, 11:51 AM   #1
frostschutz
Linux User
frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.
 
frostschutz's Avatar
 
Posts: 1,866
Karma: 4640113
Join Date: Sep 2010
Location: Heidelberg, Germany
Device: Kobo H2O, iriver StoryHD
user interaction while nickel is running?

While reading a book with nickel, I'd like to do something akin of displaying a Yes/No popup dialog box, and allow the user to interact with it.

The problem is, nickel will process those touch events and flip pages or do other random things.

Is there a way to make nickel ignore touch events temporarily, so you can go seamlessly from reading to an interactive popup and back to reading?

My attempts so far were unsuccessful:

- (un-)binding the touchscreen driver disables touch, but for nickel it does so permanently; have to re-start nickel entirely to make touch work again.

- freezing nickel (kill SIGSTOP) allows user interaction just fine, but when you unfreeze nickel (kill SIGCONT), it will still process all touch events that happened while frozen

Any ideas?
frostschutz is offline   Reply With Quote
Old 10-13-2018, 12:02 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: 7,590
Karma: 7567460
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, (PW) & PW2; Kobo H2O
I don't recall if an EVIOCGRAB ioctl would help ensuring you get exclusive access to the input device without the events getting queued and replayed back to nickel when you're done :/.

(Or if that even works as intended at all here, I vaguely recall having it in in FBInk at one point, and nickel happily getting my fake events anyway, so :/).

Because short of that, I don't have any bright ideas. I'd say putting nickel in a state where stray inputs would be harmless, but that's much easier said than done on a Kobo ;p.
NiLuJe is offline   Reply With Quote
Advert
Old 10-13-2018, 02:04 PM   #3
frostschutz
Linux User
frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.
 
frostschutz's Avatar
 
Posts: 1,866
Karma: 4640113
Join Date: Sep 2010
Location: Heidelberg, Germany
Device: Kobo H2O, iriver StoryHD
Thanks! I didn't think of ioctl at all, but it seems to work just fine, I just tried it on my H2O.

EVIOCGRAB does the trick, nickel no longer sees the touch events.

Of course the downside is, pickel wait-for-hit no longer sees them either, so I have to handle touch events myself.

Or maybe not: pickel is actually happy with a fifo instead of the real touch device. So I can write a small C utility that grabs the touchscreen, bounces all the data into a fifo, where pickel wait-for-hit then picks it up.

----

trivial code snippet I used for test (grabs touch for 60 seconds or until you ctrl-c)

Code:
int main(int argc, char *argv[]) {
    int fd = open("/dev/input/event1", O_RDONLY);
    if(ioctl(fd, EVIOCGRAB, 1) == -1) {
        perror("Failed EVIOCGRAB grab");
        exit(1);
    }
    printf("Grabbed touchscreen...\n");
    sleep(60);
    if(ioctl(fd, EVIOCGRAB, 0) == -1) {
        perror("Failed EVIOCGRAB release");
        exit(1);
    }
    exit(0);
}

Last edited by frostschutz; 10-13-2018 at 02:09 PM.
frostschutz is offline   Reply With Quote
Old 10-13-2018, 06:06 PM   #4
sherman
Evangelist
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: 481
Karma: 960665
Join Date: Aug 2008
Location: Auckland - NZ
Device: Sony PRS-505/SC, B&N Nook, Sony PRS-650/BC, Kobo Glo, Kobo Aura H2O
Oooh. This looks interesting...

An application/script launcher without kfmon/fmon anyone?
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
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
Interaction umarramzan47 Introduce Yourself 2 12-11-2011 05:29 PM
Calibre interaction with Kobo eReader blivett Devices 2 04-03-2011 07:09 PM
Stanza and Calibre interaction fail whitepawn Calibre 1 05-09-2010 01:53 AM
PDA247 is running a user survey Alexander Turcic Lounge 0 07-29-2005 07:10 PM


All times are GMT -4. The time now is 03:11 PM.


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