LINUX.ORG.RU

Keyboard emulation (shell, QT, X)


0

0

Linux Gugus!

Have anybody ideas about how to emulate keyboard events? For example, if I send login name and password to some tty I can't login. echo -en "mylogin\nmypassword" > /dev/tty1 (I whould like to login on tty1). Strings are printed correctly but not interpreted. Is it absolutely necessary to patch keyboard driver and recompile kernel to emulate keyboard? Is there any backdoors in Linux (such as virtual devices, shared memory, ioctls) that allow to emulate keyboard events? The same question is about keyboard emulation in QT (that works on FrameBuffer) an X. I assume that they are reading keyboard events from ttys where they were run, correct?

anonymous

Используйте пакет expect.

Murr ★★
()

tty: ioctl TIOCSTI

X: use XTest extension, it allow to send fake events to be proccessed by X server. You will be able to send KeyPress, KeyRelease, ButtonPress or ButtonRelease events using it. To find out whether you X server have XTest extension or not execute next:

$ xdpyinfo | grep XTEST

if there will be output X server supports it. Also take a look at xtest.TXT or xtest.PS - documentation for XTest extension which ships in X distribution

lg ★★
()

Great thanks to all!!

anonymous
()
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.