Disable Trackpad and Keyboard Temporarily
For the trackpad, there’s a setting for this on 10.7 and later. 

System Preferences > Accessibility > Mouse &amp; 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.