3 kbdfs \- keyboard and console filesystem
19 .B mount -b /srv/cons /dev
32 translates raw keyboard scancodes from
40 file and optionally reads console input from
42 to provide initial keyboard and console input.
44 It serves a one-level directory containing the files
55 flag enables a debug trace of
61 from making its memory private.
67 to post its channel on
88 file returns characters typed on the console. Normally, characters
89 are buffered to enable erase and kill processing.
94 the current input line (removes all
95 characters from the buffer of characters not yet read via cons), and a
98 the previous non-kill, non-erase character from the
100 The combination control-W,
102 deletes the input last word.
103 Killing and erasing only delete characters back to, but
104 not including, the last newline. Characters typed at the keyboard
105 actually produce 16-bit runes (see
107 but the runes are translated into the variable-length
111 before putting them into the buffer. A
113 of a length greater than zero causes the process to wait until a newline
116 ends the buffer, and then returns as much of the buffer as the
117 argument to read allows, but only up to one complete line. A
120 is not put into the buffer. If part of the line remains, the next
121 read will return bytes from that remainder and not part of any new
122 line that has been typed since.
126 has been written to the
133 characters are not echoed as they are typed,
139 are not treated specially, and characters are
140 available to read as soon as they are typed. Ordinary mode is
145 or this file is closed.
151 causes the characters to be printed on the console screen.
157 as its last argument, it reads and processes the
158 characters from that file and forwards them to the
160 file with the same text processing applied as on keyboard input.
161 This is used on serial consoles.
165 file returns the character
170 followed by a null terminated, variable-length,
174 message is send when a key is pressed down
177 when a key is released. The following string contains all the keycodes
178 of the keys that are currently pressed down in unshifted form.
179 This includes all keys that have a keyboard mapping and modifier keys.
180 The string following the
182 message contains the single character that would have been returned
187 message will be resent at the keyboard repeat rate.
190 can return multiple concatenated messages at once (delimited by the null byte)
191 or block when there are no messages queued. Opening the
193 file disables input processing on the
195 file until it is closed again.
201 messages can be written to
203 and will forwarded to the reader of
211 message followed by a
213 encoded rune will simulate the press or
214 release of that particular rune.
216 Raw scancodes can be written to the
218 file for external keyboard input (used for USB keyboards).
220 Scancodes are mapped to Unicode characters with a number of
221 translation tables. These tables can be accessed with the
225 Reads return the current contents of the map.
226 Each entry is one line containing three 11 character numeric fields,
227 each followed by a space:
228 a table number, an index into the table (scan code), and the decimal value
229 of the corresponding Unicode character (0 if none).
230 The table numbers are platform dependent; they typically distinguish
231 between unshifted and shifted keys.
232 The scan code values are hardware dependent and can vary
233 from keyboard to keyboard.
235 Writes to the file change the map.
236 Lines written to the file must contain three space-separated fields,
237 representing the table number, scan code index, and Unicode character.
238 Values are taken to be decimal unless they start with
243 The Unicode character can also be represented as
247 gives the UTF-8 representation of the character
252 to represent a control character.
261 .B /sys/src/cmd/aux/kbdfs
264 first appeared in 9front (May, 2011).