![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi all Having a ball here doing proof-of-concept converting our old HP-UX 4GL to see if we can run it on Ubuntu using A.N. Other vendor's 4GL compiler ... The final thing I need to do to get code running properly... Currently (on HP-UX/Informix i4gl) we link some C into all our 4ge's to do various things and most of it has come across OK now *BUT* we have a vital C function that calls internal 4GL function "_efrgetkey"; this returns the integer value of a single keystroke (without the need for a CR) and we use it for navigating around screen text and other stuff in many programs. As well as all the standard keys we also need it to recognise the UP,DOWN,LEFT,RIGHT arrows, all the F keys, ALT-key combinations and so on... _efrgetkey is defined in ${INFORMIXDIR}/incl/tools/lib4io.a, where we have SHLIB_PATH pointed at. Trouble is, without the Informix 4gl tools, we don't obviously have access to this function (although nm of $INFORMIXDIR/bin shows it as defined in 'onmonitor' which is interesting)... The c code is basically as follows: /* Specify the Informix getkey function */ short _efrgetkey (); /* Get a single keystroke and return the integer value */ get_a_key(n) retint(_efrgetkey()) ; return 1 ; } fgl_getkey() won't do because it requires a <CR>. fgl_lastkey() doesn't work properly outside a form environment. PROMPT "" FOR CHAR lv_key doesn't recognise the arrows and alt keys and so on. Opening a 1X1 form and doing fgl_lastkey would be pretty ugly... Is there any other way anyone can think of? Ta _______________________________________________ Informix-list mailing list Informix-list (AT) iiug (DOT) org http://www.iiug.org/mailman/listinfo/informix-list |
#3
| |||
| |||
|
#4
| |||
| |||
|
#5
| |||
| |||
|
|
Oh hang on - I checked the hex values for the returns, and they all have the same last 16 bits so I redefined "ret" as a "short int" and we're getting somewhere now! _______________________________________________ Informix-list mailing list Informix-list (AT) iiug (DOT) org http://www.iiug.org/mailman/listinfo/informix-list |
#6
| |||
| |||
|
|
Hmm weird - having compiled that in and trying it, each time I restart a program the value returned is different... e.g. call getkey() returning lv_keyval ...and hitting "1" returns 7389745 one time, 12071474 the next, 1417777 the next and so on (but while the program is running, calling it repeatedly in a loop returns the same value every time). Is this some kind of initialization issue? I need to be able to use the returned integer value to determine the keystroke name. _______________________________________________ Informix-list mailing list Informix-list (AT) iiug (DOT) org http://www.iiug.org/mailman/listinfo/informix-list |
![]() |
| Thread Tools | |
| Display Modes | |
| |