🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.dec
Article #2657

Re: Help: signal(SIGUSR1,myhandle);

#2657
From: Andrew T Duchowski
Date: Fri, 02 Oct 1992 03:28
35 lines
2048 bytes
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  _/  _/  _/  _/ _/   _/  _/   _/       _/ _/ _/ _/   _/
Technical Details
Message-ID: <1992Oct2.032828.21065@tamsun.tamu.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!tamsun.tamu.edu!andrewd
References: <1992Oct1.192031.10915@tamsun.tamu.edu>

Show Full Headers
Complete Article Headers
Newsgroups: comp.sys.dec
Path: arc1-ca.pugleaf.net!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
Lines: 35