The keys are swapped because the active keyboard layout in Windows does not match the physical keyboard layout. Set Windows to use the correct layout for the keyboard.
- Open Start > Settings > Time & language > Region & language.
- Under Language, select the language that matches the keyboard (for example, English (United Kingdom)).
- Ensure the keyboard/input layout for that language matches the physical keyboard (for example, a UK layout such as United Kingdom Keyboard or United Kingdom Extended Keyboard). If a different layout is selected, change it to the correct one.
- Remove any extra keyboard layouts that do not match the physical keyboard so they are not selected accidentally.
- Test typing
?and_again; they should now match the printed keys.
If the problem persists even with the correct layout selected, check whether any key‑remapping software (such as utilities that change key functions) is installed and disable or reset its mappings.
References: