Tryph
Posts: 6
Joined: Wed Feb 20, 2013 12:38 pm

[SOLVED] dual display: disable touch feature for mousepointer on HDMI display

Fri Aug 11, 2017 10:05 pm

Hi,

I have a project using dual display with the HDMI as default display and the official touchscreen.

I use Kivy to display an UI ont the touchscreen and it works well. The problem is that the touch feature of the touchscreen controls the mouse pointer on the HDMI display.

I found i can disable completely the touch feature by setting "disable_touchscreen=1" in the "/boot/config.txt" file but this is not exactly what want since I would like to keep the touch feature enabled for the app displayed on the touchscreen.

So I would like to know if there is a way to control the app displayed on the touch screen via the touch feature while controlling the mouse pointer on the HDMI via a mouse (or totally removing the mouse feature on the HDMI display).
Last edited by Tryph on Sat Aug 12, 2017 6:49 pm, edited 1 time in total.

Tryph
Posts: 6
Joined: Wed Feb 20, 2013 12:38 pm

Re: dual display: disable touch feature for mousepointer on HDMI display

Sat Aug 12, 2017 6:47 pm

I just tried something which solves my problem: disabling the touch device for X server.

It can be done quite easily with the xinput command which I had to install before using it.
xinput can be installed with apt-get:

Code: Select all

sudo apt-get install xinput
Then executing xinput command lists the X devices. In my case, simply executing the command fails with a Unable to connect to X server message. The command has to be executed after setting the DISPLAY environment variable:

Code: Select all

pi@RasPyDashboard:~ $ DISPLAY=:0.0 xinput
⎡ Virtual core pointer                    	id=2	[master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer              	id=4	[slave  pointer  (2)]
⎜   ↳ SIGMACHIP USB Keyboard                  	id=7	[slave  pointer  (2)]
⎜   ↳ FT5406 memory based driver              	id=8	[slave  pointer  (2)]
⎣ Virtual core keyboard                   	id=3	[master keyboard (2)]
    ↳ Virtual core XTEST keyboard             	id=5	[slave  keyboard (3)]
    ↳ SIGMACHIP USB Keyboard                  	id=6	[slave  keyboard (3)]
    ↳ SIGMACHIP USB Keyboard                  	id=9	[slave  keyboard (3)]
The pointing device of the official touchscreen is known as FT5406 memory based driver. So I just executed the xinput disable command, providing it the device's name, to prevent it from controlling the X pointer:

Code: Select all

DISPLAY=:0.0 xinput disable "FT5406 memory based driver"
Although the touchscreen does not control the mouse pointer anymore, it still is working for my Kivy app running on official touchscreen.

Misson complete...

Note that the setting is not persistent, thus it has to be set at each RasPI start. Setting the command in any file being run at startup should do the trick but if anyone knows a way to make it persistent, I would be happy to know it.

Return to “Official Foundation Display”

Who is online

Users browsing this forum: No registered users and 3 guests