3 initkeyboard, ctlkeyboard, closekeyboard \- keyboard control
16 Keyboardctl *initkeyboard(char *file)
19 int ctlkeyboard(Keyboardctl *kc, char *msg)
22 void closekeyboard(Keyboard *kc)
24 These functions access and control a keyboard interface
25 for character-at-a-time I/O in a multi-threaded environment, usually in combination with
27 They use the message-passing
29 interface in the threads library
32 programs that wish a more event-driven, single-threaded approach should use
36 opens a connection to the keyboard and returns a
41 .ta 6n +\w'Channel 'u +\w'consfd; 'u
42 typedef struct Keyboardct Keyboardctl;
45 Channel *c; /* chan(Rune[20]) */
48 int consfd; /* to cons file */
49 int ctlfd; /* to ctl file */
50 int pid; /* of slave proc */
58 naming the device file from which characters may be read,
75 to report each character read from the device.
78 is used to set the state of the interface, typically to turn raw mode on and off
83 to the control file associated with the device, which is assumed to be the regular device file name
89 closes the file descriptors associated with the keyboard, kills the slave processes,
102 Because the interface delivers complete runes,
103 there is no way to report lesser actions such as
104 shift keys or even individual bytes.