Skip to content

Instantly share code, notes, and snippets.



Last active Jan 10, 2021
What would you like to do?
Synaptics Touchpad Toggle
; Script to turn the Synaptics Touchpad on and off. Useful for laptops with
; Synaptic touchpads that do not have dedicated touchpad on/off buttons. I use
; this code to quickly toggle on and off the touchpad on my Lenovo Thinkpad,
; where I primarily use the TrackPoint.
; API Reference
; Constants
SE_ConnectionAny := 0
SE_DeviceTouchPad := 2
SP_DisableState := 268435825
; Connect to the Synaptics controller
SynAPI := ComObjCreate("SynCtrl.SynAPICtrl")
SynDev := ComObjCreate("SynCtrl.SynDeviceCtrl")
; Select the touchpad device
DeviceHandle := SynAPI.FindDevice(SE_ConnectionAny, SE_DeviceTouchPad, -1)
; Invert the disabled state
SynDev.SetLongProperty(SP_DisableState, !SynDev.GetLongProperty(SP_DisableState))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment