What to do when macOS keyboard writes wrong special characters

2 min read

327 words

At the moment I always have an external Keyboard connected to my MacBooks over a USB-C Dongle when I am working. From time to time the keyboard layout switches after waking the laptop up again after a couple of minutes. For example, it starts to write ^ where normally the < is. This is my current solution to fix this issue.

Check Keyboard settings

First of all, check the keyboard settings in Settings -> Keyboard -> Input Sources if anything changed. Sometimes this can change since macOS has the default shortcut of ^(control) + space set. I already had the scenario that I miss pressed this shortcut and changed it to a different input source.

Delete the Keyboard preferences file

Since this is most often not the case and my input source is on DE which is my default I try to reset the keyboard settings. When connecting a keyboard for the first time macOS asks which key is next to the left shift key on the connected keyboard. To toggle this dialogue again one has to delete a plist file. This is where macOS stores its’ settings.

The keyboardtype.plist of the current user can be found in ~/Library/Preferences/com.apple.keyboardtype.plist so removing that is possible with the following command

rm ~/Library/Preferences/com.apple.keyboardtype.plist

If this file is not available in the home Library there should be one in the root /Library of macOS. This can be found in /Library/Preferences/com.apple.keyboardtype.plist and can be removed with the following:

sudo rm /Library/Preferences/com.apple.keyboardtype.plist

After removing the file(s) remove the keyboard from the macOS device and restart it. After restarting the computer log in to the desired user and plug the keyboard back in. macOS should then show you the wanted keyboard setup screen again. After setting up the keyboard again the special keys should work as expected again.

Thank you for reading,
Niklas