sc_raw(S) 6 January 1993 sc_raw(S) Name sc_raw - scancode Application Programming Interface (API) line-discipline and screen-switching functions Syntax cc . . . -lscs #include <scancode.h> int sc_raw (filedes) int filedes; int sc_unraw (filedes) int filedes; int sc_getinfo (filedes) int filedes; int sc_setinfo (filedes, value) int filedes; int value; int sc_copyscstate (srcfiledes, destfiledes) int srcfiledes; int destfiledes; char sc_getscreenswitch () int sc_setscreenswitch (mode) char mode; Description scraw, scunraw, scgetinfo, scsetinfo, and sccopyscstate perform line-discipline-level ioctl calls to get or set keyboard parameters (such as RAW/XLATE mode). scraw turns off scancode translation with a TCSETSC ioctl call and returns the original mode. scunraw turns on scancode translation with a TCSETSC ioctl call and returns the original mode. scgetinfo returns the scancode capability information it gets from the TCGETSC ioctl call. scsetinfo sets the scancode capability information from its input parameter, using the TCSETSC ioctl call. sccopyscstate copies the scancode state from one tty to another. The information it copies includes the keymap and the function key strings, which are stored in the kernel. If the application modifies the API's version of the keymap through a call to sc_setscreenswitch, sc_copyscstate does not copy the updated keymap information. sccopyscstate takes source and destination file descriptors as parame- ters. scgetscreenswitch and scsetscreenswitch get and set the combination(s) of function keys and mode keys (<Shift>, <Ctrl>, and <Alt>) that produce a screen switch. (The API provides screen-switching capability on the console only.) scgetscreenswitch returns the current mode key information. scsetscreenswitch determines which mode keys are required (in combina- tion with a function key) to switch screens. The input parameter, of type char, has the following bits defined: #define MODE_OFF 0x00 /* disable screen switching */ #define MODE_SHIFT 0x01 /* use shift to switch screens */ #define MODE_CTRL 0x02 /* use ctrl to switch screens */ #define MODE_ALT 0x04 /* use alt to switch screens */ #define MODE_SC 0x08 /* use shift, ctrl to switch screens */ #define MODE_SA 0x10 /* use shift, alt to switch screens */ #define MODE_CA 0x20 /* use ctrl, alt to switch screens */ #define MODE_SCA 0x40 /* use shift, ctrl, alt to switch screens */ By setting more than one bit, you can define more than one combination of mode keys to enable screen switching. Calling scsetscreenswitch with a value of zero disables screen switching. If the application does not set screen switch mode with a call to scsetscreenswitch, screen switching is determined by the application's original keyboard mapping. Diagnostics scraw and scunraw return the old scancode mode on success or -1 on failure. scgetinfo returns -1 if it cannot obtain the scancode capabil- ity information from the TCGETSC ioctl call. scsetinfo and sccopyscstate return 0 on success or -1 on failure. A return value of 0x80 for scgetscreenswitch indicates one of two things: either the application is not running on the console so screen switching is unavail- able, or the screen switch mode has not been set through the API, and the original screen switch entries in the keymap will be used. scsetscreenswitch returns -1 if the application is not running on the system console. If an API function returns failure status, the global variable sc_error might contain a number corresponding to an error condition listed in scancode.h. Notes scinit(S) and scmapinit(S) affect only one terminal at a time, and the application using the API affects only the terminal specified for scinit(S) or scmapinit(S). See also mapkey(M) Standards conformance scraw, scunraw, scgetinfo, scsetinfo, scsetscreenswitch, and scgetscreenswitch are extensions of AT&T System V provided by the Santa Cruz Operation.