Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable internal keyboard #95

Closed
p-a opened this issue Sep 22, 2016 · 19 comments
Closed

Disable internal keyboard #95

p-a opened this issue Sep 22, 2016 · 19 comments

Comments

@p-a
Copy link

p-a commented Sep 22, 2016

Old Karabiner handled this very well, I would very much like to se this feature in Karabiner-Elements as well.

@fengmiaosen
Copy link

+1

@cool4zbl
Copy link

+1.
A VERY useful & necessary feature while using a USB or bluetooth keyboard !
BTW, is there any json configurations to achieve this feature ?

@Hezion
Copy link

Hezion commented Sep 23, 2016

+1

1 similar comment
@alexleekt
Copy link

+1

@AndrewNatoli
Copy link

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.

@yetsun
Copy link

yetsun commented Oct 4, 2016

+1

@ohcrider
Copy link

ohcrider commented Oct 4, 2016

+1, my cat love sitting on internal keyboards😒

@edgeterm
Copy link

edgeterm commented Oct 9, 2016

+1, I'd love to put my keyboard on my internal keyboards to save the space

@nmqanh
Copy link

nmqanh commented Oct 9, 2016

+1, I also put my keyboard on my internal keyboard :), this feature is really essential.

@leocg
Copy link

leocg commented Oct 18, 2016

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.

@2Y2s1mple
Copy link

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.

@leocg
Copy link

leocg commented Oct 25, 2016

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.

@yerffejytnac
Copy link

@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. 👎

@leocg
Copy link

leocg commented Oct 31, 2016

@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.

@cool4zbl
Copy link

cool4zbl commented Nov 1, 2016

@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.

@leocg
Copy link

leocg commented Nov 1, 2016

@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:

  • AppleUSBTCButtons.kext
  • AppleUSBTCKeyEventDriver.kext
  • AppleUSBTCKeyboard.kext
  • AppleUSBTrackpad.kext

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 '{}' \;

@nmqanh
Copy link

nmqanh commented Nov 2, 2016

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

@tekezo
Copy link
Member

tekezo commented Nov 6, 2016

I've added this function in v0.90.63.
Please upgrade the latest version and configure in Devices tab.

161106-0002

@tekezo tekezo closed this as completed Nov 6, 2016
@ycjcl868
Copy link

ycjcl868 commented Aug 5, 2019

How to turn on

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests