Created
February 20, 2012 12:34
-
-
Save JohnMurray/1869020 to your computer and use it in GitHub Desktop.
Disable Mac OS X Keyboard (built-in only)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Unload the keyboard so I can use my external keyboard | |
# and not worry about accidentally pressing buttons on | |
# the built-in. This may not be a problem for you but, you | |
# should see my desk sometimes (Oh no!!) ;-) | |
sudo kextunload /System/Library/Extensions/AppleUSBTopCase.kext/Contents/PlugIns/AppleUSBTCKeyboard.kext/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
sudo kextunload -v 5 /System/Library/Extensions/AppleUSBTopCase.kext/Contents/PlugIns/AppleUSBTCKeyboard.kext/
sudo kextload -v 5 /System/Library/Extensions/AppleUSBTopCase.kext/Contents/PlugIns/AppleUSBTCKeyboard.kext/
This does work on new versions of MacOS, but only when System Integrity Protection (SIP) is not affecting the context. SIP was introduced in El Capitan and got some upgrades in Mojave, so all newer MacOS will have this enabled:
csrutil status
com.apple.driver.AppleUSBTCKeyboard
, so thekextload
finds nothing to unloadif you're on Mojave and above, running
csrutil disable
would "fix" the issue, but there are three caveats:cmd
+r
on boot) and runcsrutil disable
from therekextload
) your built-in keyboard, or use a non-bluetooth keyboard, if you want to enter recovery mode at a later date, after disabling your keyboard withkextunload
sudo
permissions first to do that though. This is easy enough to protect and manage on a *nix server somewhere because you (should) have protections in place and a strict policy on who cansu
orsudo
and when. But on an os with a GUI, with applications being closed, opened, installed, etc. constantly, it's not so easy to ensure something doesn't slip in.TBD:
selinux
config)? The answer is a soft "no" per the official docs. But there is an interesting output ofSystem Integrity Protection status: enabled (Custom Configuration)
. This could suggest that it may be possible to selectively disable SIP features and set a custom config, but no suggestion on how this could be done is exposed in the docs. If someone knows more about this, lmk (/usr/bin/csrutil
is a binary inmach-o
format by the way)v0.90.63
, but I can't find a release with that tag so I don't see the commit. Searching through the codebase doesn't show anything too obvious re: kext. Any insight on that would be helpful too.