home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
QBasic & Borland Pascal & C
/
Delphi5.iso
/
C
/
Samples
/
CSAPE32.ARJ
/
SOURCE
/
CSSRC
/
FNSPEC.C
< prev
next >
Wrap
C/C++ Source or Header
|
1990-08-28
|
2KB
|
73 lines
/*
fnspec.c
% special_key
C-scape 3.2
Copyright (c) 1986, 1987, 1988 by Oakland Group, Inc.
ALL RIGHTS RESERVED.
Revision History:
-----------------
11/19/88 jmd Added mouse stuff
6/07/89 jmd renamed mouse codes
2/03/89 jmd added reference to HELP_KEY
3/16/90 jmd added support for KEY_INVALID
3/28/90 jmd ansi-fied
8/27/90 jmd now uses ocountry struct for errmsg
*/
#include <stdio.h>
#include "cscape.h"
#include "scancode.h"
#include "helpdecl.h"
boolean special_key(sed_type sed, int scancode)
/*
effects: Handles Special Keys
returns: TRUE if intercepted a key, FALSE otherwise.
normally handles FN1 as help.
Intercepts mouse events
*/
{
switch (scancode) {
case KEY_INVALID:
/* The validation in fexit failed: tell the user */
tone();
sed_BorderPrompt(sed, ocountry.errmsg);
/* wait for a keystroke */
kb_CheckWait(-1);
sed_BorderPrompt(sed, sed_GetCurrFieldData(sed, 0));
break;
case MOU_HERE:
/* The mouse was clicked in our sed,
the mouse handler has already Jumped to the clicked field
so we can just ignore this code
*/
return(TRUE);
case MOU_THERE:
/* Another window has requested control via the mouse, quit this sed */
sed_SetBaton(sed, 0);
sed_ToggleExit(sed);
return(TRUE);
case HELP_KEY: /* special help key for certain non-Dos machines */
case FN1:
help_Show(sed_GetLabel(sed), sed_GetFieldNo(sed) + 1);
return(TRUE);
default:
break;
}
return(FALSE);
}