Since practically all keyboards are USB these days, one wonders why there isn't a standard to have the keyboard just report its layout and language and whatnot to the OS.
So? Monitor electronics (the panel) are the same, but the EDID chip in a monitor still describes not only things about the panel, but about the monitor itself, like its orientation or factory color-calibration, and in fact the make and model of the monitor. Why not have such a chip in other peripherals? They're not expensive. Many keyboards already have flash for firmware updates or remembering F13-F24 binds.
That is not an analogous situation. Keyboard layouts are entirely a software thing. Modern keyboards have zero knowledge of keyboard layouts. Their communications protocol does not deal in keyboard layouts. They effectively speak entirely in terms of ISO 9995-1 key positions and a big bitmap.
Entirely a software thing? Seems like ISO 9995 and its extensions don't specify anything about the top row of the keyboard (Escape, F1-F24, PrintScreen/ScrollLock/Pause, etc.)
I know that "media keys" (e.g. a Calculator button) aren't actually keys but another kind of USB HID device hanging out on the keyboard like a Touchpoint mouse; but F1-F12 keys really are keys, events sent from the same device that sends regular keysyms. Are they just random non-positional codes hiding out outside the ISO 9995 reserved range?
Yes, entirely. Function keys are not different to the others, and constitute row K. Nor are "media" keys, which are just more keys. Apart from one key, [Fn], they are all just bits in a giant bitmap, indexed by USB HID usage and (usually but not necessarily) partly encoded as an inverted array, on the wire. The keyboard layouts, in software on the host, define the meanings for all of them.
Exactly.
This is standard PC behavior (even older than IBM PC) for all keys other than a-z.
Control/shortcut keys are bound to the physical key, not to the regional layout characters bound to them. The displayed shortcut is often shown as the one for the US/UK layout.
As someone that often switches from US layout for programming to local layout for a few national characters, I'd consider any other behavior to be incorrect.
(People using QWERTZ/AZERTY might not agree/don't switch layouts that much. I'd be really annoyed if location for Ctrl+Z moved around... This is why standard key for Undo on PC was Alt+Backspace, which I still often use).
> Control/shortcut keys are bound to the physical key, not to the regional layout characters bound to them.
There's no reason that would have to change. If the OS was aware of both the key's physical location and what character it was supposed to represent it could easily keep the same physical mapping while simultaneously displaying the correct characters for that mapping.