problem with key's
Posted in 2000
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL, Platform-Specific Issues
Hi We are using INFORMIX-4GL 4.17 on SUN-SPARC Station running Solaris 2.5. Keys Insert,Delete,Home and End do not function properly in applications developed in this platform. How can we fix this problem? Does the problem relate to termcap file somehow? It should be noted that we use Farsi language in the application and so there is a Farsi solution software between application program and 4GL. Our contractor, who provided this Farsi solution, tells that the above keys are used by Informix 4GL. Thanks in advance. -- Armin
Armin Ghaderi-Nia wrote: > We are using INFORMIX-4GL 4.17 on SUN-SPARC Station running Solaris 2.5. > Keys Insert,Delete,Home and End do not function properly in applications > developed in this platform. How can we fix this problem? Does the problem > relate to termcap file somehow? It should be noted that we use Farsi language > in the application and so there is a Farsi solution software between > application program and 4GL. Our contractor, who provided this Farsi solution, > tells that the above keys are used by Informix 4GL. It is all down to the termcap file. You have to decide which of the logical keys that Informix uses should be mapped to the Insert, Delete, Home and End keys (for example, the ACCEPT key, or the HELP key, page down key). Then you have to find out which logical keys the application uses for those operations (for example, the application might say OPTIONS HELP KEY F1). Finally, you have to know which character sequences the Insert key actually generates: od -c plus some typing should help here. For example, the Insert key on my Sparc generates ESC [ 2 ~ (four characters), and the Delete key generated \\177; the home key and end key were intercepted before it got to 'od -c' so I'm not sure what they generated. Finally, you have to hook things up so that when you press the Insert key, the correct action takes place. Suppose you wanted the Insert key to pop up help (unlikely, but it will do to demonstrate 90% of the problems you face): The application expects F1 to trigger help, so you need to tell termcap that when the Insert key is pressed, it is the same as if you hit F1. Informix thinks that the code k0 is for F1 (every other curses application thinks that is F10). You set the termcap entry so that k0=\\E[2~ and then, when you hit Insert, up pops your help. If you don't know what all the key mappings are, life will be difficult. If you have specialized functions in the I4GL code, such as ON KEY (CONTROL-W, F13) clauses, then you need to think very hard about what you're up to. Add the Farsi software into this mix and life could get very difficult indeed. I assume it passes through escape sequences like ESC [ 2 ~ so that all will be OK; if it doesn't, then you need to work out what it does do to those sequences and factor that into the equation above. -- Yours, Jonathan Leffler (Jonathan.Leffler@Informix.com) #include <disclaimer.h> Guardian of DBD::Informix v1.00.PC1 -- http://www.perl.com/CPAN "I don't suffer from insanity; I enjoy every minute of it!"