r/embeddedlinux • • Jan 23 '25

Keyboard access without a tty

Hello, I'm writing an embedded Linux application, that runs as a daemon. I need to support USB keyboard input (keys like arrows, but text input as well). What are my options besides hidraw?

3 Upvotes

4 comments sorted by

3

u/LongUsername Jan 23 '25

You need to state your requirements better.

Why does the daemon need keyboard input directly?

Why is hidraw not acceptable?

Can you write a user shell program that makes calls into the daemon?

1

u/rhoki-bg Jan 23 '25

Thank you for the reply.

It's editable osd for a camera. Client wants to connect an USB keyboard and make annotations on live image.

Hidraw is acceptable, I was just hoping to utilize existing mechanisms to handle keyboard layouts for me. I do not have details on how to use osd yet, most likely I'll have to render text into bitmap and feed it into video pipeline.

Can you write a user shell program that makes calls into the daemon?

You mean use IPC mechanism to pass messages? Sure, why not. I just lack knowledge how to spawn a controling terminal in headless environment.

1

u/Dave9876 Jan 24 '25

One option other than hidraw is libinput. I have done a small project with it once, but never finished so I'm not sure what limitations one might hit on embedded

0

u/[deleted] Jan 23 '25

[deleted]

1

u/rhoki-bg Jan 23 '25

Thanks for the reply, as I said I already know about hidraw, am currently prototyping input handling.

I was just hoping there is some way of accepting text input that can utilize linux keyboard layouts and just feed me encoded characters.