commit | 297faf71d0890e19bdcc39097cb1e8ed93db07fb | [log] [tgz] |
---|---|---|
author | Fabio Baltieri <fabiobaltieri@google.com> | Sat Jan 20 00:02:26 2024 +0000 |
committer | Carles CufĂ <carles.cufi@nordicsemi.no> | Wed Jan 24 10:44:40 2024 +0100 |
tree | a8f76d0f376a1390853a778a994021f958da7342 | |
parent | c51a18f85189fd3b3ad66c63b9717d7d817590df [diff] |
input: add two input to hid code translation functions Add a pair of functions to translate from input events to hid codes, mapping most of the current hid codes defined in zephyr/usb/class/hid.h. Use a sparse table for the mapping, which takes advantage of the fact that code 0 is reserved. Inspired by the linux equivalent hid to input map: https://elixir.bootlin.com/linux/latest/source/drivers/hid/hid-input.c#L27 Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>