keyboard man page on Plan9

Man page or keyword search:  
man Server   549 pages
apropos Keyword Search (all sections)
Output format
Plan9 logo
[printable version]

KEYBOARD(2)							   KEYBOARD(2)

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(2).	 They use the message-passing Channel interface in the
       threads library (see thread(2));	 programs  that	 wish  a  more	event-
       driven, single-threaded approach should use event(2).

       Initkeyboard opens a connection to the keyboard and returns a Keyboard‚Äź
       ctl 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 a file  naming  the  device  file  from
       which  characters  may  be  read, typically /dev/cons.  If file is nil,
       /dev/cons is assumed.

       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 (see cons(3)).  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
       /sys/src/libdraw

SEE ALSO
       graphics(2), draw(2), event(2), thread(2).

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

								   KEYBOARD(2)
[top]
                             _         _         _ 
                            | |       | |       | |     
                            | |       | |       | |     
                         __ | | __ __ | | __ __ | | __  
                         \ \| |/ / \ \| |/ / \ \| |/ /  
                          \ \ / /   \ \ / /   \ \ / /   
                           \   /     \   /     \   /    
                            \_/       \_/       \_/ 
More information is available in HTML format for server Plan9

List of man pages available for Plan9

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net