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 */
57 (on Plan 9, it is the name of the keyboard device).
67 to report each character read from the device.
70 is used to set the state of the interface, typically to turn raw mode on and off.
75 to the control file associated with the device, which is assumed to be the regular device file name
81 closes the file descriptors associated with the keyboard, kills the slave processes,
87 .B /usr/local/plan9/src/libdraw
94 Because the interface delivers complete runes,
95 there is no way to report lesser actions such as
96 shift keys or even individual bytes.