Problem with arrow and function key interpretation.
Posted in 1992
> We have been having a problem with arrow and function key interpretation. > Can anyone shed some light on the problem? > We are running on an AT&T 3B2 with PC users coming in via telnet. > (The folks on the PC are using PROCOMM). > The application running on the 3B2 is an Informix application. The user > should be able to move from field to field by pressing an arrow key. > Intermittantly, the arrow key doesn't work, leaving characters like a [A > in the field. Also, we have had a problem with the function keys - F6 > cannot be used from remote locations. (F6 works fine for local terminals) > Evidently, the esc character needed for correct interpretation of the keys > is being separated. > Any thoughts on cause or a possible solution? First of all, my apologies if I am merely one of a ton of replies... It's related to how multi-char keystrokes (ie. func-keys) are handled in packages such as curses. There is a fundamental ambiguity with most keyboards in that the first key that the function-keys emit coincide with pre-existing valid keystroke (ie. the ESCAPE key). How the software works around the problem is by figuring out how much time elapses between the ESCAPE char and the next char. If 'very little' time elapses, it tries to see it as a func-key. If more than 'a little' time elapses, the software figures that the ESCAPE char is actually the 'real' one (not one in a func-key...). Ok, now for the meat. Many network protocols (esp. tcp and friends) are very liberal about exerting handshaking between nodes. Also, loads on the network may cause delays in what would seem to you and I 'wrong' places. For example: you press an arrow key this emits something like ^[OA on the network something causes the OA to get delayed what the receiving application 'sees' is: an ^[ character a OA pair result: the screen interface code thinks you pressed 3 differents instead of one. As for a solution: 1. Curses allow the programmer to turn off this timeout feature, effectively turning off the escape key on the keyboard. Since you are having the problem with an informix application, this is out of the question. 2. I've had good luck with setting up terminals so that they emit an 8-bit version of the escape sequences. If your terminal(s) supports this it's manual should describe how to do it... You'll need to change your termcap description. I don't know if telnet does b-bit or not. I know that you can tell rlogin to go into 8-bit via the '-8' option. Hope this helps/makes_sense. #include <std_disclaimer> "If it runs GNUemacs it's a computer, otherwise it's a peripheral." - me "I have two kitchen sinks: emacs and perl" - me .-----------------------------------------------------------------------------. | Kevin Johnson kjj@phx.mcd.mot.com | ...!asuvax!mcdphx!pondscum!kjj | | QIS System Administrator Motorola MCG |