Write Text and command keys to a TTY on Linux

508 Views Asked by At

im working on a keyboard injection for a /dev/tty device.

The only thing i found out was using the TIOCSTI ioctl command to inject text into the buffer. As far as good, but i also need to submit the command i typed in. Is there a way to send command keys like strg, return, shift, etc to a /dev/tty?

Thanks in advance.

1

There are 1 best solutions below

0
On

Made some mistake in the past. You can send any ascii char via TIOCSTI, so sending an '\n' or ASCII 27 you simulate a press on Return.