looking for a way to stuff keystrokes

looking for a way to stuff keystrokes

Post by Eric Fagerbur » Wed, 24 Feb 1999 04:00:00



I can read from a virtual console by opening /dev/vcs? or /dev/vcsa? but
I can't figure out how to get keystrokes back in.  I'd love to be able
to do it in a user mode app running as root but if it's only possible
from kernel mode I'll take it at this point.

Thanks in advance for any help anyone can give me.

Eric Fagerburg

 
 
 

looking for a way to stuff keystrokes

Post by Willem Rein Oudshoo » Wed, 24 Feb 1999 04:00:00



>I can read from a virtual console by opening /dev/vcs? or /dev/vcsa? but
>I can't figure out how to get keystrokes back in.  I'd love to be able
>to do it in a user mode app running as root but if it's only possible
>from kernel mode I'll take it at this point.

I don't know why you should want this, but if you are determined
take a look at the

sti.c

program in the contrib directory of the

kbd-0.96*.tgz   (or something similar)

package.  

Wim Oudshoorn.
--


 
 
 

looking for a way to stuff keystrokes

Post by Eric Fagerbur » Fri, 26 Feb 1999 04:00:00



> take a look at the

> sti.c

> program in the contrib directory ...

Many thanks!  TIOCSTI is just what I was looking for.  About the only
thing I can't figure out how to get to work is Shift-PgUp and
Shift-PgDn.

Quote:> I don't know why you should want this,

This is for an application that allows a help desk person to view a
user's screen and even type commands while the user watches so they see
how a problem is resolved.

Thanks again,
Eric Fagerburg

 
 
 

looking for a way to stuff keystrokes

Post by Willem Rein Oudshoo » Sat, 27 Feb 1999 04:00:00


Quote:>Many thanks!  TIOCSTI is just what I was looking for.  About the only
>thing I can't figure out how to get to work is Shift-PgUp and
>Shift-PgDn.

If I recall correctly, TIOCSTI puts characters in the buffer of the
tty driver.  <Shift-PgUp> and the like are processed in the kernel at a
lower level.  

By the way, this is the second time in short while I have seen this
question.  The previous one was from someone who wanted write a program
for a disabled person.  

This makes me wonder if something like the following lines is a good
idea:

(1)  Create a device (/dev/rawkey?) or an extra ioctl call, which
        allows a user program to put bytes in the keyboard buffer.
(2)  This device/ioctl should be capable to put bytes in the buffer
        in any/oneof the following formats:

        - scancodes
        - keycodes
        - characters?

NOTE: (1) I haven't looked in while at the keyboard drivers and my
        knowledge is a bit rusty.  So it could all be nonsense.

I used linux/unix for 8 years, but have no experience in
operating system design etc.  So if anyone can tell me
if this is a bad idea go ahead.

If it is a good idea, maybe I can code it up sometime.  From
what I remember from the keyboard driver it doesn't seem that
difficult.

Wim Oudshoorn.

P.S.: I wonder how the USB people make the USB-keyboards work, well
        I will take a look at that sometime.

--

 
 
 

looking for a way to stuff keystrokes

Post by Steve Housem » Mon, 01 Mar 1999 04:00:00


FWIW kibitz might do what you want  ...  
Cheers,
Steve Houseman
currently  steve.houseman  at * net