System Preferences => Change Keyboard Type… gives an UI that directs you to press a few keys that help detect your keyboard layout. That has worked fine for me (N=1) when adding a Dell keyboard to a Mac Mini.
I think that UI was added for the Mac Mini, as it was the first Mac sold without keyboard ("bring your own keyboard and mouse")
I think that UI was added for the Mac Mini, as it was the first Mac sold without keyboard ("bring your own keyboard and mouse")