Re: using function key
Posted in 1998
jjdai07@my-dejanews.com wrote: > > Hi , > > I use informix-4gl Ver 4.10 on hp-ux , How can I mask the ctrl-c (interrupt) > key , How can I define F9 as accept key , and F7 as cancel key , F11 as exit > key , Bty , I use anzio terminal software , my terminal is wy50 , my terminfo > file is $INFORMIXDIR/etc/terminfo . Assuming that you have alrady properly defined the function keys in your termcap (I saw your other post), just do the following: OPTIONS ACCEPT KEY F9 DEFER INTERRUPTS -- You may want to include a DEFER QUIT also In your code you can define the F7 and F11 keys manually in any INPUT or INPUT ARRAY block as: INPUT ... ... ON KEY (F7) -- Need to do this since, while DEFINE INTERRUPT does -- not let ^C stop the program it does set int_flag -- this will make certain that it is clear. If you -- want ^C to work like an alias of F7 or F11 add an -- ON KEY (INTERRUPT) clause setting int_flag appropriately LET int_flag = 0 EXIT INPUT ON KEY (F11) LET int_flag = 1 EXIT INPUT ... END INPUT IF int_flag THEN EXIT PROGRAM ELSE -- Cleanup and cancel current operation -- Return to menu loop or to higher level as appropriate END IF