Code to activate and deactivate trackpad


Does anyone have code to turn off and on the trackpad? I recently got a Magic Trackpad for my monitor and I'm wanting to have a touch bar button that turns on handoff my trackpad.


You don't need code for that, you can make use of the accessibility function in MacOS itself. Go to System Preferences -> Accessibility -> Pointer Control -> Alternative Control Methods... click on the Options button for Enable Mouse Keys

and tick both the options

Now any time you want to disable the trackpad, just press the option key on the keyboard 5 times in a row... do the same to enable it back.

oh cool! thanks. then I can make a touchbar button for this with key sequences, right?

when I activate mouse keys, some of the keyboard letters don't work. how do I fix it?

Imprint | Privacy Policy