Resolution

在 16:10 的螢幕上調整 4:3 縱橫比的觸摸屏座標

  • July 15, 2019

您好,我最近一直在研究一種奇怪的設備。它是一款原生解析度為 800x1280 的平板電腦——是的,它是向後的。顯示器處於縱向模式,我必須進行一些 xorg 配置編輯來旋轉螢幕和旋轉觸摸屏。如果我使用本機解析度,這很好用,但是我試圖讓它使用 768x1024 解析度。通過使用以下命令,我已成功獲得 4:3 模式下的 768x1024 解析度(側面有黑條,這是我想要的)在平板電腦上顯示:

user1:~ # xrandr --newmode "768x1024_60.00"   65.25  768 816 896 1024  1024 1027 1037 1063 -hsync +vsync
user1:~ # xrandr --addmode DSI-1 768x1024_60.00
user1:~ # xrandr -s 768x1024_60.00

我遇到的問題是讓實際的觸摸屏數字化儀與之對齊,就像它仍然停留在 16:10 一樣。這是我的 xorg 配置文件:

user1:~ # cat /etc/X11/xorg.conf.d/99-touchscreen.conf
Section "InputClass"
       Identifier "evdev touchscreen catchall"
       MatchIsTouchscreen "on"
       MatchDevicePath "/dev/input/event*"
       Driver "evdev"
       Option "SwapAxes" "true"
       Option "InvertY" "true"
EndSection

user1:~ # cat /etc/X11/xorg.conf.d/50-monitor.conf
Section "Monitor"
   Identifier "DSI-1"
   Option "Rotate" "right"
EndSection

以下是觸摸屏的屬性:

Device 'Goodix Capacitive TouchScreen':
   Device Enabled (152):   1
   Coordinate Transformation Matrix (154): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
   Device Accel Profile (284):     0
   Device Accel Constant Deceleration (285):       1.000000
   Device Accel Adaptive Deceleration (286):       1.000000
   Device Accel Velocity Scaling (287):    10.000000
   Device Product ID (276):        1046, 9111
   Device Node (275):      "/dev/input/event2"
   Evdev Axis Inversion (288):     0, 1
   Evdev Axis Calibration (289):   <no items>
   Evdev Axes Swap (290):  1
   Axis Labels (291):      "Abs MT Position X" (282), "Abs MT Position Y" (283), "Abs MT Touch Major" (280), "Abs MT Width Major" (281), "None" (0), "None" (0)
   Button Labels (292):    "Button Unknown" (277), "Button Unknown" (277), "Button Unknown" (277), "Button Wheel Up" (158), "Button Wheel Down" (159)
   Evdev Scrolling Distance (293): 0, 0, 0
   Evdev Middle Button Emulation (294):    0
   Evdev Middle Button Timeout (295):      50
   Evdev Third Button Emulation (296):     0
   Evdev Third Button Emulation Timeout (297):     1000
   Evdev Third Button Emulation Button (298):      3
   Evdev Third Button Emulation Threshold (299):   20
   Evdev Wheel Emulation (300):    0
   Evdev Wheel Emulation Axes (301):       0, 0, 4, 5
   Evdev Wheel Emulation Inertia (302):    10
   Evdev Wheel Emulation Timeout (303):    200
   Evdev Wheel Emulation Button (304):     4
   Evdev Drag Lock Buttons (305):  0
   Evdev Kiosk Touch Mode (306):   0
   Evdev Kiosk Touch Button (307): 1
   Evdev Kiosk Touch Button Delay (308):   0

那麼這是我需要編輯觸摸矩陣的情況嗎?對此有任何指示還是有更簡單的方法?謝謝你的幫助。

我能夠使用 來解決這個問題xinput_calibrator,這給了我正確的 xorg 校準數據。

基本上,打開一個終端視窗並啟動 xinput_calibrator 並觸摸它要求您觸摸的點。完成後,終端視窗將輸出與 xorg 一起使用的資訊:

user1:~> xinput_calibrator
Calibrating EVDEV driver for "Goodix Capacitive TouchScreen" id=11
       current calibration values (from XInput): min_x=66, max_x=725 and min_y=-5, max_y=1284

Doing dynamic recalibration:
       Setting new calibration data: 61, 730, -3, 1272


--> Making the calibration permanent <--
 copy the snippet below into '/etc/X11/xorg.conf.d/99-calibration.conf'
Section "InputClass"
       Identifier      "calibration"
       MatchProduct    "Goodix Capacitive TouchScreen"
       Option  "Calibration"   "61 730 -3 1272"
EndSection

引用自:https://unix.stackexchange.com/questions/529896