3 kbdfs, console \- keyboard and console filesystem
19 .B mount -b /srv/cons /dev
38 translates raw keyboard scancodes from
46 file and optionally reads console input from
48 to provide initial keyboard and console input.
50 It serves a one-level directory containing the files
61 flag enables a debug trace of
67 from making its memory private.
73 to post its channel on
95 (defaults to the system shell)
98 instance providing a serial console if
100 environment variable is set.
105 file returns characters typed on the console. Normally, characters
106 are buffered to enable erase and kill processing.
109 typed at the keyboard
111 the current input line (removes all
112 characters from the buffer of characters not yet read via cons), and a
115 the previous non-kill, non-erase character from the
117 The combination control-W,
119 deletes the input last word.
120 Killing and erasing only delete characters back to, but
121 not including, the last newline. Characters typed at the keyboard
122 actually produce 16-bit runes (see
124 but the runes are translated into the variable-length
128 before putting them into the buffer. A
130 of a length greater than zero causes the process to wait until a newline
133 ends the buffer, and then returns as much of the buffer as the
134 argument to read allows, but only up to one complete line. A
137 is not put into the buffer. If part of the line remains, the next
138 read will return bytes from that remainder and not part of any new
139 line that has been typed since.
143 has been written to the
150 characters are not echoed as they are typed,
156 are not treated specially, and characters are
157 available to read as soon as they are typed. Ordinary mode is
162 or this file is closed.
168 causes the characters to be printed on the console screen.
174 as its last argument, it reads and processes the
175 characters from that file and forwards them to the
177 file with the same text processing applied as on keyboard input.
178 This is used to provide a serial console when
180 environment variable is set. (see
187 and then pressing the
190 trigger a reboot of the terminal.
191 To forward this sequence downstream,
204 This is usefull for programs like
211 file returns the character
216 followed by a null terminated, variable-length,
220 message is sent when a key is pressed down
223 when a key is released. The following string contains all the keycodes
224 of the keys that are currently pressed down in unshifted form.
225 This includes all keys that have a keyboard mapping and modifier keys.
226 The string following the
228 message contains the single character that would have been returned
233 message will be resent at the keyboard repeat rate.
236 can return multiple concatenated messages at once (delimited by the null byte)
237 or block when there are no messages queued. Opening the
239 file disables input processing on the
241 file until it is closed again.
247 messages can be written to
249 and will forwarded to the reader of
257 message followed by a
259 encoded rune will simulate the press or
260 release of that particular rune.
262 Raw scancodes can be written to the
264 file for external keyboard input (used for USB keyboards).
266 Scancodes are mapped to Unicode characters with a number of
267 translation tables. These tables can be accessed with the
271 Reads return the current contents of the map.
272 Each entry is one line containing three 11 character numeric fields,
273 each followed by a space:
274 a table number, an index into the table (scan code), and the decimal value
275 of the corresponding Unicode character (0 if none).
276 The table numbers are platform dependent; they typically distinguish
277 between unshifted and shifted keys.
278 The scan code values are hardware dependent and can vary
279 from keyboard to keyboard.
281 Writes to the file change the map.
282 Lines written to the file must contain three space-separated fields,
283 representing the table number, scan code index, and Unicode character.
284 Values are taken to be decimal unless they start with
289 The Unicode character can also be represented as
293 gives the UTF-8 representation of the character
298 to represent a control character.
308 .B /sys/src/cmd/aux/kbdfs
313 first appeared in 9front (May, 2011).