如何编辑突触配置?xorg.conf 方式不起作用

Ald*_*Jay 5 configuration xorg synaptics

我需要将 TapButton3 绑定为鼠标中央按钮,所以我这样做:

synclient TapButton3=2
Run Code Online (Sandbox Code Playgroud)

它工作得很好,但是当我重新启动或从暂停中醒来时,它会忘记设置。我知道我必须按如下方式创建 xorg.conf

Section "InputClass" 
Identifier "touchpad catchall" 
    Driver "synaptics" 
    MatchIsTouchpad "on" 
    Option "TapButton3" "2" 
EndSection
Run Code Online (Sandbox Code Playgroud)

但这不起作用。任何人都可以帮助我吗?...请?

Joh*_*ber 3

我使用以下内容创建了 /etc/X11/xorg.conf.d/71-synaptics.conf 文件sudo vi

Section "InputClass"
        Identifier "touchpad catchall"
        Driver "synaptics"
        MatchIsTouchpad "on"
        Option "TapButton3" "2"
EndSection
Run Code Online (Sandbox Code Playgroud)

我可以在 /var/log/Xorg.0.log 中看到该选项已设置。

[ 91056.468] (**) Option "TapButton3" "2"
Run Code Online (Sandbox Code Playgroud)

该选项与我在 70-synaptics.conf 文件中类似设置的选项合并。

如果您的设备使用不同的设备或不同的驱动程序(请参阅 /var/log/Xorg.0.log 查看),您应该适当调整 Identifier 和 Driver 行。

另一种方法是禁用 gnome 鼠标设置插件。

  • 为此,请使用Alt+ Ctl+启动终端T,然后安装 dconf-editor:

    apt-get install dconf-editor海酮

  • 启动 dconf 编辑器

    dconf-editor

并将树导航到 org.gnome.settings-daemon.plugins.mouse。

  • 最后,取消选中“活动”框

后一种方法的缺点是,您在“系统设置”->“鼠标和触摸板”中配置的所有设置都不会生效。

从评论来看,这种方法是通过 hleinone来的。


Lei*_*hao 1

旧答案

您可以使用ClickFinger3它来代替,它与TapButton3.

我遇到了完全相同的问题。除了TapButton3,我的conf文件也设置ClickFinger3为2。

Section "InputClass"
        Identifier "touchpad bind middle button"
        MatchDriver "synaptics"
        Option "TapButton3" "2"
        Option "ClickFinger3" "2"
EndSection
Run Code Online (Sandbox Code Playgroud)

但是,我的Xorg.0.log确实有以下内容。

[    35.860] (**) Option "TapButton3" "2"
[    35.860] (**) Option "ClickFinger3" "2"
Run Code Online (Sandbox Code Playgroud)

讽刺的是,ClickFinger3效果很好,但TapButton3根本不起作用。

我还尝试将文件放入synclient TapButton3=2 ClickFinger3=2启动.xsessionrc应用程序脚本中。

我试过这个

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
Run Code Online (Sandbox Code Playgroud)

然后

xinput set-prop --type=int --format=8 "SYNA2393:00 06CB:75E2 Touchpad" "Synaptics Tap Action" 2 3 0 0 1 3 2
Run Code Online (Sandbox Code Playgroud)

无济于事,他们都没有为 工作TapButton3,而且都为 工作ClickFinger3。我花了一天的时间(毫不夸张的说)研究了一下,得出了这个结论。

代码很可能导致这种奇怪的行为。

参考文献:
14.04 / Unity 中多点触控手势的状态
如何在 Unity 中禁用任意默认多点触控手势?


新答案

写完上面的内容后,我找到了真正的解决方案。

不小心,我通过 GUI 取消选中了“鼠标和触摸板”中的“点击以单击”选项,然后读取了synclient. 我观察到所有与点击相关的值都已设置为 0。这使我相信 Unity 鼠标面板synclient在登录时执行并设置"Synaptics Tap Action"2, 3, 0, 0, 1, 3, 0

为了验证我的猜想,我需要禁用这个 GUI 功能。我用谷歌搜索“ubuntu unity control center override synclient”并得到这个链接作为最佳结果。

我通过停用 GNOME 鼠标插件进行了实验。

gsettings set org.gnome.settings-daemon.plugins.mouse active false
Run Code Online (Sandbox Code Playgroud)

然后我重新启动,万岁,TapButton3登录后终于可以工作了。我高兴地四处走动,很快发现我通常通过 GUI 设置设置的自然(反向?)滚动不再起作用。经过一番调查,我收集了 GNOME 鼠标插件执行的以下操作(可能不完整)。

synclient HorizTwoFingerScroll=1 VertEdgeScroll=0
syndaemon -i 1.0 -t -K -R &
Run Code Online (Sandbox Code Playgroud)

我现在可以针对每个用户进行触摸板设置(我更喜欢这样做)。所以我删除了我的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
Run Code Online (Sandbox Code Playgroud)

参考:
如何保留我的 synclient 设置?