You can use Karabiner Elements to swap the keys using Karabiner Eventviewer to find the keycodes of the keys:
Make sure the keyboard you experience the issue with is plugged in.
Install Karabiner Elements. Karabiner Eventviewer will be installed with it.
Open Karabiner Eventviewer. Without pressing any other keys, press the two keys you want to swap. The keys
key name‘key name’ is now shown in theName‘Name’ column. Remember these names or keep the Eventviwer open, to reference again.Note: If you're unsure if you have found the correct keys, click the ‘clear the result’ button and then press each of the two keys you want to swap again. Now their ‘key names’ should be at the top of the list like on the screenshot below.
Open Karabiner Elements and select the keyboard you have the issue with as your ‘Target device:’ in the dropdown.
Add two new items to the list and find each ‘key name’ from Karabiner Eventviewer in ‘From key’ column, for each of the new items. Now add the opposite key in the ‘To key’ column for each item (see screenshot for reference).
You have now swapped the keys!
Note: If you're unsure if you have found the correct keys, click the clear the result button and then press each of the two keys you want to swap again. Now their key names should be at the top of the list like on the screenshot below.
Open Karabiner Elements and select the keyboard you have the issue with as your ´Target device:´ in the dropdown.
Add two new items to the list and find each ´key name´ from Karabiner Eventviewer in ´From key´ column, for each of the new items. Now add the opposite key in the ´To key´ column for each item (see screenshot for reference).
- You have now swapped the keys!

