![xinput --set-prop X 請求失敗錯誤:BadValue(整數參數超出操作範圍)](https://rvso.com/image/1072904/xinput%20--set-prop%20X%20%E8%AB%8B%E6%B1%82%E5%A4%B1%E6%95%97%E9%8C%AF%E8%AA%A4%EF%BC%9ABadValue%EF%BC%88%E6%95%B4%E6%95%B8%E5%8F%83%E6%95%B8%E8%B6%85%E5%87%BA%E6%93%8D%E4%BD%9C%E7%AF%84%E5%9C%8D%EF%BC%89.png)
我試圖在 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
問題是,此設定僅對當前會話有效,並且需要在每次登入時重新套用。截至目前,我找不到更改預設值的方法。