Skip to content

Instantly share code, notes, and snippets.

@ohforest
Forked from ygurin/synapticshotkey.ahk
Created March 30, 2022 14:05
Show Gist options
  • Save ohforest/8b679af4cff10059c8b66ef967958d7c to your computer and use it in GitHub Desktop.
Save ohforest/8b679af4cff10059c8b66ef967958d7c to your computer and use it in GitHub Desktop.
Simple AutoHotkey script disables and enables touchpad on Windows 10. Synaptics touchpad driver must be installed. This is targeted at older machines where the driver is installed, but Function key for disabling the touchpad doesn’t work.
;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
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment