Hacker News new | ask | show | jobs
by fowlie 989 days ago
This is really stupid, old, legacy sh*t. If the USB HumanInoutDevice spec would support full unicode, keyboards could just send unicode directly and not rely on a not-known-by-the-keyboard-firmware language setting. The language settings would be implemented in the keyboard firmware, but with todays hardware shouldn't be a problem.

Edit: typos

3 comments

While I get the sentiment, implementing full Unicode support directly in the keyboard firmware would pose challenges. Consider mechanical keyboards where keys are swappable; you'd need a mechanism to inform the firmware of the current configuration, either through dip switches or a separate firmware tool. It's not as straightforward as it might seem.
That and also it wouldn't be able to express modifier key state, locks, etc, so it would have to coexist with the existing scancode-based input methods.
If you represent Unicode codepoints as unsigned 32-bit integers, you have the eleven high bits free for representing modifier keys. You can even represent changes of state for the modifier keys without a normal key press by sending the modifier bits with a NUL character.
Some standard for storing or otherwise representing the keyboard layout in hardware would be nice. Or at least some kind of identifier that says what kind of keyboard it is enough to build a table of the most common layouts.

Hell, while we're dreaming here, it'd be nice to have OS-level support for telling which devices keypresses come from so you can have a different layout on every connected keyboard or even turn extra keyboards into macro pads. (I've seen some setups like this, each with varying levels of jank.)

> Some standard for storing or otherwise representing the keyboard layout in hardware would be nice.

The keyboards by Sun Microsystems did do that, and their USB versions used the standard.

Right now any keyboard can use any layout transparently, minus the keycaps printing but fingers don't have eyes, so it doesn't really matter. Changing that is what would be really stupid.