View Single Post
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: 2,282
Karma: 6123806
Join Date: Sep 2010
Location: Heidelberg, Germany
Device: none
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