9srv Manual Collection/plan9/keyboard(2) | 9srv Manual Collection/plan9/keyboard(2) |
---|
Keyboardctl *initkeyboard(char *file)
int ctlkeyboard(Keyboardctl *kc, char *msg)
void closekeyboard(Keyboard *kc)
Initkeyboard opens a connection to the keyboard and returns a Keyboardctl structure:
The argument to initkeyboard is a file naming the device file from which characters may be read, typically /dev/cons. If file is nil, /dev/cons is assumed.
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.
9srv Manual Collection/plan9/keyboard(2) | Rev: Sun Dec 02 23:42:20 GMT 2007 |