如何编辑synaptics配置? xorg.conf方式不起作用
我需要将TapButton3绑定为中央鼠标按钮,所以我这样做:
synclient TapButton3=2
它工作得很好但是当我重新启动或从暂停状态唤醒时它会忘记设置。 我知道我必须按如下方式创建xorg.conf
Section "InputClass" Identifier "touchpad catchall" Driver "synaptics" MatchIsTouchpad "on" Option "TapButton3" "2" EndSection
但是这不起作用。 有人可以帮帮我吗? …请?
我用sudo vi
创建了/etc/X11/xorg.conf.d/71-synaptics.conf文件,其中包含以下内容:
Section "InputClass" Identifier "touchpad catchall" Driver "synaptics" MatchIsTouchpad "on" Option "TapButton3" "2" EndSection
我可以在/var/log/Xorg.0.log中看到该选项已被设置。
[ 91056.468] (**) Option "TapButton3" "2"
该选项与我在70-synaptics.conf文件中类似设置的选项合并。
如果您的设备使用不同的设备或不同的驱动程序(请参阅/var/log/Xorg.0.log以查看),则应适当调整标识符和驱动程序行。
另一种方法是禁用gnome鼠标设置插件。
-
为此,请使用Alt + Ctl + T启动终端,然后安装dconf-editor:
apt-get install dconf-editor
hleinone -
启动dconf-editor
dconf-editor
并将树导航到org.gnome.settings-daemon.plugins.mouse。
- 最后,取消选中“活动”框
后一种方法的缺点是您在系统设置 – >鼠标和触摸板中配置的设置都不会有效。
从评论中,这种方法来自hleinone。
老答案
您可以使用ClickFinger3
,这与TapButton3
非常接近。
我遇到了完全相同的问题。 除了TapButton3
,我的conf文件还将ClickFinger3
设置为2。
Section "InputClass" Identifier "touchpad bind middle button" MatchDriver "synaptics" Option "TapButton3" "2" Option "ClickFinger3" "2" EndSection
但是,我的Xorg.0.log
确实有以下内容。
[ 35.860] (**) Option "TapButton3" "2" [ 35.860] (**) Option "ClickFinger3" "2"
具有讽刺意味的是, ClickFinger3
效果非常好,但TapButton3
甚至无法正常工作。
我还尝试在启动应用程序脚本中的.xsessionrc
文件中放置synclient TapButton3=2 ClickFinger3=2
。
我试过这个
xinput set-prop --type=int --format=8 "SYNA2393:00 06CB:75E2 Touchpad" "Synaptics Tap Action" \ `xinput list-props "SYNA2393:00 06CB:75E2 Touchpad" | sed -n 's/,//g; s/Synaptics Tap Action.*:\(.*\)./\1/p'` 2
然后
xinput set-prop --type=int --format=8 "SYNA2393:00 06CB:75E2 Touchpad" "Synaptics Tap Action" 2 3 0 0 1 3 2
无济于事,它们都不适用于TapButton3
,所有这些都适用于ClickFinger3
。 我花了一天时间(字面上,毫不夸张地)对它进行研究并得出了这个结论。
这行代码很可能是造成这种奇怪行为的原因。
参考文献:
14.04 / Unity中多点触控手势的状态
如何在Unity中禁用任意默认多点触控手势?
新答案
在我写完上面的内容后,我找到了真正的解决方案
无意中,我通过GUI取消选中Mouse&Touchpad中的“Tap to Click”选项,然后读取synclient
的输出。 我观察到所有与tap相关的值都设置为0.这使我相信Unity鼠标面板在登录时执行synclient
并将"Synaptics Tap Action"
设置为synclient
。
为了validation我的推测,我需要禁用这个GUI的东西。 我用谷歌搜索“ubuntu统一控制中心覆盖synclient”并将此链接作为最高结果。
我通过停用GNOME鼠标插件进行了一项实验。
gsettings set org.gnome.settings-daemon.plugins.mouse active false
然后我重新启动, TapButton3
, TapButton3
终于在登录后工作了。 我大笑起来,很快发现我通常的自然(反向?)滚动,我通过GUI设置设置,不再有效。 经过一番调查,我收集了GNOME鼠标插件制作的以下动作(可能不完整)。
synclient HorizTwoFingerScroll=1 VertEdgeScroll=0 syndaemon -i 1.0 -t -K -R &
我现在可以在每个用户群(我更喜欢)上进行触摸板设置。 所以我删除了我的synaptics.conf
文件,并将以下内容写成~/.xsessionrc
。
synclient TapButton3=2 ClickFinger3=2 synclient HorizTwoFingerScroll=1 VertEdgeScroll=0 # the following ampersand is significant syndaemon -i 1.0 -t -K -R & # natural scrolling synclient VertScrollDelta=-28 HorizScrollDelta=-28
参考:
如何使我的synclient设置坚持下去?