卡通設計類網站欣賞網絡營銷軟件大全
1 問題描述
????????CPU:G6900E
????????OS:ubuntu22.04
????????Kernel:6.8.0-49-generic
????????系統(tǒng)下有兩個一樣的 edp 觸摸屏,兩個觸摸屏的觸摸事件都響應在同一個 edp 屏幕上。
2 解決過程
????????使用“xinput”命令查看輸入設備,可以看到只有一個 touch,而且還有一個警告。表示正在使用 Xwayland 服務器,而不是直接在 X11 環(huán)境中使用 xinput。xinput 是一個用于配置和管理 X11 輸入設備的工具,而 Xwayland 是一個讓 X11 應用程序在 Wayland 環(huán)境下運行的兼容層。
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”,重啟系統(tǒng),即可關閉 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]”命令確定,如執(zhí)行“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