Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 459
Robin Hsu Avatar asked May 13 '16 07:05

Robin Hsu


1 Answers

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

like image 50
Jamesits Avatar answered Nov 08 '22 22:11

Jamesits