Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!think.com!zaphod.mps.ohio-state.edu!unix.cis.pitt.edu!dsinc!bagate!cbmvax!carolyn From: carolyn@cbmvax.commodore.com (Carolyn Scheppner - CATS) Newsgroups: comp.sys.amiga.programmer Subject: Re: Dumb windows from SAS/C programs on Workbench Message-ID: <21758@cbmvax.commodore.com> Date: 20 May 91 23:18:28 GMT References: <1991May14.164909.19186@NCoast.ORG> <1991May17.023000.1652@NCoast.ORG> Reply-To: carolyn@cbmvax.commodore.com (Carolyn Scheppner - CATS) Organization: Commodore, West Chester, PA Lines: 42 In article fjrei@kbsaar.UUCP (Franz-Josef Reichert) writes: >In article <1991May17.023000.1652@NCoast.ORG> davewt@NCoast.ORG (David Wright) writes: >> So basically what I want is something that will evaluate down to a >>logical true or false if the user has pressed CTRL-C (or some other >>control character the operator has decided to allow). Under Draco you could >>do this very simply by &'ing bits with SIGBRKF_C, but this same method, >>although it compiles fine, appears to do nothing under SAS/C. >> Any ideas why? > >Use chkabort() (P. L25) to figure out whether the user hits ^-C. Or have a >direct look at the task's signal bits: > >#include >if(SetSignal(0L,0L) & SIGBREAKF_CTRL_C) /* => ^-C pressed */ If you want to take care of CTRL-C's yourself (almost a REQUIREMENT if you are allocating., opening, or locking anything other than standard C files) then turn off Lattice's CTRL-C handling totally. Here's what we use: #ifdef LATTICE int CXBRK(void) { return(0); } /* Disable Lattice CTRL/C handling */ int chkabort(void) { return(0); } /* really */ #endif Then code like the SetSignal() check shown above will work. Note however than a CTRL-C hit on an Intuition window that YOU opened will NOT cause SIGBREAKF_CTRL_C to get set in your process. So in ADDITION, you must process either VANILLAKEY or RAWKEY events (I use VANILLAKEY - CTRL-C is msg->Code 0x03) -- ========================================================================== Carolyn Scheppner -- Tech. Mgr. CATS - Commodore Amiga Technical Support PHONE 215-431-9180 {uunet,rutgers}!cbmvax!carolyn carolyn@commodore.com I am fully operational and all of my circuits are funcTiOnINg pperrf... ==========================================================================