在 16:10 屏幕上调整触摸屏坐标以实现 4:3 宽高比

在 16:10 屏幕上调整触摸屏坐标以实现 4:3 宽高比

你好,我最近一直在研究一种奇怪的设备。它是一款原始分辨率为 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

那么这是我需要编辑触摸矩阵的情况吗?有什么指示或者有更简单的方法吗?谢谢你的帮助。

答案1

我能够使用 来解决这个问题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

相关内容