From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,6218482e9951d170,start X-Google-Attributes: gid1164f8,public X-Google-ArrivalTime: 1992-10-02 08:41:06 PST Newsgroups: comp.sys.dec Path: sparky!uunet!cs.utexas.edu!tamsun.tamu.edu!andrewd From: andrewd@tamsun.tamu.edu (Andrew T Duchowski) Subject: Re: Help: signal(SIGUSR1,myhandle); Message-ID: <1992Oct2.032828.21065@tamsun.tamu.edu> Keywords: interrupt, user-defined Organization: Texas A&M University, College Station References: <1992Oct1.192031.10915@tamsun.tamu.edu> Date: Fri, 2 Oct 1992 03:28:28 GMT Previously I wrote: >[..] >I also see how I can use ^\ (SIGQUIT) and ^Z (SIGTSTP) signals >[along with ^C (SIGINT)]. But I want to use the ^[ (ESC key) >signal coming from the keyboard. How can I do this? I know >that there are SIGUSR1 and SIGUSR2 signals, but how do you >define these signals to correspond to the ESC key? > Essentially, I need an *interrupt* routine that gets invoked on the ESC key. It seems to me that signal() is the way to go, but I don't know how I can define signals SIGUSR1 and SIGUSR2. I've had a response suggesting fcntl(), but that seems like a routine to capture (redirect) the entire keyboard, something that I don't want to do - I just want the program to be sensitive to 1 key (signal generated by ESC). And, btw, this is not a homework assignment.... I'm a graduate student working as a research assistant, and I don't wish to re-invent the wheel -- it seems like this ought to be easily accomplished, just that the signal man page is a little vague on how to define SIGUSR1 and SIGUSR2. Right now I'm using signal(SIGINT,handler), but this makes it very difficult to debug the code since SIGINT breaks the debugger. Thanks in advance for suggestions (and thanks for the fcntl suggestion). Please email and post optionally. -Andrew -- _/ _/ Andrew Duchowski _/_/ _/_/_/ _/_/_/ _/_/_/ _/_/_/ _/ _/ _/_/_/ Texas A&M University _/_/ _/ _/ _/ _/ _/ _/_/_/_/ _/ _/ _/ _/ _/ andrewd@cs.tamu.edu _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/