Re: How can I assign the interrupt action to a function key in 4GL?
Posted in 1992
>From: uunet!felix.Sublink.Org!marco (Marco Penengo) >Message-Id: <843@felix.Sublink.Org> >Subject: How can I assign the interrupt action to a function key in 4GL? >Date: 1 Jul 92 11:26:48 GMT >X-Informix-List-Id: <news.1492> > >As the title states, I would like to bind the Control-C interrupt >action to function key F5 and the Accept action to function key F9. > >I have managed to bind the Accept option to Control-B but doing >OPTIONS ACCEPT KEY F9 does not work; I just get a beep. As someone else's answer indicated, the problem with F9 probably relates to your termcap/terminfo terminal description. You will run into problems setting interrupt to F5 because interrupts are not handled by termcap but via stty, and you can only set the interrupt character to a single character, not to a sequence of characters. So, unless you can program your terminal so that the key labelled F5 sends the character control-C (or some other suitable control character), you are unlikely to be able to get F5 to send an interrupt. I had to deal with a variant of this only last week -- the customer wanted the ESCAPE key to be the interrupt character. Uggghhhhh! Well, it can be done: stty intr '^[' sets the interrupt character to ESCAPE. But it breaks all your 7-bit terminals which send things like ^[[ as a control sequence introducer (CSI) before the function key codes. 8-bit terminals might send 0x91 instead (if my memory serves me right), and you might then be OK, but I wouldn't want to bet on it. The customer was eventually persuaded that their request was not sensible! Yours sincerely, Jonathan Leffler (johnl@obelix.informix.com) #include <disclaimer.h>