29

After using the wireless keyboard that comes with the iMac, I have switched to a MS Ergo Natural 4000 one. Surprisingly I had to install extra software as OS X could not work out which keyboard I had.

After which I went into sys prefs and set the main input method to be "British - Microsoft" first and "Swiss German" second (what the wireless keyboard is), on the "input sources" tab:

enter image description here

However... OS X keeps resetting my input method back to Swiss German which is driving me bananas.

I have the flag thingy top right so I can see when this changes.

N.B. I have "input source options" set to "use the same one in all documents" which I am assuming means keep the language the same for anything running.

It also flips back on the login page.

Does anyone know how to fix this?

1
  • Have also just noticed that for some applications, it is not even possible to select "British - Microsoft" e.g. Preview, QuickTimeplayer. Other applications like firefox and itunes work fine (although they do still keep switching back to swiss german) Jan 22, 2010 at 9:31

5 Answers 5

27

If the system is switching language without you asking to do so, it means that the current input source somehow becomes unavailable. This can happen if you are using a custom input source (put under ~/Library/Keyboard Layouts) and then lock your screen. The lock screen is owned by the system and thus does not have access to your custom layouts, only the system-wide ones. The current source being unavailable, it will automatically revert to another one.

To resolve this issue, ensure that your custom keyboard layout is put under /Library and not /Users/You/Libary. After moving the file, remove the input source from the list, reboot and then put it back again.

6
  • Thanks for this! I had my layouts in ~/Library and my app-store-installed apps couldn't see them and I had no idea why. Nov 12, 2013 at 17:46
  • Thanks this worked great. This has been such a huge annoyance! It always happened when a Authorize prompt opened up and after log out.
    – jmagnusson
    Dec 31, 2014 at 11:03
  • This works, thank you very much for this! Put the .layout file to "/Library/Keyboard Layouts" and then do a full OS reboot. Feb 21, 2019 at 9:20
  • 1
    This doesn’t work as of 10.15, as soon as I open the AppStore, it switches back to default.
    – a.s.t.r.o
    Jul 21, 2020 at 19:21
  • 2
    This doesn't work for me either. My custom keyboard layout is in /Library, but the OS switches away from it whenever I lock the screen. Aug 25, 2021 at 15:39
12

One possibility that I had in a similar case is that you are hitting the keyboard shortcut to switch input sources.

In Snow Leopard preferences, the default to select the previous input source is Command-Space. In your screen capture of the Language & Text preferences you can see that this shortcut is active (the other shortcut, to select the next input source, is inactive in that screen capture):

Input source shortcut

It's a bit odd that Command-Space is used, as that is also used for Spotlight. But if a shortcut is assigned multiple times, then Snow Leopard would show a warning, which your screen capture does not show. So, Command-Space won't activate Spotlight on your Mac:

Input source shortcut with warning

From Apple support: Command-Space: Show or hide the Spotlight search field (if multiple languages are installed, may rotate through enabled script systems)

6
  • My 10.6 has a disabled (default) of Command-Space (rather than Option-Space) for "Select the previous input source". I don't know why it's that, because Command-Space has been Spotlight for ages. I also don't know what disabled it. But: maybe some installations still have that Command-Space shortcut assigned twice? That would show a warning in the keyboard preferences though.
    – Arjan
    Jan 24, 2010 at 13:07
  • When I switch to an app that does not support the "British - Microsoft" setting i.e. automatically assumes "Swiss German", it appears to switch it for ALL applications. I don't understand why not all applications support 'another' language and I also don't understand why this forces the other applications to pick up the change. Jan 29, 2010 at 9:09
  • It is a global setting for the keyboard and thus for all apps.
    – mmmmmm
    Feb 2, 2010 at 1:24
  • Sorry it is not - each app remembers what was used last - see mac.finerthingsin.com/2010/01/18/…
    – mmmmmm
    Feb 9, 2010 at 1:41
  • Actually it appears to have both. Single global setting and setting per app. The problem lies in the fact that once you set it to a language which is not supported by all apps, then it will switch to the other one. It sucks, seriously. Feb 14, 2010 at 19:26
1

In my case, I had a custom .keylayout created with Ukelele, manually copied over to /Library/Keyboard Layouts.

I had two input sources configured under Keyboard Settings. A built-in one (British) and my custom keyboard layout.

In some applications, I could switch between the two keyboard layouts freely. However, there were applications (Calendar, Safari) where the OS refused to switch to my custom layout. If I had the custom layout active, the layout would automatically change back to the British one as soon as I switched over to Calendar.

After a lot of head scratching, I downloaded a known good custom .keylayout from the internet. I compared this layout to mine and noticed a few differences.

This is what I had in my custom layout:

<keyboard group="126" id="-2" name="Custom Layout" maxout="3">

And this is what I changed it to (using the downloaded one as a reference):

<keyboard group="0" id="16003" name="Custom Layout" maxout="1">

I removed my custom layout under Keyboard Settings, logged out, logged back in, and added the custom layout back again.

Unsure if it was the group, the id, or the maxout value causing the problem, but I am glad to say the issue is gone now.

As a side note, what is interesting, is that I have been using this custom layout for a decade, and never experienced this issue. Now that I am using a new Mac (with macOS Monterey 12.4) is when I first come across this problem.

1
  • Thanks a lot! I have been struggling with my BÉPO keyboard layout for months, and your change seems to have solved it. Hurray! (As a side note, I confirm this issue appeared with the switch to Monterey)
    – kotchwane
    Jan 11 at 16:06
0

@Brunni's answer from 2013 helped me a lot with this, but it doesn't solve the problem completely in 2022 (see comments below that answer).

I had the same problem as @CharlesRezk and @a.s.t.r.o on MacOS 12.1 when I tried to install/copy a keyboard layout bundle created with Ukelele by doing Copy & Paste in the Finder. MacOS asks for my PW, and after providing it, it copies the files to /Library/Keyboard Layouts, but they maintain my user as owner rather then setting it to root. If the owner is not root, you get exactly the behaviour reported in the original question.

The solution is to use the Terminal and either copy the files as root or do sudo cp ..., which sets the permissions right. Specifically you can do:

$ sudo su -
$ cd /Library/Keyboard\ Layouts
$ cp -r /path/to/ukelele.bundle ./

Works like charm now... ;)

BTW, the "Install" feature in the Ukelele-UI (v3.5.4) does not work properly. So after creating your keyboard layout, copy the bundle manually to /Library/Keyboard\ Layouts.

Other than this, Ukelele was really useful to create the new layout bundle.

-4

The MS layout for the keyboard on OSX sucks

Use this layout instead http://liyang.hu/osx-british.xhtml

Seems to work

1
  • This does not actually answer your own question! Sep 18, 2021 at 19:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.