Apple seems to think it knows best how a keyboard is supposed to work. Which is especially infuriating for german keyboard layouts.
The standard german keyboard layout makes heavy use of AltGr, which straight up doesn't exist on a MacBook keyboard. Instead, there are two command keys, which cannot be addressed individually through system settings.
I cannot tell you how funny it is when you try to type your email address in the setup guide and reach for the trusty AltGr + q key combination to type @, only for a pop-up to carefully ask you to please not kill the process of the setup program...
The reason, of course, is that cmd+q is the key combination to forcefully quit the process of the program currently in focus.
There are other oddities, like ~, and |. These aren't the worst, because they can still comfortably be typed by creating your own custom keyboard layout.
This is not the case for all AltGr dependent characters though. Annoyingly those are quite important characters like { [ ] } and \. It is possible to create a keyboard layout that simply requires pressing the option key instead of the missing AltGr, but the offset of that key makes typing extremely awkward, uncomfortable and borderline impossible if you have smaller hands.
Here is a trick, though: MacOS allows you to add a launch agent that hard-remaps keys! And in contrast to the system settings, you can do this for the right command key only! This means we can cheat our way towards a pseudo-AltGr key by making the right command key behave like another option key.
Just create a file under ~/Library/LaunchAgents/com.local.KeyRemapping.plist with the following content to remap the right command key to behave like an option key:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.local.KeyRemapping</string>
<key>ProgramArguments</key>
<array>
<string>/usr/bin/hidutil</string>
<string>property</string>
<string>--set</string>
<string>{"UserKeyMapping":[
{
"HIDKeyboardModifierMappingSrc": 0x7000000E7,
"HIDKeyboardModifierMappingDst": 0x7000000E6
}
]}</string>
</array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
Combine this with a cursed custom german keyboard layout that doesn't have annoying deadkeys for ^, ~, etc., and you can suddenly use a MacBook for development, even if you have a german keyboard layout.
If anyone is interested in what that might look like, i've just uploaded that to a dedicated github repository: