LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-04-2020, 01:56 PM   #1
emmaperea
LQ Newbie
 
Registered: Mar 2020
Posts: 4

Rep: Reputation: Disabled
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?
 
Old 03-04-2020, 05:08 PM   #2
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,837

Rep: Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148
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.
 
Old 03-04-2020, 08:17 PM   #3
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,883
Blog Entries: 13

Rep: Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931
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?
 
Old 03-04-2020, 08:32 PM   #4
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,837

Rep: Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148
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?
 
Old 03-05-2020, 09:49 AM   #5
emmaperea
LQ Newbie
 
Registered: Mar 2020
Posts: 4

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by ferrari View Post
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?
 
Old 03-05-2020, 10:01 AM   #6
emmaperea
LQ Newbie
 
Registered: Mar 2020
Posts: 4

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by ferrari View Post
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.
 
Old 03-05-2020, 11:20 AM   #7
emmaperea
LQ Newbie
 
Registered: Mar 2020
Posts: 4

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by ferrari View Post
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.

Last edited by emmaperea; 03-05-2020 at 11:21 AM.
 
Old 03-05-2020, 12:17 PM   #8
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,837

Rep: Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148
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

Last edited by ferrari; 03-05-2020 at 12:19 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
3.0 touchscreen works. 5.0 upgrade touchscreen does not work Stonetablet Bodhi 4 12-08-2019 09:39 AM
Dual head setup with one touchscreen stretching over non-touchscreen display gutaker Linux - Hardware 0 03-13-2012 04:06 PM
looking for touchscreen drivers for mandriva 2008, touchscreen working with windows inder_18nec Linux - Software 3 02-20-2010 05:11 PM
Touchscreen Drivers - Toughbook CF-19 w/Red Hat 5.3 (Fujitsu USB Touchscreen) bsheridan Linux - Laptop and Netbook 0 11-17-2009 10:54 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:46 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration