xinput --set-prop X 请求失败的错误:BadValue(整数参数超出操作范围)

xinput --set-prop X 请求失败的错误:BadValue(整数参数超出操作范围)

我正在尝试在 Ubuntu 22.04(Xorg 会话)中使用鼠标滚动时获得更好的精度。我发现发布并且对于我的特定系统我得到

$ xinput list-props 12
Device 'Logitech T400':
    Device Enabled (189):   1
    Coordinate Transformation Matrix (191): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
    libinput Natural Scrolling Enabled (325):   0
    libinput Natural Scrolling Enabled Default (326):   0
    libinput Scroll Methods Available (327):    0, 0, 1
    libinput Scroll Method Enabled (328):   0, 0, 0
    libinput Scroll Method Enabled Default (329):   0, 0, 0
    libinput Button Scrolling Button (330): 2
    libinput Button Scrolling Button Default (331): 2
    libinput Button Scrolling Button Lock Enabled (332):    0
    libinput Button Scrolling Button Lock Enabled Default (333):    0
    libinput Middle Emulation Enabled (334):    0
    libinput Middle Emulation Enabled Default (335):    0
    libinput Accel Speed (336): 0.000000
    libinput Accel Speed Default (337): 0.000000
    libinput Accel Profiles Available (338):    1, 1
    libinput Accel Profile Enabled (339):   1, 0
    libinput Accel Profile Enabled Default (340):   1, 0
    libinput Left Handed Enabled (341): 0
    libinput Left Handed Enabled Default (342): 0
    libinput Send Events Modes Available (310): 1, 0
    libinput Send Events Mode Enabled (311):    0, 0
    libinput Send Events Mode Enabled Default (312):    0, 0
    Device Node (313):  "/dev/input/event8"
    Device Product ID (314):    1133, 16422
    libinput Drag Lock Buttons (343):   <no items>
    libinput Horizontal Scroll Enabled (344):   1
    libinput Scrolling Pixel Distance (345):    15
    libinput Scrolling Pixel Distance Default (346):    15
    libinput High Resolution Wheel Scroll Enabled (347):    1

看起来应该改成libinput Scrolling Pixel Distance较小的数字。但是当我尝试时,xinput --set-prop 12 "libinput Scrolling Pixel Distance" 1我得到了

X Error of failed request:  BadMatch (invalid parameter attributes)
  Major opcode of failed request:  131 (XInputExtension)
  Minor opcode of failed request:  57 ()
  Serial number of failed request:  21
  Current serial number in output stream:  22

无论我尝试设置哪个值。我该如何更改这些参数?

答案1

首先,根据https://man.archlinux.org/man/libinput.4.en#SCROLL_PIXEL_DISTANCE,数字越高,滚动越慢(越精确)。

根据我在 PopOS 上的测试,有效值必须在 [10, 50] 范围内。所以你几乎明白了,试试:

xinput --set-prop 12 "libinput Scrolling Pixel Distance" 50

问题是,此设置仅对当前会话有效,并且每次登录时都需要重新应用。到目前为止,我找不到更改默认值的方法。

相关内容