DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH
 

sc_raw(S)


sc_raw -- scancode Application Programming Interface (API) line-discipline and screen-switching functions

Syntax

cc . . . -lsc_s

#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

sc_raw- turns off scancode translation and returns the original mode

sc_unraw- turns on scancode translation and returns the original mode

sc_getinfo- returns scancode information

sc_setinfo- sets scancode information from input parameter

sc_copyscstate- copies the scancode state from one tty to another

sc_getscreenswitch- gets scancode screen switch keys

sc_setscreenswitch- sets scancode screen switch keys

sc_raw, sc_unraw, sc_getinfo, sc_setinfo, and sc_copyscstate perform line-discipline-level ioctl calls to get or set keyboard parameters (such as RAW/XLATE mode).

sc_raw turns off scancode translation with a TCSETSC ioctl call and returns the original mode.

sc_unraw turns on scancode translation with a TCSETSC ioctl call and returns the original mode.

sc_getinfo returns the scancode capability information it gets from the TCGETSC ioctl call. sc_setinfo sets the scancode capability information from its input parameter, using the TCSETSC ioctl call.

sc_copyscstate 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. sc_copyscstate takes source and destination file descriptors as parameters.

sc_getscreenswitch and sc_setscreenswitch 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.)

sc_getscreenswitch returns the current mode key information.

sc_setscreenswitch determines which mode keys are required (in combination 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 sc_setscreenswitch with a value of zero disables screen switching.

If the application does not set screen switch mode with a call to sc_setscreenswitch, screen switching is determined by the application's original keyboard mapping.

Diagnostics

sc_raw and sc_unraw return the old scancode mode on success or -1 on failure. sc_getinfo returns -1 if it cannot obtain the scancode capability information from the TCGETSC ioctl call. sc_setinfo and sc_copyscstate return 0 on success or -1 on failure. A return value of 0x80 for sc_getscreenswitch indicates one of two things: either the application is not running on the console so screen switching is unavailable, or the screen switch mode has not been set through the API, and the original screen switch entries in the keymap will be used. sc_setscreenswitch 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

sc_init(S) and sc_mapinit(S) affect only one terminal at a time, and the application using the API affects only the terminal specified for sc_init(S) or sc_mapinit(S).

See also

mapkey(M)

Standards conformance

sc_raw, sc_unraw, sc_getinfo, sc_setinfo, sc_setscreenswitch, and sc_getscreenswitch are extensions of AT&T System V provided by the Santa Cruz Operation.
© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003