View Single Post
Old 12-26-2023, 05:34 PM   #2
Mavireck
Connoisseur
Mavireck might easily be mistaken for a TexanMavireck might easily be mistaken for a TexanMavireck might easily be mistaken for a TexanMavireck might easily be mistaken for a TexanMavireck might easily be mistaken for a TexanMavireck might easily be mistaken for a TexanMavireck might easily be mistaken for a TexanMavireck might easily be mistaken for a TexanMavireck might easily be mistaken for a TexanMavireck might easily be mistaken for a TexanMavireck might easily be mistaken for a Texan
 
Posts: 63
Karma: 18290
Join Date: Jul 2016
Location: France
Device: Kobo H2O (broken), Kobo H2O Edition 2 v1 (stolen), Kobo Clara 2E
Yes it is possible and quite easy actually. You need to make an IOCTL call to grab the touch input. Then Nickel (the default software) won't register any input, although it will keep running. Which brings the question: do you really want to keep Nickel in the background? If you do not need it, I highly recommend killing everything to avoid conflicts. For instance, Nickel may keep updating the clock above your app, or go to sleep.

To do that, you should run the following bash commands:
Code:
# Stop kobo software when it's running
killall nickel hindenburg sickel fickel fmon > /dev/null 2>&1
If you do want to keep everything running (as I did in my Bing Maps proof of concept), you can use the following:

Short version since you use KIP:
Code:
t = KIP.inputObject(touchPath, 1080, 1440, grabInput=True)
Should work (note the grabInput argument... It was made for that purpose )

Long version for those who do not use my module (KIP):

Spoiler:

Code:
from fcntl import ioctl
import grabInput as grabber

devFile = open("/dev/input/event1", "rb")

ioctl(devFile, grabber.EVIOCGRAB(1), True) # To grab the input
ioctl(devFile, grabber.EVIOCGRAB(1), False) # To release it
How I integrated it in KIP's updated version which is shipped with PSSM.

The grabInput module is not a default Python module, but you can find it here:
The module I used
The module I (largely) based my work on (GNU license)

That code was used within PSSM. It was a tool I made to create Python apps on the Kobo, it helped a lot with creating interfaces. But I completely stopped developping this tool because Python was not really appropriate on such a low-performance device. However, you can run the example files. They do work! And I do think it makes life much easier...

Last edited by Mavireck; 12-26-2023 at 05:56 PM.
Mavireck is offline   Reply With Quote