如何使用 libinput 更改滚动速度?

And*_*Sun 27 scrolling libinput

我在 Arch Linux Xfce 4.12 上运行。

我的鼠标滚轮滚动太慢,所以我想增加每个滚动“滴答”的行数。我读到这可以通过设置Evdev Scrolling Distancewith 来实现xinput,但是,我正在使用libinput并且没有看到与滚动距离相关的任何内容。

xinput list-props在我的鼠标上的输出:

Device Enabled (139):   1                                                                                                       
Coordinate Transformation Matrix (141): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
libinput Accel Speed (275): -0.640000                                                                                           
libinput Accel Speed Default (276): 0.000000                                                                                    
libinput Accel Profiles Available (277):    1, 1                                                                                
libinput Accel Profile Enabled (278):   1, 0                                                                                    
libinput Accel Profile Enabled Default (279):   1, 0                                                                            
libinput Natural Scrolling Enabled (280):   0                                                                                   
libinput Natural Scrolling Enabled Default (281):   0                                                                           
libinput Send Events Modes Available (259): 1, 0                                                                                
libinput Send Events Mode Enabled (260):    0, 0                                                                                
libinput Send Events Mode Enabled Default (261):    0, 0                                                                        
libinput Left Handed Enabled (282): 0                                                                                           
libinput Left Handed Enabled Default (283): 0                                                                                   
libinput Scroll Methods Available (284):    0, 0, 1                                                                             
libinput Scroll Method Enabled (285):   0, 0, 0                                                                                 
libinput Scroll Method Enabled Default (286):   0, 0, 0                                                                         
libinput Button Scrolling Button (287): 2                                                                                       
libinput Button Scrolling Button Default (288): 274                                                                             
libinput Middle Emulation Enabled (289):    0                                                                                   
libinput Middle Emulation Enabled Default (290):    0                                                                           
Device Node (262):  "/dev/input/event1"                                                                                         
Device Product ID (263):    1133, 50487                                                                                         
libinput Drag Lock Buttons (291):   <no items>                                                                                  
libinput Horizonal Scroll Enabled (264):    1                                                  
Run Code Online (Sandbox Code Playgroud)

如何更改我的滚动速度?

小智 11

Libinput没有任何类型的“对于每个滚轮滚动,做n行/度”的概念作为一个共同的一方,目前该设置似乎是特定于设备的,因为某些罗技具有Evdev Scrolling Distance (278)可能与“旧”一起出现的参数Evdev 驱动程序包括。

根据我的观点,这将被视为对用户体验的回归,起初,将可配置的鼠标滚动灵敏度包含到通用工具包 (libinput) 中被拒绝,现在它是未来版本的拉取请求的一部分– 可能必须在每个桌面环境中实现函数调用。

有很多方法可以解决此类问题,但取决于 Linux 发行版。

  1. 幸运的是,拥有特定于驱动程序的滚动敏感度——通过搜索所有带有滚动变量的输入来检查:

    xinput 列表 | 切-f2 | cut -f2 -d'=' | \
                xargs -d $'\n' -I'{}' sh -c "xinput list-props '{}' | grep -iq scroll && \
                                        (echo Listing dev id '{}'; xinput list-props '{}')"
    并通过 设置特定变量,其中可以是设备名称,也可以是设置名称。xinput --set-prop <ID> <SUB-ID> <values><ID><SUB-ID>

  2. 一般的修复程序重新跳线的libinput代码和重建

  3. 您可以尝试使用 X11 回滚到 udevadm/evdev 接口,然后尝试使用 X11 变量MOUSE_WHEEL_CLICK_ANGLE

  4. 最后一项的参考,它可以imwheel用来模拟乘数值中的鼠标滚动点击。

    # Should use imwheel --kill --buttons "4 5" to restart imwheel,
    # if the mouse has back/forward buttons, otherwhise imwheel --kill is enough.
    # imwheel must be set to autostart in your DE tools.
    #Edit ~/.imwheelrc to include, where '3' is a multiplier
    ".*"
    None,      Up,   Button4, 3
    None,      Down, Button5, 3
    Control_L, Up,   Control_L|Button4
    Control_L, Down, Control_L|Button5
    Shift_L,   Up,   Shift_L|Button4
    Shift_L,   Down, Shift_L|Button5
    
    Run Code Online (Sandbox Code Playgroud)
  5. 鼠标滚轮灵敏度有特定的应用程序设置,例如Chrome SmoothScrollFirefox SmoothWheel ref

  • Libinput 转换在很多方面都是用户体验的回归,几乎所有这些都归结为用户对其硬件行为的控制......鉴于发生这种情况的平台,这是不幸的。 (2认同)

meu*_*euh 5

当前没有用于更改 libinput 设备滚动速度的 api,但此博客解释了鼠标滚轮点击如何对应于您可以在 systemd 的 udev 配置文件中更改每个鼠标的移动角度/usr/lib/udev/hwdb.d/70-mouse.hwdb。阅读关于MOUSE_WHEEL_CLICK_ANGLE此文件开头的注释。

要进行本地更改,请创建一个新文件

 /etc/udev/hwdb.d/71-mouse-local.hwdb
Run Code Online (Sandbox Code Playgroud)

并添加您的首要规则。例如,如果您有 ImExPS/2 鼠标,您可以将每次点击的默认 15 度加倍到 30 度

# ImExPS/2 Logitech Wheel Mouse
mouse:ps2:*:name:ImExPS/2 Logitech Wheel Mouse:
 MOUSE_DPI=400@250
 MOUSE_WHEEL_CLICK_ANGLE=30
Run Code Online (Sandbox Code Playgroud)

重新加载 udev 数据库

 sudo udevadm hwdb --update
 sudo udevadm trigger /dev/input/event1
Run Code Online (Sandbox Code Playgroud)

  • 在 Ubuntu 16.10 中,系统 udev conf 位于 /lib/udev/hwdb.d/70-mouse.hwdb (6认同)
  • @daboross 共识似乎是大多数用户可配置的设置是一件坏事,这对我来说毫无意义,因为它只是让 Linux 变得不那么平易近人和用户友好/易于从 Mac 或 Windows 移动的人。整个 libinput 本身就让我重新考虑我的开关,因为我有一个 RSI,微调我的鼠标对我来说至关重要...... (3认同)
  • @orschiro 我的印象是 api 不是目的。希望所有设备都能在 udev 中正确识别和配置,然后就不需要用户配置。查看所有 [libinput 博客](https://who-t.blogspot.fr/search/label/libinput)。特别是 [1.4](https://who-t.blogspot.fr/2016/07/libinput-is-done.html) 对应于完成 libinput 的初始 TODO 列表。 (2认同)
  • 无论如何用触摸板做同样的事情? (2认同)