This disable(/re-enable) macbook's built-in keyboard smarty when your external keyboard connected(/disconnected).
So, you can put your favorite keyboard on your Macbook.
This has dependency for libusbx to watch usb attaching/detaching. If you don't have it:
$ brew install libusbx
Next, clone this repository:
$ git clone https://github.com/kumar8600/mac-builtin-keyboard-disabler
$ cd mac-builtin-keyboard-disabler
Next, in ./keyboard-disabler.sh
, edit VENDER_ID
and PRODUCT_ID
for your keyboard's one (You can get them by executing $ system_profiler SPUSBDataType
):
#!/bin/bash
VENDER_ID=0x04d9 #YOU NEED TO CHANGE HERE
PRODUCT_ID=0x4545 #YOU NEED TO CHANGE HERE
.
.
.
Finally, make and install:
$ make
$ sudo make install
Done. Let's connect your external keyboard!!
When external keyboard disconnect (i.e. re-enable built-in keyboard), be printed all that was typed on the built-in keyboard.
I'm using the trick presented in following thread.
Can I disable internal keyboard/trackpad on MBP? - MacRumors Forums
This problem depends on this trick. But I don't know other way to disable built-in keyboard. We only can be careful.
To avoid it, please type something before disconnect external keyboard.