Disable Trackpad and Keyboard Temporarily
Before doing this.....
WARNING: Before disabling the built-in keyboard, make darn sure you have an external keyboard connected!!
WARNING: Before disabling the built-in trackpad, make sure you have an external mouse connected!
sudo kextunload /System/Library/Extensions/AppleUSBTopCase.kext/Contents/PlugIns/AppleUSBTCKeyboard.kext/
To enable it use external keyboard...
sudo kextload /System/Library/Extensions/AppleUSBTopCase.kext/Contents/PlugIns/AppleUSBTCKeyboard.kext/
Source: http://t3chnot3s.blogspot.com/2013/12/disabling-built-in-keyboard-and.html
However I would recommend a simple and safe and very temporary method is to cut a piece of cardboard and place it on top of the keyboard. It worked for me to prevent my Cat taking over.
For the trackpad, there’s a setting for this on 10.7 and later.
System Preferences > Accessibility > Mouse & Trackpad > “Ignore built-in trackpad when mouse or wireless trackpad is present”
As for the keyboard: I haven’t tested this solution for disabling the built-in keyboard and wouldn’t recommend doing it either. Apparently you can unload a kernel extension to disable it completely.
Cannot find out how to do disable the keyboard but to disable the trackpad do this (for Yosemite)
Go to System Preferences > Accessibility > Mouse & Trackpad
and check Ignore built-in trackpad when mouse or wireless trackpad is present
Got this from here.
If you don't want to use the keyboard don't touch it! Will look this up if you still want to know.
If you want to disable the built-in trackpad using a keyboard shortcut, make a new Automator service and add this Applescript:
global state
set startTime to do shell script "perl -e 'use Time::HiRes qw(time); print time'"
if running of application "System Preferences" then
quit application "System Preferences"
delay 0.05
end if
tell application "System Preferences"
reveal pane id "com.apple.preference.universalaccess"
delay 0.05
tell application "System Events"
tell window 1 of application process "System Preferences"
select table 1 of scroll area 1
select row 15 of table 1 of scroll area 1
tell checkbox 2 of tab group 1 of group 1
click
set state to item (((get value of attribute "AXValue") as integer) + 1) of {"Enabled", "Disabled"}
end tell
end tell
end tell
quit
end tell
set endTime to do shell script "perl -e 'use Time::HiRes qw(time); print time'"
set elapsed to (round ((endTime - startTime) * 1000 * 1000)) / 1000
display notification (elapsed as string) & "ms" with title state & " Built-In Trackpad" subtitle "Time taken:"
Then go to System Preferences > Keyboard > Shortcuts > Services and assign a keyboard shortcut to your service.