我们如何通过 Windows 操作系统执行的 JavaScript 禁用触摸板

我们如何通过 Windows 操作系统执行的 JavaScript 禁用触摸板

有没有什么好主意可以禁用触摸板 - 或者稍后重新启用它 - 通过 javascript、PowerShell 或其他有权执行/写入其驱动程序设置的脚本来执行,以便可以自动化并在操作系统上更好地控制?

答案1

使用自动热键, 有一个脚本禁用和启用 Synaptics 触摸板。 注意,对一个品牌管用的方法可能对另一个品牌不管用。下面引用了 Yuri Gurin 的剧本,但Github获取最新版本

;Disable and Enable Synaptics touchpad using Keyboard Shortcut on Windows 10

;CTRL+F9 to enable the Synaptics Touchpad
^F9::
Run C:\Windows\System32\control.exe main.cpl ;Open Mouse Properties
Sleep 1000 ;Wait one second
if WinExist("Mouse Properties") { 
    WinActivate ;Make Mouse Properties the active Window
    Send, ^+{TAB} ;Go to last tab
    Send, !E ;Alt+E to enable touchpad
    Send, {ENTER} ;Enter to confirm and close window
}

;SHIFT+F9 to disable the Synaptics Touchpad
+F9::
Run C:\Windows\System32\control.exe main.cpl ;Open Mouse Properties
Sleep 1000 ;Wait one second
if WinExist("Mouse Properties") {
    WinActivate ;Make Mouse Properties the active Window
    Send, ^+{TAB} ;Go to last tab
    Send, !D ;Alt+D to disable touchpad
    Send, {ENTER} ;Enter to confirm disable
    Send, {ENTER} ;Enter to confirm and close window
}

相关内容