How do I direct input Unicode from a device? I want a "Machine interface device" than "Human interface device" (HID)
Asked Answered
G

1

8

For example, a USB barcode scanner can act as an HID keyboard to input characters. However, to input some foreign language other than English, e.g. Unicode, an HID keyboard could face difficulties. An HID keyboard mimics keyboard behaviors, which is subject to the chosen IME. Thus it has no unique, universal way to input certain Unicode characters.

Is there any defined "Machine Interface device" (MID) rather than HID? or How could I implement a USB device (or even other interfaces than USB) to input Unicode characters directly?

Gignac answered 13/5, 2016 at 7:18 Comment(0)
A
5

USB HID spec requires a keyboard layout, which means keys are sent to OS as keys and OS will translate the key to corresponding text. There is a "Unicode" layout in spec, but unfortunately:

  1. It uses UCS-2 encoding, so only plane 0 is supported;
  2. No widely-used OS implemented it.

So if you want to input some Unicode character, either define a custom keyboard layout in OS or write your own keyboard driver.

Referrence: https://github.com/kiibohd/KiiConf/issues/30

Abebi answered 19/7, 2016 at 10:14 Comment(4)
"No widely-used OS implemented it." - does Linux implement it?Commonplace
@Wacek Well, technically yes :)Abebi
"Technically" means that while it can be made to run, most actually existing application will go crazy? In practical terms: configure unicode keyboard separately and do not touch it until you are using something that actually will undesrtand it?Commonplace
@Wacek There is a "unicode" keyboard mapping for some languages in Linux, it has nothing to do with the actual unicode keyboard you expected. I've never used one keyboard with that mapping so I can't speak much on the user experience though.Abebi

© 2022 - 2024 — McMap. All rights reserved.