如何在键入时禁用触摸板? 在Ubuntu 16.04上,syndaemon无效

我想在打字时停用触摸板。 我试过这个:

syndaemon -i 1 -d -t -K 

它应该停用触摸板上的敲击和滚动1秒钟并忽略修饰符+键组合但是在设置了syndaemon之后,没有任何改变。 触摸板始终处于活动状态,非常烦人。

我在Dell Precision 5510上使用Ubuntu 16.04。

你可能有两个触摸板驱动程序在运行,然后syndaemon会与错误的一个交互。 我在戴尔XPS 13上遇到了同样的问题,这个post( http://ubuntuforums.org/showthread.php?t=2316240 )帮助了我。

如果您还看到两个触摸板设备,请尝试禁用一个。 由于您有不同的计算机,链接中的说明可能适用于您,也可能不适用于您。

从提到的post来看,程序是:

使用文本编辑器以root身份打开文件/usr/share/X11/xorg.conf.d/51-synaptics-quirks.conf插入以下文本:

 # Disable generic Synaptics device, as we're using # "DLL0704:01 06CB:76AE Touchpad" # Having multiple touchpad devices running confuses syndaemon Section "InputClass" Identifier "SynPS/2 Synaptics TouchPad" MatchProduct "SynPS/2 Synaptics TouchPad" MatchIsTouchpad "on" MatchOS "Linux" MatchDevicePath "/dev/input/event*" Option "Ignore" "on" EndSection 

使用命令sudo systemctl restart lightdm重新启动或重新启动Xorg。来自ubuntuforums.org的ddarling。

自2018年1月以来,戴尔在其Ubuntu触摸板/鼠标问题知识库中有一个官方页面。 该页面描述了此修复程序以禁用“SynPS / 2 Synaptics TouchPad”,并建议转移到libinput而不是synaptics作为鼠标垫驱动程序。

 sudo add-apt-repository ppa:atareao/atareao sudo apt-get update sudo apt-get install touchpad-indicator 
  • 打开触摸板指示灯,然后单击指示器图标。
  • 您可以将首选项(在操作选项卡中)更改为“在键入时禁用触摸板”

干杯!

我正在使用ubuntu 17.10并尝试了不同的解决方案,这里建议大多数都不起作用。 特别是触摸板指示软件在ubuntu 17.10启动时只是禁用触摸板,我找不到任何方法重新启用它而不重新启动笔记本电脑。 现在我发现这个解决方案我觉得现在还能很好地工作:只需使用这个命令,

synclient PalmDetect = 1

这至少可以防止在触摸板上不必要地敲击手掌,这最终会带来更好的生活。

在查看’xinput’的选项后,我找到了一个有效且简单的解决方案,可以使用Ubuntu 16.04和Lubuntu 16.04禁用Synaptics触摸板

在终端窗口中,输入“sudo -s”并输入密码,为自己提供管理访问权限。

使用您喜欢的编辑器,如leafpad或gedit,创建一个新的脚本文件:

 leafpad /usr/local/bin/tpadoff 

并插入以下内容:

 #!/bin/bash #/usr/local/bin/tpadoff - turn off touchpad xinput --disable 'SynPS/2 Synaptics TouchPad' 

保存文件并退出编辑器。 然后输入命令:

 chmod 755 /usr/local/bin/tpadoff 

使文件可执行。 您可以重复创建一个tpadon文件,只需将’–disable’更改为’–enable’即可。

完成后,“退出”终端窗口以禁用管理员访问权限。

可以通过打开一个新的终端窗口并使用您喜欢的编辑器来创建桌面条目(在本例中,我再次使用leafpad):

 cd Desktop leafpad tpadoff.desktop 

并插入以下文本:[桌面输入]名称=触摸板关闭注释=关闭触摸板执行= / usr / local / bin / tpadoff终端=假类型=应用程序

保存文件并退出编辑器。 然后输入以下命令:

  chmod 775 tpadoff.desktop 

您也可以重复创建一个tpadon.desktop,将所有’off’引用更改为’on’。

完成后,您将有两种方法通过双击桌面图标或在终端窗口中输入“tpadoff”来关闭(并可选择打开)触摸板。

如果您的触摸板不同,您可能必须在终端窗口中使用“xinput”来查找触摸板的确切语法。 然后编辑’/ usr / local / bin / tpadoff’文件以匹配xinput报告的内容。

对于Kubuntu用户……

在Kubuntu 16.04上 – 在键入时禁用触摸板我必须在设置 – >输入设备 – >触摸板 – >启用/禁用触摸板下清除名为“仅禁用点击和滚动”的复选框。 这似乎很明显,但……

经过几个月的搜索,我决定编写一个简单的Python程序来在打字时禁用触摸板。 将程序添加到启动应用程序,使其在每次启动计算机时运行。 您需要运行xinput list来确定键盘的ID,在我的情况下它是17。

 xinput list ⎡ Virtual core pointer id=2 [master pointer (3)] ⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)] ⎜ ↳ Microsoft Microsoft® Nano Transceiver v1.0 id=11 [slave pointer (2)] ⎜ ↳ Microsoft Microsoft® Nano Transceiver v1.0 id=12 [slave pointer (2)] ⎜ ↳ DLL082A:01 06CB:76AF Touchpad id=14 [slave pointer (2)] ⎜ ↳ SynPS/2 Synaptics TouchPad id=18 [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)] ↳ Microsoft Microsoft® Nano Transceiver v1.0 id=10 [slave keyboard (3)] ↳ Integrated_Webcam_HD id=13 [slave keyboard (3)] ↳ Intel Virtual Button driver id=15 [slave keyboard (3)] ↳ Intel HID events id=16 [slave keyboard (3)] **↳ AT Translated Set 2 keyboard id=17 [slave keyboard (3)]** ↳ Dell WMI hotkeys id=19 [slave keyboard (3)] ↳ Microsoft Microsoft® Nano Transceiver v1.0 id=20 [slave keyboard (3)] 

这是该计划

 import time import subprocess import threading def main(): subprocess.call('gsettings set org.gnome.desktop.peripherals.touchpad tap-to-click true', shell=True) p = subprocess.Popen('xinput test 17', shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) clickTime = [0, 0] def checkTime(): keys = [37, 50, 62, 64, 105, 108, 133] while True: out = p.stdout.readline() if len(out) < 1: break key = int(out.split()[-1]) if key not in keys: clickTime[0] = time.time() t = threading.Thread(target=checkTime) t.start() lastTime = 0 touchpad = True while True: inactive = time.time() - clickTime[0] # print ('inactive for', inactive) if inactive > 1: if not touchpad: print ('Enable touchpad') subprocess.call('gsettings set org.gnome.desktop.peripherals.touchpad tap-to-click true', shell=True) touchpad = True else: if touchpad: print ('Disable touchpad') subprocess.call('gsettings set org.gnome.desktop.peripherals.touchpad tap-to-click false', shell=True) touchpad = False time.sleep(0.5) retval = p.wait() if __name__ == '__main__': main() 
 xinput list | while read line; do if [[ $line == *Touchpad* ]]; then tid="$(echo $line | cut -d '=' -f 2 | cut -c 1-2)" xinput set-prop $tid "Device Enabled" 0 fi done 

或者更简洁

 xinput list | sed -nre 's/^.*Touchpad.*\sid=(\S+).*$/\1/p' | xargs -I{} -- xinput set-prop {} 'Device Enabled' 0