Hi David,
It's hard to remember which games do it right, usually the first time you launch a game, you either rebind the controls, or are pleasantly surprised they already work as expected, and then you forget about it.
Also, for some big games, you can't know for sure if they use scan codes or if they change the default bindings based on localization; for example, I know that when you set Sniper Elite 4 in Simplified Chinese, its controls menu will display key names in Chinese, even when the same Windows machine would still return English names.
I happen to know that Mad Tracks ( https://store.steampowered.com/app/1202970/Mad_Tracks/ ) does it how I expect (because I was tasked by my company to make a Steam update for it a few years ago; and it's not something I added, it was already correct back in 2006! Probably because it's a French game and we have to care about this stuff.): I launch the game without any options saved, first with my original keyboard layout, it displays "ZQSD" for Player 1 controls, I leave the game, switch my keyboard layout (with Alt+Shift), relaunch the game, go back to the Controls menu, it shows "WASD" for Player 1 controls.
Actually, the fact that it uses Windows' driver's key localization was an issue for us (for one Chinese publisher, we had to never display any non-Chinese text, and we were not sure how the controls menu would behave on Chinese users' machines, so... we just removed the menu. It's mostly a controller game though.)
Anyway that's closed source so you can only test the behaviour.
I also know that in Godot, the Controls in the Project Settings suggest 3 modes: key codes, "physical key codes" (which I assume are scan codes under the hood on Windows), and the actual key's letter:
I don't know how games manage to display the key names though.
Hope this helps, and that I didn't bury the useful information too deep under my life stories.