From 78e51a8c6678b6e3dff3d619aa786669f531f4bc Mon Sep 17 00:00:00 2001 From: rsc Date: Fri, 14 Jan 2005 03:45:44 +0000 Subject: checkpoint --- man/man3/keyboard.html | 135 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 135 insertions(+) create mode 100644 man/man3/keyboard.html (limited to 'man/man3/keyboard.html') diff --git a/man/man3/keyboard.html b/man/man3/keyboard.html new file mode 100644 index 00000000..19dc833d --- /dev/null +++ b/man/man3/keyboard.html @@ -0,0 +1,135 @@ + +keyboard(3) - Plan 9 from User Space + + + + +
+
+
KEYBOARD(3)KEYBOARD(3) +
+
+

NAME
+ +
+ + initkeyboard, ctlkeyboard, closekeyboard – keyboard control
+ +
+

SYNOPSIS
+ +
+ + #include <u.h>
+ #include <libc.h>
+ #include <thread.h>
+ #include <keyboard.h>
+ +
+
+ Keyboardctl      *initkeyboard(char *file)
+ +
+
+ int             ctlkeyboard(Keyboardctl *kc, char *msg)
+ +
+
+ void            closekeyboard(Keyboard *kc)
+
+
+

DESCRIPTION
+ +
+ + These functions access and control a keyboard interface for character-at-a-time + I/O in a multi-threaded environment, usually in combination with + mouse(3). They use the message-passing Channel interface in the + threads library (see thread(3)); programs that wish a more event-driven, + single-threaded approach + should use event(3). +
+ + Initkeyboard opens a connection to the keyboard and returns a + Keyboardctl structure:
+ +
+ + typedef struct Keyboardct Keyboardctl;
+ struct Keyboardctl
+ {
+ +
+ + Channel *c;         /* chan(Rune[20]) */
+ char      *file;
+ int       consfd;     /* to cons file */
+ int       ctlfd;      /* to ctl file */
+ int       pid;        /* of slave proc */
+ +
+ };
+ +
+
+ +
+ The argument to initkeyboard is ignored (on Plan 9, it is the + name of the keyboard device). +
+ + Once the Keyboardctl is set up a message containing a Rune will + be sent on the Channel Keyboardctl.c to report each character + read from the device. +
+ + Ctlkeyboard is used to set the state of the interface, typically + to turn raw mode on and off. It writes the string msg to the control + file associated with the device, which is assumed to be the regular + device file name with the string ctl appended. +
+ + Closekeyboard closes the file descriptors associated with the + keyboard, kills the slave processes, and frees the Keyboardctl + structure. +
+ + +
+

SOURCE
+ +
+ + /usr/local/plan9/src/libdraw
+
+
+

SEE ALSO
+ +
+ + graphics(3), draw(3), event(3), thread(3).
+ +
+

BUGS
+ +
+ + Because the interface delivers complete runes, there is no way + to report lesser actions such as shift keys or even individual + bytes.
+ +
+ +

+
+
+ + +
+
+
+Space Glenda +
+
+ + -- cgit v1.2.3