Re: Trapping home and end keys in 2.1
Posted in 1996
Terry Boyland wrote: > In article <31FE7F90.4269@west.co.za>, Mark D Stock <marks@west.co.za> says: > >Terry Boyland wrote: > >> > >> We need to trap the END and HOME keys in an input form in 4GL so that > >> pressing these keys will do nothing at all instead of faffing the screen > >> up. I would of thought that I can trap the termcap entry EN and kh and > >> remap them to nothing but this does not seem to work > > > >As far as I know, Informix only sees the function key definitions in termcap. Those are > >k0, k1,...etc. Make sure none of these are defined with the values returned by END and > >HOME. > > > >Define 'faffing the screen up' a little. Do they simply corrupt the screen or are they > >actually running a number of options. > > > >Two severe hacks you might try are to rip the guts out of a dummy termcap entry, > >including the function key definitions and see if the problem goes away. Or add 'ON KEY' > >clauses for all function keys in your termcap and see if any match when END and HOME are > >pressed. > > > Mark > > Thank you for your comments but I think you missed the point a little Ditto. Sorry, I obviously didn't explain myself very well. > Neither of these keys are function keys and in fact have their own termcap > entries which I have shown in my mail as : EN for end and kh for home. As far as I know Informix only looks at the function key definitions in termcap. NOT anything like en, kh or whatever! So if any of the FUNCTION KEY DEFINITIONS in your termcap are the same as the values returned by your END and HOME keys then Informix will act upon the FUNCTION KEY DEFINITION. > EN is not defined but still returns a ~ and move some of the screen display to > the top of the screen. kh is defined and although within the C program which > is remapping these keys I have mapped it to various other things including > nothing it still returns the same as EN > To my knowledge there are no ON KEY calls to END or HOME No, what I meant was define all the FUNCTION KEYs defined in your termcap. Eg. ON KEY(F1) DISPLAY "F1 PRESSED" ON KEY(F2) DISPLAY "F2 PRESSED" :... ON KEY(F36) DISPLAY "F36 PRESSED" Now when you press END or HOME, if one of these messages pops up then you know which FUNCTION KEY DEFINITION applies to those keys. Then what you can do is leave those ON KEY clauses to handle events when the END and HOME keys are pressed. The 'event' could be to ignore it. Does this make sense, or am I talking more shit? Hope it helps anyway, -- Mark. +-------------------------------------------------------------------------+ |Mark D. Stock - The West Solutions Group http://www.west.co.za | | | |mailto:marks@west.co.za +------------------------------------------------+ |Tel: +27 11 803 2151 |If it doesn't work... force it! | |Fax: +27 11 803 2189 |If it breaks... it needed replacing anyway! | |Cell: +27 83 250 2325 |Well, that's how I code anyway! | +------------------------+------------------------------------------------+