You can use Karabiner to swap the keys using the following private.xml.
<?xml version="1.0"?> <root> <item> <name>Swap Keys</name> <identifier>private.swapkeys</identifier> <autogen>__KeyToKey__ KeyCode::one, KeyCode::two</autogen> <autogen>__KeyToKey__ KeyCode::two, KeyCode::one</autogen> </item> </root>
You’ll need to find the KeyCode for the keys you want to swap as I don’t have a German keyboard to check. You can use EventViewer accessible from Karabiner → Misc to find the KeyCodes. Replace
one with one KeyCode and
two with the other KeyCode in the above private.xml.
I just had this happen to me, and it’s a bug.
To fix it, I deleted
/Library/Preferences/com.apple.keyboardtype.plist and after a reboot, the keyboard assistent popped up. I pressed the key like it says and selected ISO (European) and everything is back to normal.
The problem with fixing this with Ukelele is that it will swap the keys the other way around on your internal keyboard.
You can use Ukelele to change the keyboard layout so the meaning of those keys are swapped:
Note the program is called “Ukelele”, not “Ukulele”.