Hello everyone,
I am trying to use a SPI touchscreen on a raspberry pi 3 b with osmc. Just to clarify this a little bit: The LCD itself works with HDMI and is connected to the HDMI port of the pi. This works perfectly fine. The part that doesn’t work is the touch. The Screen has touch and utilises an XPT2046 touchscreen controller that is connected to the pi via SPI on the GPIO pins of the pi. The problem I’m having, is that the default driver for the touch uses and requires X11 and xinput, both are of cause not actually running with osmc. So I can’t use the default drivers.
I found a project on github that can read the information of the xpt2046 with a python script and tried to adapt this script in order to control osmc. This has not really worked out very well. I tried to send keyboard commands lik up, down, left, right to kodi, when Í move my finger in a certain way across the screen. This did not really work though, as it always did all sorts of things and not just one…
So is there maybe some sort of python library that basically emulates a usb mouse.
I realised that I probably should just describe my project here. So basically I’m trying to make a ‘CarPi’ project, where the Raspberry Pi running osmc is placed in a car and basically replaces the radio. The Raspberry Pi is connected to an lcd touchscreen, a gps module, a can-bus module and an amplifier. So using a mouse or keyboard is not an option as I need to be able to use it while driving, at least to some extend. I am also running navit, when needed. For that I have a python script, that just checks if a button in the menu is clicked and than stops the mediacenter process, waits until it has stopped and than just runs ‘startx navit’ which will start a xserver and run navit on it. When navit is closed, the xserver shuts down automatically and when this is detected by the script, it just starts mediacenter again.
PS: I have already tried uinput, which also doesn’t work as it’s trying to read the screen size using x11 commands. And I also know that OSMC isn’t really meant to be used with a mouse, but in my case a remote control wouldn’t make any sense and would not be practical.
Edit:
Just to clarify this:
LCD: working (uses HDMI)
TOUCH: NOT working (uses SPI)
Interfacing with the TOUCH-controller: working (using a python script)
Sending the data from the TOUCH-controller to OSMC or X11: THAT is the problem and what the question is about.
Please read the whole post, to understand the problem.