MacOS – How to remove or disable a default keyboard layout

keyboardmacos

Is it possible to remove or disable one of OS X Lion’s default keyboard layouts?

I’m using a custom keyboard layout, and now that I managed to set it as the system-wide default keyboard layout, I’d like to be able to uncheck or remove the built-in “U.S.” keyboard layout that came with OS X. Here’s a screenshot — note that the checkbox is disabled:

Screenshot

In OS X 10.9, this preference pane has been redesigned, but still there’s no way to “remove” the built-in “U.S.” keyboard layout:

Screenshot

Since I never use the U.S. keyboard layout, I’d love to get rid of it, i.e. remove it from the Input menu in the menu bar. How can I do this?


Update: Daniel’s answer doesn’t really answer this question, but it does offer some valuable information regarding this problem:

Mac OS X seems to require at least one keyboard layout that the system recognizes as a “Latin character” layout to be selected.

Assuming this is accurate information (thanks, Daniel!), the question could be rephrased as follows:

How to make OS X consider a custom keyboard to be a Latin character layout?


Update: I just came across something that might help.

Best Answer

  1. Enable an input source that is not like your physical keyboard layout from System Preferences (I used Afghan Dari).
  2. Run f=~/Library/Preferences/ByHost/com.apple.HIToolbox*.plist; plutil -convert xml1 $f; open $f -e.
  3. Remove other input sources except the temporarily enabled keyboard layout and your custom keyboard layout.
  4. Log out and back in.
  5. Remove the temporarily enabled keyboard layout from the property list.
  6. Log out and back in.

Edit: the method above seems to have stopped working in 10.9. This worked in both 10.9 or 10.8 though:

  1. Change the current input source to your custom keyboard layout.
  2. Open ~/Library/Preferences/com.apple.HIToolbox.plist (in 10.9) or ~/Library/Preferences/ByHost/com.apple.HIToolbox.*.plist (in 10.8 and earlier). You can convert the plist to XML with plutil -convert xml1.
  3. Remove the input source or input sources you want to disable from the AppleEnabledInputSources dictionary. If there is an AppleDefaultAsciiInputSource key, remove it.
  4. Restart.