Ubuntu Desktop 鼠标滚轮滚动方向

由于使用 OSX 习惯了, 所以希望 Ubuntu Desktop 使用中鼠标也行是自然方向滚动,以下是实现方法:

14.04 - Mouse wheel scrolls in reversed direction - Ask Ubuntu

查看输入设备列表:

~$ xinput list

输出类似:

⎡ Virtual core pointer                          id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
⎜   ↳ USB OPTICAL MOUSE                         id=12   [slave  pointer  (2)]
⎜   ↳ USB OPTICAL MOUSE                         id=14   [slave  pointer  (2)]
⎣ Virtual core keyboard                         id=3    [master keyboard (2)]↳ Virtual core XTEST keyboard               id=5    [slave  keyboard (3)]↳ Power Button                              id=6    [slave  keyboard (3)]↳ Video Bus                                 id=7    [slave  keyboard (3)]↳ Power Button                              id=8    [slave  keyboard (3)]↳ Sleep Button                              id=9    [slave  keyboard (3)]↳ LiteOn Lenovo Calliope USB Keyboard       id=10   [slave  keyboard (3)]↳ LiteOn Lenovo Calliope USB Keyboard       id=11   [slave  keyboard (3)]↳ USB OPTICAL MOUSE                         id=13   [slave  keyboard (3)]

其中 USB OPTICAL MOUSE 这个就是 usb 鼠标, 根据我的经验,需要修改的是第二个(id=14 这个).

~$ xinput list-props 14

输出:

Device 'USB OPTICAL MOUSE ':Device Enabled (166):   1Coordinate Transformation Matrix (168): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000libinput Accel Speed (399):     0.000000libinput Accel Speed Default (400):     0.000000libinput Accel Profiles Available (401):        1, 1libinput Accel Profile Enabled (402):   1, 0libinput Accel Profile Enabled Default (403):   1, 0libinput Natural Scrolling Enabled (395):       0libinput Natural Scrolling Enabled Default (396):       0libinput Send Events Modes Available (285):     1, 0libinput Send Events Mode Enabled (286):        0, 0libinput Send Events Mode Enabled Default (287):        0, 0libinput Left Handed Enabled (404):     0libinput Left Handed Enabled Default (405):     0libinput Scroll Methods Available (406):        0, 0, 1libinput Scroll Method Enabled (407):   0, 0, 0libinput Scroll Method Enabled Default (408):   0, 0, 0libinput Button Scrolling Button (409): 2libinput Button Scrolling Button Default (410): 2libinput Middle Emulation Enabled (411):        0libinput Middle Emulation Enabled Default (412):        0Device Node (288):      "/dev/input/event15"Device Product ID (289):        6392, 3991libinput Drag Lock Buttons (397):       libinput Horizontal Scroll Enabled (398):       1

注意 libinput Natural Scrolling Enabled (395) 这个的值默认是0, 修改为 1, 鼠标的滚轮滚动就是自然方向滚动了:

xinput set-prop 14 395 1

如果报错 Unable to connect to X server, 运行以下语句即可

export DISPLAY=:0.0


本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!

相关文章

立即
投稿

微信公众账号

微信扫一扫加关注

返回
顶部