[comp.windows.x] xterm and ioctl question

tbricker@rsch.WISC.EDU (Thomas J. A. Bricker) (03/06/87)

There is an ioctl call that simulates terminal input which looks like:

	ioctl( d, TIOCSTI, &ch ) 

where d is an open descriptor, and ch is the character to stuff into the 
terminal as if it were typed at the keyboard.  The X package seems to "know"
how to focus keyboard input to xterm windows based on the location of the 
mouse cursor.  My question is:

  What tty name can be used to specify that the character should go the the
  xterm window in which the mouse cursor is located?  /dev/ttyp? and /dev/ttyv0
  obviously focus the input to a specific window regardless of the mouse cursor
  location.

swick@ATHENA.MIT.EDU (Ralph R. Swick) (03/06/87)

>  What tty name can be used to specify that [a simulated input] character
>  should go the the
>  xterm window in which the mouse cursor is located?  /dev/ttyp? and /dev/ttyv0
>  obviously focus the input to a specific window regardless of the mouse cursor
>  location.

Simulating keyboard input for windows becomes trivial in version 11 and can
be done in an os-independent fashion (i.e. no ioctl()'s).  'Till then,
you'll have to kludge something using the fact that xterm stores it's window
id in the environment.  The shell thus has sufficient information to relate
window id and pty, which it can store somewhere for you to find in your
application.

-rrs