On Fri, 13 Sep 2002, Brian McGrogan wrote:
> I've written a patch to tn5250 which adds a command line option,
> listen_port=nnnnn, which sets up a listening socket and allows you to
> send keys to the client remotely and also remotely control the client.

I'm not sure that I understand this.  What are you trying to accomplish,
exactly?   Why would you want to control a client remotely?  And if you
do, why not just telnet to the box, then send the keys as normal?

> I'm coming into the problem of figuring out which method to use will
> give me the best results.  I want the client to receive the keystrokes and
> the display to be updated as well.  Currently I'm using
> tn5250_display_do_key(), tn5250_display_update(),
> tn5250_display_interactive_addch ().

display_do_key is called by the emulator only when it has already read a
key from the keyboard or keyboard buffer, and ONLY when it knows that the
keyboard is allowed to be used (i.e. the system has unlocked it)

If you call it directly, then you need to also make CERTAIN that the
emulator is ready to accept input from the keyboard, since otherwise you
will inject key sequences at the wrong time, which can cause the AS/400 to
send back negative response codes, and the emulator to fail it's
assertions & crash.

A better way to do it is to change the terminal structure so that when
the emulator does a tn5250_terminal_getkey() it actually calls your own
function.   then that function can inject the appropriate keyboard codes,
and if necessary it can call the appropriate routine from the terminal
which it supplanted.

Doing it that way would be much safer.  You might have to create a buffer
to store keystrokes in your code, but that should be fairly basic

> I'm wondering what would be the best method of sending arbitrary key
> sequences and get them received correctly by the client.

Well, you've got my 2 cents. :)   I'm quite interested in what you're
trying to accomplish...?

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2021 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.