2005-05-02 16:33:12

by P.Manohar

[permalink] [raw]
Subject: stuffing characters to keyboard buffer.


hai,
I want to stuff the characters received on a serial line into the
keyboard buffer, so that they will be send to applications as if they are
coming from keyboard irrespective of console or x-windows mode.

For this purpose, I planned to use ioctls. Can anybody tell how to
send an ioctl to keyboard driver?

AFAIK, tty_flip_buffer is the buffer from which both console and
x-windows will take input. If we insert into this buffer, I think the
purpose will be served. Now the question is how to send ioctl to this
buffer.
can you please give any suggestions on this?



Thanks&Regards,
P.Manohar,


2005-05-02 16:59:48

by Dmitry Torokhov

[permalink] [raw]
Subject: Re: stuffing characters to keyboard buffer.

Hi,

On Monday 02 May 2005 11:29, P.Manohar wrote:
>
> hai,
> I want to stuff the characters received on a serial line into the
> keyboard buffer, so that they will be send to applications as if they are
> coming from keyboard irrespective of console or x-windows mode.
>
> For this purpose, I planned to use ioctls. Can anybody tell how to
> send an ioctl to keyboard driver?
>

If you are working with 2.6 you'd need to create an input device, probably
working on top of serport driver, like sermouse does. You may also want to
take a look at uinput driver - it allows to create userspace-driven input
devices.

--
Dmitry

2005-05-04 08:46:41

by P.Manohar

[permalink] [raw]
Subject: Re: stuffing characters to keyboard buffer.


I am working in
2.4.20-8 kernel.
To fill the keyboard buffer with characters from user space, I used
TIOCSTI
ioctls. Is there a similar method so I can send raw keyboard codes into
the scancode buffer?
ioctls("/dev/tty0",TIOCSTI,&c);
it worked in Console.

ioctls("/dev/tty7",TIOCSTI,&c);
is not working in x-windows. Here c is a character.

Can you guide me in this regard.

ThanksInAdvance,
P.Manohar,