|
|
#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;
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.
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.