LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How can I detect touchscreen as Mouse? (https://www.linuxquestions.org/questions/linux-newbie-8/how-can-i-detect-touchscreen-as-mouse-4175670738/)

emmaperea 03-04-2020 01:56 PM

How can I detect touchscreen as Mouse?
 
Hi,
This is my first thread here.
I am working with an embedded-linux device. Linux kernel version is 4.6 and It was built with Yocto 2.4.
I am building a Qt app that runs in the device.
I have a problem when the app is running in a certain time when I press touchscreen the app freezes. I have read a lot of forums and documentation and I am almost sure that the problem is in xlib driver that locks the display.
The linux os has xorg, evded to detect input diveces.
One of my ideas is to detect touchscreen input as mouse input to not get this lock display.
There is a way to configure evdev or x11 to do this?

ferrari 03-04-2020 05:08 PM

Examine the Xorg log for current input driver assignment. For example...
Code:

grep -i "Using input" /var/log/Xorg.0.log
It should be possible to use a catchall Xorg configuration file (eg /etc/X11/xorg.conf.d/90-pointer.conf) like this perhaps...
Code:

Section "InputClass"
        Identifier "evdev pointer catchall"
        MatchIsPointer "on"
        MatchDevicePath "/dev/input/event*"
        Driver                "evdev"
EndSection

That would take effect when Xorg is restarted.

rtmistler 03-04-2020 08:17 PM

It really depends. A touch screen is not a mouse instead it's XY input and when a finger or fingers are down. Trying to treat it as a mouse may not help.

Doesn't this board have a first sample Qt app that works?

ferrari 03-04-2020 08:32 PM

Yes, it may well depend on the hardware implementation, but most touchpad devices for example are still capable of providing basic "PS/2 mouse" compatibility even when not yet properly supported by a kernel. Assuming that touch-screens are similar in that regard?

emmaperea 03-05-2020 09:49 AM

Quote:

Originally Posted by ferrari (Post 6097193)
Examine the Xorg log for current input driver assignment. For example...
Code:

grep -i "Using input" /var/log/Xorg.0.log
It should be possible to use a catchall Xorg configuration file (eg /etc/X11/xorg.conf.d/90-pointer.conf) like this perhaps...
Code:

Section "InputClass"
        Identifier "evdev pointer catchall"
        MatchIsPointer "on"
        MatchDevicePath "/dev/input/event*"
        Driver                "evdev"
EndSection

That would take effect when Xorg is restarted.

Hi Ferrari, thanks for answering.
I checked the Xorg log and got:
[ 10.907] (II) Using input driver 'libinput' for 'da9063-onkey'
[ 10.955] (II) Using input driver 'libinput' for 'AD7879 Touchscreen'
The AD7879 is the touchscreen driver that I am using.

In /usr/share/X11/Xorg.conf.d are tow con files, 10-evdev.conf and 40-libinput.conf.
In 10-evdev.conf I have:
#
# Catch-all evdev loader for udev-based systems
# We don't simply match on any device since that also adds accelerometers
# and other devices that we don't really want to use. The list below
# matches everything but joysticks.

Section "InputClass"
Identifier "evdev pointer catchall"
MatchIsPointer "on"
MatchDevicePath "/dev/input/event*"
Driver "evdev"
EndSection

Section "InputClass"
Identifier "evdev keyboard catchall"
MatchIsKeyboard "on"
MatchDevicePath "/dev/input/event*"
Driver "evdev"
EndSection

Section "InputClass"
Identifier "evdev touchpad catchall"
MatchIsTouchpad "on"
MatchDevicePath "/dev/input/event*"
Driver "evdev"
EndSection

Section "InputClass"
Identifier "evdev tablet catchall"
MatchIsTablet "on"
MatchDevicePath "/dev/input/event*"
Driver "evdev"
EndSection

Section "InputClass"
Identifier "evdev touchscreen catchall"
MatchIsTouchscreen "on"
MatchDevicePath "/dev/input/event*"
Driver "evdev"
EndSection

In 40-libinput.conf I have:

#
# Catch-all evdev loader for udev-based systems
# We don't simply match on any device since that also adds accelerometers
# and other devices that we don't really want to use. The list below
# matches everything but joysticks.

Section "InputClass"
Identifier "evdev pointer catchall"
MatchIsPointer "on"
MatchDevicePath "/dev/input/event*"
Driver "evdev"
EndSection

Section "InputClass"
Identifier "evdev keyboard catchall"
MatchIsKeyboard "on"
MatchDevicePath "/dev/input/event*"
Driver "evdev"
EndSection

Section "InputClass"
Identifier "evdev touchpad catchall"
MatchIsTouchpad "on"
MatchDevicePath "/dev/input/event*"
Driver "evdev"
EndSection

Section "InputClass"
Identifier "evdev tablet catchall"
MatchIsTablet "on"
MatchDevicePath "/dev/input/event*"
Driver "evdev"
EndSection

Section "InputClass"
Identifier "evdev touchscreen catchall"
MatchIsTouchscreen "on"
MatchDevicePath "/dev/input/event*"
Driver "evdev"
EndSection

Do yo think that there is a way to change come configuration here to detect touchscreen as a mouse?

emmaperea 03-05-2020 10:01 AM

Quote:

Originally Posted by ferrari (Post 6097240)
Yes, it may well depend on the hardware implementation, but most touchpad devices for example are still capable of providing basic "PS/2 mouse" compatibility even when not yet properly supported by a kernel. Assuming that touch-screens are similar in that regard?

Ok, yes when I was locking in differents forums the way to do this I read someone that had the problem that His os detected the touchpad as mouse. I think that there is a way to detect touchscreen events as mouse but I don't find the way to do that, I assuming that xorg with xlibinput are who detect touch events and manage them for some way.

emmaperea 03-05-2020 11:20 AM

Quote:

Originally Posted by ferrari (Post 6097193)
Examine the Xorg log for current input driver assignment. For example...
Code:

grep -i "Using input" /var/log/Xorg.0.log
It should be possible to use a catchall Xorg configuration file (eg /etc/X11/xorg.conf.d/90-pointer.conf) like this perhaps...

Section "InputClass"
Identifier "libinput touchscreen catchall"
MatchIsTouchscreen "on"
MatchDevicePath "/dev/input/event*"
Driver "libinput"
EndSection


Code:

Section "InputClass"
        Identifier "evdev pointer catchall"
        MatchIsPointer "on"
        MatchDevicePath "/dev/input/event*"
        Driver                "evdev"
EndSection

That would take effect when Xorg is restarted.

Hi Ferrari, I was replied but I think that It was erased for some reason.
I have two files config in /usr/share/X11/xorg.conf.d folder, one for evdev and another for libinput, in both I have:
Section "InputClass"
Identifier "libinput touchscreen catchall"
MatchIsTouchscreen "off"
MatchDevicePath "/dev/input/event*"
Driver "libinput"
EndSection

I think that I have to use one of both, evdev or libinput, I am not sure of that.
How do I know what I am using? How can I change what of both use?
I think that I am using libinput but I am not sure.

ferrari 03-05-2020 12:17 PM

Quote:

I have two files config in /usr/share/X11/xorg.conf.d folder, one for evdev and another for libinput, in both I have:
Yes, I think the evdev config file comes as part of the Xorg seerver package, while there is an Xorg libinput package that supplies the other. The libinput config will take precedence because of the naming. Custom files can be used to match with specific devices to force the use of a particular supporting driver. I'm not certain about if the evdev driver might help with treating the touchscreen as a more generic pointing device - it was only an idea. The legacy Xorg mouse driver may support it too...
https://linux.die.net/man/4/mousedrv


A good wiki page
https://wiki.archlinux.org/index.php/Touchscreen

Quote:

How do I know what I am using? How can I change what of both use?
By examining the xorg log as I already explained. The grep command will filter for all attached input devices, and report which driver is in use. That is also explained here...
https://wiki.archlinux.org/index.php/Xorg#Input_devices


All times are GMT -5. The time now is 02:39 AM.