4 ms·
I wonder if USB HID compliant keyboard can report their key map (like QWERTY vs AZERTY)? If yes is there some OS taking advantage of it and how? In 2020 keyboa
by guerby 7y ago
I wonder if USB HID compliant keyboard can report their key map (like QWERTY vs AZERTY)? If yes is there some OS taking advantage of it and how?
In 2020 keyboard mapping is still a mess IMHO but may be I'm missing something :)
- JdeBP 7y agoYou're missing the fact that keyboards do not have key maps to report. The wire protocol and the device do not remap keys. It's all done in software on the host. * https://news.ycombinator.com/item?id=22207431 https://news.ycombinator.com/item?id=22207431
- guerby 7y agoThanks for the link! But that does not tell me why there is no standard way for a key map / layout to be transmitted by the hardware to the software. When the vendor makes the keyboard, he's the one choosing both the physical layout (A vs Q) and the USB microcontroller behaviour, so nothing prevents transmission of physical layout in some way to the software. In 2020 we do not have to tell the software what the screen resolution is, what the drive size is, but we still have to manually tell software AZERTY vs QWERTY ...
- JdeBP 7y agoYes, it does tell you. You keep asking for the transmission of something that does not exist. Learn this fact: there is no keyboard map on the keyboard. It's all in software on the host. Your keytops could be entirely blank and the operation of the keyboard would continue unaffected. You have to tell software what the keyboard map is, because software on the host is where the keyboard map is.
- amluto 7y agoYou aren’t answering the question. Sure, keyboards don’t currently report a mapping from button to label, and software doesn’t expect such a report. This doesn’t mean it has to be this way. A keyboard could tell the host “here is how I think I’m labeled”, and the host could make use of this information.
- jcrawfordor 7y agoI think the GP's idea is that a keyboard could report to the host how its keys are labeled so that the host could automatically select the correct keymap. This is indeed a very cool idea, but would certainly be a big effort to get implemented across all platforms. This would be somewhat similar the more boutique input devices which are configurable in hardware.
- JdeBP 7y agoThat is not the keyboard map. It's the engraving, which has zero effect on the keyboard, neither electrical nor mechanical. Keyboards can be re-labelled with little bits of paper and sticky tape or by swapping keytops, and that does nothing. There is no keyboard map here.
- magicalhippo 7y agoOne could imagine that the keytops were identifiable by the keyboard, so that it could actually detect that you swapped two keys and adjust what it sends to the host based on this.
- jcrawfordor 7y agoYeah, but for 99% of keyboards the legends were put there by the manufacturer who could also burn into the controller firmware what scheme of legends was used. This way the OS could autodetect whether the keyboard was e.g. QWERTY or AZERTY without having to do a user-involved discovery process like OS X or assuming keyboard matches locality like Windows.
- comex 7y agoOf course keyboards can be relabeled. But they usually aren't. If, hypothetically, keyboards came with knowledge of their original labeling, that would be meaningful information. If computers used it to set a default key layout, that would make for a better default if the goal is to make key behavior match the labeling. It would fail to match the labeling if you changed the labeling, but it would still be accurate much more often than the current default. That said, I question whether most people actually want key behavior to match the labeling. I think any touch typist would rather use their preferred layout regardless of labeling.