Old Karabiner handled this very well, I would very much like to se this feature in Karabiner-Elements as well.
+1
+1.
A VERY useful & necessary feature while using a USB or bluetooth keyboard !
BTW, is there any json configurations to achieve this feature ?
+1
+1
Was this for disabling the internal keyboard entirely or disabling modifying the internal keyboard? i.e. when you unplug your external keyboard on a Macbook and go back to using the internal keyboard, the modifier keys won't affect it.
_That_ bit was wonderful.
+1
+1, my cat love sitting on internal keyboards😒
+1, I'd love to put my keyboard on my internal keyboards to save the space
+1, I also put my keyboard on my internal keyboard :), this feature is really essential.
This is Karabiner's major feature for me. I found a workaround to manually disable and enable internal keyboard for now:
Disable:
sudo kextunload /System/Library/Extensions/AppleUSBTopCase.kext/Contents/PlugIns/AppleUSBTCKeyboard.kext
Enable:
sudo kextload /System/Library/Extensions/AppleUSBTopCase.kext/Contents/PlugIns/AppleUSBTCKeyboard.kext
When disabled, the following error returns, but the keyboard stops anyway:
(kernel) Can't unload kext com.apple.driver.AppleUSBTCKeyboard; classes have instances:
(kernel) Kext com.apple.driver.AppleUSBTCKeyboard class AppleUSBTCKeyboard has 2 instances.
Failed to unload com.apple.driver.AppleUSBTCKeyboard - (libkern/kext) kext is in use or retained (cannot unload).
When re-enabled, the last 9 keystrokes pressed on internal keyboard while deactivated will be shown on active window.
This command doesn't work on MacOS Sierra.
sudo kextunload /System/Library/Extensions/AppleUSBTopCase.kext/Contents/PlugIns/AppleUSBTCKeyboard.kext
(kernel) Kext com.apple.driver.AppleUSBTCKeyboard not found for unload request.
Failed to unload com.apple.driver.AppleUSBTCKeyboard - (libkern/kext) not found.
Check if System Integrity Protection (rootless) is disabled with:
csrutil status
Since 10.11 we have to disable it in order to modify files on /System, /sbin and /usr (excluding /usr/local).
Instructions about feature and how to enable/disable can be found at osxdaily's article.
@leocg — I have disabled SIP and ensured it's not enabled withcsrutil status, and was able to run your command to unload kext for keyboard, but can still type via the onboard keyboard. I have a HHKB that I like to rest on top of the internal keyboard and was hoping your solution would work, but I didn't have any luck. 👎
@cantyjeffrey I have a Pok3r keyboard and I use just like you, on top of the internal keyboard. Can you paste the error? I'm using 10.12, maybe it's an issue with 10.12.1.
@leocg
Hey there, I also have a Pok3r.
But I run your workaround in 10.12 and 10.12.1, it returned me the same info:
$ sudo kextunload /System/Library/Extensions/AppleUSBTopCase.kext/Contents/PlugIns/AppleUSBTCKeyboard.kext
Password:
(kernel) Kext com.apple.driver.AppleUSBTCKeyboard not found for unload request.
Failed to unload com.apple.driver.AppleUSBTCKeyboard - (libkern/kext) not found.
And I'm sure that
$ csrutil status
System Integrity Protection status: disabled.
@cool4zbl
hey there, you're not the only one getting the error. I was reading about it and found out that the kext isn't loaded into the system when you try to unload it.
Here are some steps you can follow:
1 - Run kextstat and look for something like: 190 0 0xffffff7f84230000 0x3000 0x3000 com.apple.driver.AppleUSBTCKeyboard (251) 95C8342E-C0CE-3E61-A790-E7D088E2C478 <86 20 18 15 7 6 5 4 3 1>
2 - Restart the computer if you cannot find it and run kextstat again after reboot. Verify if com.apple.driver.AppleUSBTCKeyboard is present this time
3 - run the kextunload command.
If the error keep showing, verify if the kext exists in you Mac by typing ls /System/Library/Extensions/AppleUSBTopCase.kext/Contents/PlugIns/. My MacBook Pro 17 (Late 2011) return 4 files:
If the file exists and you still can't unload it, paste the results of the commands below so I can compare to mine:
ls -lR /System/Library/Extensions/AppleUSBTopCase.kext/Contents/PlugIns/AppleUSBTCKeyboard.kext/
and
find /System/Library/Extensions/AppleUSBTopCase.kext/Contents/PlugIns/AppleUSBTCKeyboard.kext/ -type f -exec md5 '{}' \;
Hello everyone, I wrote a Node.js script to automatically disable internal keyboard when external keyboard connected and vice versa. It work directly with Karabiner-Elements without any hacking with mac using csrutil disable.
You can feel free to use my script here, I wrote a guide in README also: https://github.com/nmqanh/karabiner-elements-disable-internal-when-external-connected
I've added this function in v0.90.63.
Please upgrade the latest version and configure in Devices tab.

How to turn on
Most helpful comment
I've added this function in v0.90.63.
Please upgrade the latest version and configure in Devices tab.