Tcl/Expect "send" to GL app window

Tcl/Expect "send" to GL app window

Post by mark_h.. » Fri, 10 Dec 2004 04:37:54



08-DEC-2004

I need to send regularly timed keystrokes to an app that opens a
graphic window.  The keyboard interaction is handled by the app via
glutKeyboardFunc (the vendor sent me the relevant source code
fragment)..  I'm not familiar with this, and the vendor was not
familiar with the details of expect.  On my end, Expect is loading the
app fine from terminal, and getting its output back on the
(controlling) terminal, so my "expects" are working, but the keystroke
sequences I'm "sending" in reply have no effect on the app.

Is communicating via expect through the GL function doable?
I'm thankful for any guidance;

cheers,
mark

 
 
 

Tcl/Expect "send" to GL app window

Post by Kenny McCorma » Fri, 10 Dec 2004 09:35:11




>08-DEC-2004

>I need to send regularly timed keystrokes to an app that opens a
>graphic window.  The keyboard interaction is handled by the app via
>glutKeyboardFunc (the vendor sent me the relevant source code
>fragment)..  I'm not familiar with this, and the vendor was not
>familiar with the details of expect.  On my end, Expect is loading the
>app fine from terminal, and getting its output back on the
>(controlling) terminal, so my "expects" are working, but the keystroke
>sequences I'm "sending" in reply have no effect on the app.

>Is communicating via expect through the GL function doable?
>I'm thankful for any guidance;

>cheers,
>mark

Well, as I think you've discovered, Expect only works with character mode
apps.  But it was good for you to discover this on your own.

You probably need a tool that can automate X itself.  This is an area that
I've always been interested in, but haven't ever gotten around to doing
anything with (never enough need to overcome inertia).  There is a tool
called "xlab" that seems to be right for this.  I have a downloaded version
of the TGZ file from 1999 (!), that is version 0.8.3, and that, amazingly,
seems to be the current version.

You can start by looking at: http://www.ibiblio.org/pub/linux/INDEX.whole.gz
and searching for "xlab".

 
 
 

Tcl/Expect "send" to GL app window

Post by mark_h.. » Fri, 10 Dec 2004 22:47:15





> >08-DEC-2004

> >I need to send regularly timed keystrokes to an app that opens a
> >graphic window.  The keyboard interaction is handled by the app via
> >glutKeyboardFunc (the vendor sent me the relevant source code
> >fragment)..  I'm not familiar with this, and the vendor was not
> >familiar with the details of expect.  On my end, Expect is loading
the
> >app fine from terminal, and getting its output back on the
> >(controlling) terminal, so my "expects" are working, but the
keystroke
> >sequences I'm "sending" in reply have no effect on the app.

> >Is communicating via expect through the GL function doable?
> >I'm thankful for any guidance;

> >cheers,
> >mark

> Well, as I think you've discovered, Expect only works with character
mode
> apps.  But it was good for you to discover this on your own.

09-DEC-2004

Yeah; I feel like Columbus...

It's tough to shake the bliss, until one's ignorance stands up and
bites...

Thanks for the illumination;

cheers,
mark

 
 
 

Tcl/Expect "send" to GL app window

Post by Kenny McCorma » Sat, 11 Dec 2004 04:39:27







>> >08-DEC-2004

>> >I need to send regularly timed keystrokes to an app that opens a
>> >graphic window.  The keyboard interaction is handled by the app via
>> >glutKeyboardFunc (the vendor sent me the relevant source code
>> >fragment)..  I'm not familiar with this, and the vendor was not
>> >familiar with the details of expect.  On my end, Expect is loading
>the
>> >app fine from terminal, and getting its output back on the
>> >(controlling) terminal, so my "expects" are working, but the
>keystroke
>> >sequences I'm "sending" in reply have no effect on the app.

>> >Is communicating via expect through the GL function doable?
>> >I'm thankful for any guidance;

>> >cheers,
>> >mark

>> Well, as I think you've discovered, Expect only works with character
>mode
>> apps.  But it was good for you to discover this on your own.

>09-DEC-2004

>Yeah; I feel like Columbus...

>It's tough to shake the bliss, until one's ignorance stands up and
>bites...

>Thanks for the illumination;

FWIW, I looked at "xlab" last night - compiled easily - and it seems to
work.  It is a little unpolished (clear that the author had a lot more to
do and never got around to finishing it - note that his web page is 404
now, so for all we know, he may be dead), but it does work.

I was able to automated an xv (picture viewer) session with it.  Note that
xlab is strictly "record-and-playback" - it is not a programming language
like Expect is.

I'd be happy to hear about newer/better automation tools for X.