]> git.lizzy.rs Git - plan9front.git/blobdiff - sys/man/8/kbdfs
aux/vga: display switching for Intel adapters
[plan9front.git] / sys / man / 8 / kbdfs
index cb13cbd7e4ecf528967b9d6d0b83854a7ce1cb3f..e55cf964b10395b86933f9251f8f3594a82cf4bc 100644 (file)
@@ -12,7 +12,7 @@ kbdfs \- keyboard and console filesystem
 .B -m
 .I mntpnt
 ] [
-.I consfile
+.I filename
 ]
 .nf
 
@@ -20,6 +20,7 @@ kbdfs \- keyboard and console filesystem
 .B /dev/cons
 .B /dev/consctl
 .B /dev/kbd
+.B /dev/kbdin
 .B /dev/kbin
 .B /dev/kbmap
 .fi
@@ -34,7 +35,9 @@ translates raw keyboard scancodes from
 .IR kbd (3))
 and its
 .BR kbin
-file and optionaly reads console input from
+and
+.BR kbdin
+file and optionally reads console input from
 .I consfile
 to provide initial keyboard and console input.
 .PP
@@ -42,6 +45,7 @@ It serves a one-level directory containing the files
 .BR cons,
 .BR consctl,
 .BR kbd,
+.BR kbdin,
 .BR kbin
 and
 .BR kbmap.
@@ -61,8 +65,7 @@ The
 option causes
 .IR kbdfs
 to post its channel on
-.B /srv/
-.I srv.
+.B /srv/\fIsrv\fP.
 On system startup,
 .IR boot (8)
 sets this to
@@ -71,28 +74,33 @@ With the
 .B -m
 option,
 .IR kbdfs
-mounts itself before (see
-.IR bind (2))
-on
+mounts itself on
 .I mntpnt
+(see
+.IR bind (2)),
 otherwise on
 .B /dev
-(default).
+(the default).
 .SS Console
 .PP
 Reading the
 .BR cons
 file returns characters typed on the console.  Normally, characters
-are buffered to enable erase and kill processing.  A control-U, 
+are buffered to enable erase and kill processing.  
+A control-U, 
 .LR ^U ,
 typed at the keyboard
-.I kills
+.I erases
 the current input line (removes all
 characters from the buffer of characters not yet read via cons), and a
 backspace
 .I erases
 the previous non-kill, non-erase character from the
-input buffer.  Killing and erasing only delete characters back to, but
+input buffer.
+The combination control-W,
+.LR ^W ,
+deletes the input last word.
+Killing and erasing only delete characters back to, but
 not including, the last newline.  Characters typed at the keyboard
 actually produce 16-bit runes (see
 .IR utf (6)),
@@ -102,7 +110,7 @@ encoding (see
 .IR utf (6))
 before putting them into the buffer. A
 .IR read (2)
-of length greater than zero causes the process to wait until a newline
+of length greater than zero causes the process to wait until a newline
 or a
 .LR ^D
 ends the buffer, and then returns as much of the buffer as the
@@ -124,7 +132,8 @@ is in
 .IR "raw mode" :
 characters are not echoed as they are typed,
 backspace,
-.L ^U
+.L ^U,
+.L ^W
 and
 .L ^D
 are not treated specially, and characters are
@@ -141,11 +150,11 @@ to
 .BR cons
 causes the characters to be printed on the console screen.
 .PP
-When
+When a
+.I filename
+is passed to
 .IR kbdfs (8)
-gets a
-.I consfile
-passed as its last argument, it reads and processes the
+as its last argument, it reads and processes the
 characters from that file and forwards them to the
 .BR cons
 file with the same text processing applied as on keyboard input.
@@ -153,32 +162,62 @@ This is used on serial consoles.
 .SS Keyboard
 A read on the
 .BR kbd
-file returns a null terminated variable-length
+file returns the character
+.B k,
+.B K
+or
+.B c
+followed by a null terminated, variable-length,
 .SM UTF
-encoded string of all the keys that are currently pressed (key is
-down) on the keyboard.  This includes all keys that have a keyboard
-mapping and modifier keys.  No key is treated specially. A new event
-is generated on each state change or at keyboard repeat rate and put
-in a buffer. Each
+encoded string. The
+.B k
+message is send when a key is pressed down
+and
+.B K
+when a key is released. The following string contains all the keycodes
+of the keys that are currently pressed down in unshifted form. 
+This includes all keys that have a keyboard mapping and modifier keys.
+The string following the
+.B c
+message contains the single character that would have been returned
+on the
+.BR cons
+file instead. The
+.B c
+message will be resent at the keyboard repeat rate.
+Each
 .IR read (2)
-will return a single event or block until there are new events
-available.  There always will be a null-byte at the end of the read
-data, so when all keys are released (all keys are up), a single
-null-byte will be returned.  New pressed keys are appended to the
-string at the end before the null-byte.  Key releases remove the
-character from the string.  Change on modifier keys like
-.B Shift
+will return a single message or block until there are new messages
+available. Opening the
+.BR kbd
+file disables input processing on the
+.BR cons
+file until it is closed again.
+.PP
+.B K,
+.B k
+and
+.B c
+messages can be written to
+.BR kbdin
+and will forwarded to the reader of
+.BR cons
+or
+.BR kbd.
+Writing a
+.B r
 or
-.B Num
-will not change
-the characters in the string of keys already pressed down, but take
-effect on newly pressed keys.
+.B R
+message followed by a
+.SM UTF
+encoded rune will simulate the press or
+release of that particular rune.
 .PP
 Raw scancodes can be written to the
 .BR kbin
-file for external keyboard input (used for usb keyboards).
+file for external keyboard input (used for USB keyboards).
 .SS "Keyboard map"
-Scancodes are maped to Unicode characters with a number of
+Scancodes are mapped to Unicode characters with a number of
 translation tables. These tables can be accessed with the
 .BR kbmap
 file.
@@ -217,6 +256,9 @@ to represent a control character.
 .IR utf (6),
 .IR kbd (3)
 .SH FILES
-.B /dev/lib/kbmap/*
+.B /sys/lib/kbmap/*
 .SH SOURCE
-.B /sys/src/cmd/aux/kbdfs.c
+.B /sys/src/cmd/aux/kbdfs
+.SH HISTORY
+.I Kbdfs
+first appeared in 9front (May, 2011).