initkeyboard, ctlkeyboard, closekeyboard – keyboard control|
Keyboardctl *initkeyboard(char *file)
int ctlkeyboard(Keyboardctl *kc, char *msg)
void closekeyboard(Keyboard *kc)
These functions access and control a keyboard interface for character–at–a–time
I/O in a multi–threaded environment, usually in combination with
mouse(2). They use the message–passing Channel interface in the
threads library (see thread(2)); programs that wish a more event–driven,
should use event(2). |
Initkeyboard opens a connection to the keyboard and returns a
Once the Keyboardctl is set up a message containing a Rune will be sent on the Channel Keyboardctl.c to report each character read from the device.
Ctlkeyboard is used to set the state of the interface, typically to turn raw mode on and off (see cons(3)). It writes the string msg to the control file associated with the device, which is assumed to be the regular device file name with the string ctl appended.
Closekeyboard closes the file descriptors associated with the keyboard, kills the slave processes, and frees the Keyboardctl structure.
graphics(2), draw(2), event(2), thread(2).|
Because the interface delivers complete runes, there is no way
to report lesser actions such as shift keys or even individual