If you find that two specific keys have swapped places—common pairs include ~ and ±, or <> and #@, and so on. This is almost always caused by a mismatch between your keyboard's physical layout and your Mac's software layout.
Here are a few methods to resolve this issue and get your keyboard working correctly.
Solution 1: Select the Correct Language Layout on Your Mac
- Go to System Settings.
- Navigate to Keyboard.
- Click on "Input Sources".
- Click the "Edit..." or the "+" (Add) button.
- From the list, choose the corresponding language layout.
Ensure this new layout is selected. You may want to remove the incorrect layout to avoid future confusion.
Solution 2: Choose the Correct Physical Layout (ANSI or ISO)
- In the same Keyboard Layout settings, click "Change the layout of keyboard".
- Follow the instructions, which typically involve pressing a key next to the Shift key. This helps your Mac identify the physical layout.
When prompted, select the correct layout for your keyboard: ISO (common in Europe) or ANSI (common in the US).
Solution 3: Delete the Keyboard Layout Cache
- Unplug your keyboard.
- Open Finder.
- Press Shift + Command + G to open the "Go to Folder" window.
- Enter the following path and press Return:
/Library/Preferences/
In the folder that opens, find and move the following files to the Trash:
com.apple.keyboardtype.plist
com.apple.HIToolbox.plistRestart your Mac.
- Plug your keyboard in again.