4

I have a custom keyboard layout that I have been using for many years on OS X (alternative to the french layout).

Since I upgraded to High Sierra today I face these issues:

  • the layout keeps switching back to the default (french), e.g. when I open a new application
  • sometimes I cannot switch back to my custom layout
  • when I reboot, I have to re-add the custom layout in the Preferences

I have tried resetting the NVRAM but no changes. What can I do?

  • Try setting up a new user account and see if it has the same problems. Add the results to your question text. – Tom Gewecke Oct 1 '17 at 17:58
  • 1
    I have the same problem. On my computer, specifically the applications installed via App Store (and App Store itself) seem to be unable to use custom layouts. The applications that I have installed with e.g. brew-cask work as before. – Miikka Oct 6 '17 at 5:44
4

I had the same problem. My Custom keyboard was located in /Library/Keyboard Layouts. I heard that there are some file rights issues when using Ukulele - so I moved my custom keyboard to ~/Library/Keyboard Layout:

cd ~/"Libaray/Keyboard Layouts"
mv "/Library/Keyboard Layouts"/*

Also, I changed file owner, group and some rights for files at that location:

sudo chown <your username> *
sudo chgrp staff *
sudo chmod u+rwx *

Then, remove your custom keyboard from System Preferences, reboot, add again and reboot again.

  • For now it seems to have fixed the issue, thank you! – Matthieu Napoli Nov 25 '17 at 8:05
  • Sorry, I do not understand this. To me it seems like you are saying you move it from one to the same folder. Am I supposed to replace the asterisk by something else? What do these commands do? – Kofi Nov 28 '17 at 22:47
5

I had the exact same problem: a custom keyboard layout that had worked just fine on macOS 10.12 Sierra suddenly refused to work with default applications and applications installed from App Store after updating to macOS 10.13 High Sierra. OS would always revert back to default keyboard layout of my region (Finnish). This got me thinking and I managed to fix the layout I use so that it now works with all apps, not just those installed from homebrew.

The trick is to modify your custom layout so that it is set to your current region. You can do this by either modifying the bundle manually or using Ukelele.

1. Editing the layout with Ukelele

Download and install Ukelele from for example homebrew. When you open the app open your custom layout from file or if you have it currently active you can create new bundle based on it by choosing ‘File’ → ‘New from current input source’. After you have it open you must set correct language (and possibly region) for it from ‘Language…’ settings found from ‘Keyboard Layouts’ tab. The language doesn't have to match the language of the OS and I don't know if the region has anything to do with this issue (Ukelele says it's optional) but setting it to your region can't hurt.

After setting the language from the ‘Keyboard Layouts’ tab you need to set the localisation from ‘Localisations’ tab. If there is already a locale line in the list you can edit it by double clicking it and setting the language (still doesn't have to match the language of the OS), if not you can add a new one with the button with a ‘+’ sign on it. Setting the region is optional here as well but better safe than sorry. After this you can save the bundle and jump to installing and enabling your layout.

2. Editing the layout manually

Keyboard layout bundles are actually just directories with certain structure, so you can also edit them manually from command line. What do you need to do is to cd into the Your.bundle/Contents and edit Info.plist by adding KLInfo_<your-layout-name> dict. Here's an example of the Info.plist from the layout I'm using:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
        <key>CFBundleIdentifier</key>
        <string>com.apple.keyboardlayout.arkkudvorak</string>
        <key>CFBundleName</key>
        <string>ArkkuDvorak</string>
        <key>CFBundleVersion</key>
        <string>1.0</string>
        <key>KLInfo_ArkkuDvorak</key>
        <dict>
                <key>TISInputSourceID</key>
                <string>com.apple.keyboardlayout.arkkudvorak.arkkudvorak</string>
                <key>TISIntendedLanguage</key>
                <string>fi-FI</string>
        </dict>
</dict>
</plist>

The main thing here is to include your language and region abbreviations as string value for TISIntendedLanguage. I guess TISInputSourceID can be anything as long as it's prefixed by CFBundleIdentifier.

After you've set the language and region you can save and close the Info.plist file. You still need to edit the directory struture a bit though. cd into Your.bundle/Contents/Resources and rename the <something>.lproj into <language>_<REGION>.lproj, in my case fi_FI.lproj. After you've done that you're done with the changes.

3. Installing and enabling your layout

After correcting the language, region and localisation settings and saving the bundle move it to /Library/Keyboard Layouts/ if you didn't edit it directly from there. Restart your computer, re-add the layout from ‘System ‘Preferences’ → ‘Keyboard’ → ‘Input Sources’ and it should now work with all apps.

This did it for me, let me know if it worked for you.

Disclaimer: I'm not the author of the ArkkuDvorak bundle, I just use it.

  • Another ArkkuDvorak user here, yay! I tried this, but it didn't solve the problem for me. :| – Miikka Oct 20 '17 at 8:02
  • @Miikka hmm, that's weird. Did you try editing the bundle manually or with Ukelele? I actually created a new bundle with Ukelele using the "New from current input source" and installed that, so it might be that editing the current layout doesn't work - did you try to remove the input method and re-add it after editing? I can also share you the bundle I made so you can see if it works on your machine :) – Spike_B Oct 20 '17 at 11:37
  • 1
    I tried editing the bundle with Ukelele. Moving the layout ~/Library/Keyboard Layouts from /Library/Keyboard Layouts did the trick. Somehow I ended up with multiple copies of the layout in the input settings, but everything works, so I guess it's fine. – Miikka Oct 27 '17 at 8:54
  • Hi, the second paragraph under item 1. seems mysterious to me. I could not find 'localizations' anywhere. How does this go? – Kofi Nov 28 '17 at 22:49
3

Not a new answer but a comment (need 50 rep points!) to issue raised by @Miikka.

Make sure to disable "Automatically switch to a document's input source". When you do that, my input source selection stayed with the intended one.

  • thank you but where do you disable that? I cannot find that setting in the Keyboard settings. – Matthieu Napoli Oct 21 '17 at 14:55
  • System Preferences -> Keyboard -> Input Sources – HanSooloo Oct 21 '17 at 19:17
  • I never had that enabled anyway. – Miikka Oct 27 '17 at 8:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .