Search code examples
unicodearduinokeyboardusbhid

How can I send accented characters and unicode in a USB HID report


I'm building a Bluetooth HID keyboard app on android and I'm stuck on the best way to send accented characters (à,è,é,...) and Unicode in my keyboard report.

I already have a working report map/descriptor. In the Usage Page there is no usage id for à but this arduino project seems to be able to send it in a way I can't figure out why it works. The ASCII map has a mapped to 0x14, but in the HID spec it should be 0x04.

So,

  1. Can someone explain me why sending 0x14 instead of 0x04 for 'a' works in the linked project?

  2. Is there a better way than simulating OS specific shortcuts for ALT Codes to obtain unicode characters?


Solution

  • As said by @aja, keyboard layouts are a nightmare.

    In order to send accented characters you have to send a keyboard shortcut. A key whose you know the code + a modifier. So this depends of each keyboard layout.

    For Unicode characters (another nightmare), what I have done is OS dependent, for example for windows, I mimed Alt Codes.