Posted by 西维蜀黍 on 2022-02-26, Last Modified on 2022-02-27

For macOS 10.8 and later:

  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.