欢迎来到尧图网

客户服务 关于我们

您的位置:首页 > 科技 > IT业 > [x86 ubuntu22.04]双触摸屏的触摸事件都响应在同一个触摸屏上

[x86 ubuntu22.04]双触摸屏的触摸事件都响应在同一个触摸屏上

2025/5/7 16:12:45 来源:https://blog.csdn.net/weixin_49406449/article/details/144696113  浏览:    关键词:[x86 ubuntu22.04]双触摸屏的触摸事件都响应在同一个触摸屏上

1 问题描述

        CPU:G6900E

        OS:ubuntu22.04

        Kernel:6.8.0-49-generic

        系统下有两个一样的 edp 触摸屏,两个触摸屏的触摸事件都响应在同一个 edp 屏幕上。

2 解决过程

        使用“xinput”命令查看输入设备,可以看到只有一个 touch,而且还有一个警告。表示正在使用 Xwayland 服务器,而不是直接在 X11 环境中使用 xinput。xinput 是一个用于配置和管理 X11 输入设备的工具,而 Xwayland 是一个让 X11 应用程序在 Wayland 环境下运行的兼容层。

jw@jw-Windows-cpmpact-G6900E:~$ xinput 
WARNING: running xinput against an Xwayland server. See the xinput man page for details.
⎡ Virtual core pointer                          id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
⎜   ↳ xwayland-pointer:17                       id=6    [slave  pointer  (2)]
⎜   ↳ xwayland-relative-pointer:17              id=7    [slave  pointer  (2)]
⎜   ↳ xwayland-pointer-gestures:17              id=8    [slave  pointer  (2)]
⎜   ↳ xwayland-touch:17                         id=10   [slave  pointer  (2)]
⎣ Virtual core keyboard                         id=3    [master keyboard (2)]↳ Virtual core XTEST keyboard               id=5    [slave  keyboard (3)]↳ xwayland-keyboard:17                      id=9    [slave  keyboard (3)]
jw@jw-Windows-cpmpact-G6900E:~$ 

        将 wayland 关闭,修改“/etc/gdm3/custom.conf”配置文件,配置文件如下所示,将“#WaylandEnable=false”改为“WaylandEnable=false”,重启系统,即可关闭 wayland 。

# GDM configuration storage
#
# See /usr/share/gdm/gdm.schemas for a list of available options.[daemon]
AutomaticLoginEnable=true
AutomaticLogin=jw# Uncomment the line below to force the login screen to use Xorg
#WaylandEnable=false# Enabling automatic login# Enabling timed login
#  TimedLoginEnable = true
#  TimedLogin = user1
#  TimedLoginDelay = 10[security][xdmcp][chooser][debug]
# Uncomment the line below to turn on debugging
# More verbose logs
# Additionally lets the X server dump core if it crashes
#Enable=true

        再使用“xinput”命令查看输入设备,可以看到有四个“Elo Touch”,分别对应不同 id,分别是 14、15、16、和 17。

jw@jw-Windows-cpmpact-G6900E:~$ xinput 
⎡ Virtual core pointer                          id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
⎜   ↳ USB OPTICAL MOUSE                         id=10   [slave  pointer  (2)]
⎜   ↳ SIGMACHIP USB Keyboard Consumer Control   id=12   [slave  pointer  (2)]
⎜   ↳ Elo Touch                     ET1504LS pCAP USB HID       id=14   [slave  pointer  (2)]
⎜   ↳ Elo Touch                     ET1504LS pCAP USB HID    Mouse      id=15   [slave  pointer  (2)]
⎜   ↳ Elo Touch                     ET1504L pCAP USB HID        id=16   [slave  pointer  (2)]
⎜   ↳ Elo Touch                     ET1504L pCAP USB HID     Mouse      id=17   [slave  pointer  (2)]
⎣ Virtual core keyboard                         id=3    [master keyboard (2)]↳ Virtual core XTEST keyboard               id=5    [slave  keyboard (3)]↳ Power Button                              id=6    [slave  keyboard (3)]↳ Video Bus                                 id=7    [slave  keyboard (3)]↳ Power Button                              id=8    [slave  keyboard (3)]↳ Sleep Button                              id=9    [slave  keyboard (3)]↳ SIGMACHIP USB Keyboard                    id=11   [slave  keyboard (3)]↳ SIGMACHIP USB Keyboard System Control     id=13   [slave  keyboard (3)]↳ Intel HID events                          id=18   [slave  keyboard (3)]↳ SIGMACHIP USB Keyboard Consumer Control   id=19   [slave  keyboard (3)]

        需要确定哪个 id 对应哪个触摸屏,使用“xinput test [id]”命令确定,如执行“xinput test 14”命令,点击触摸屏,有输出 log 就表示当前触摸屏幕对应的 id 号是 14。

jw@jw-Windows-cpmpact-G6900E:~$ xinput test 14
motion a[0]=12855 a[1]=27919 
button press   1 a[0]=12855 a[1]=27919 
motion a[0]=13535 a[1]=38575 

        使用“xrandr”命令可以查看屏幕的名称,最终知道“eDP-1”触摸屏对应的触摸 id 是 14,“DP-1”对应的触摸 id 是 16,使用以下命令成功解决了 bug。

xinput map-to-output 14 eDP-1
xinput map-to-output 16 DP-1

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

热搜词