1 .\" $Id: vkbd.4,v 1.4 2004/11/16 16:49:39 max Exp $
9 .Nd the virtual AT keyboard interface
15 interface is a software loopback mechanism that can be loosely
16 described as the virtual AT keyboard analog of the
20 does for virtual AT keyboards what the
22 driver does for terminals.
28 driver, provides two interfaces: a keyboard interface like the usual
29 facility it is simulating (a virtual AT keyboard in the case of
33 and a character-special device
37 The virtual AT keyboards are named
39 etc., one for each control device that has been opened.
43 interface permits opens on the special control device
45 When this device is opened,
47 will return a handle for the lowest unused
53 Each virtual AT keyboard supports the usual keyboard interface
55 and thus can be used with
57 like any other keyboard.
58 The control device supports exactly the same
60 as the virtual AT keyboard device.
61 Writing AT scan codes to the control device generates an input on
62 the virtual AT keyboard, as if the
64 hardware had just received it.
66 The virtual AT keyboard control device, normally
67 .Pa /dev/vkbdctl Ns Aq Ar N ,
69 (it cannot be opened if it is already open)
70 and is restricted to the super-user.
73 call will return the virtual AT keyboard status structure
75 .In dev/vkbd/vkbd_var.h )
77 if not, it will either block until one is or return
79 depending on whether non-blocking I/O has been enabled.
83 call passes AT scan codes to be
85 from the virtual AT keyboard.
86 Each AT scan code must be passed as
88 Although AT scan codes must be passes as
89 .Vt "unsigned int" Ns s ,
90 the size of the buffer passed to
92 still should be in bytes, i.e.,
93 .Bd -literal -offset indent
94 static unsigned int codes[] =
105 fd = open("/dev/vkbdctl0", O_RDWR);
109 /* Note sizeof(codes) - not 2! */
110 len = write(fd, codes, sizeof(codes));
120 Write will block if there is not enough space in the input queue.
122 The control device also supports
126 On the last close of the control device, the virtual AT keyboard is removed.
127 All queued scan codes are thrown away.
136 interface is a software loopback mechanism, and, thus
138 will not work with it.
139 Current implementation of the
141 driver can accept input from only one keyboard, even if it is virtual.
142 Thus it is not possible to have both wired and virtual keyboard to be active
144 It is, however, in principal possible to obtain AT scan
145 codes from the different sources and write them into the same virtual keyboard.
146 The virtual keyboard state synchronization is the user's responsibility.
150 module was implemented in
153 .An Maksim Yevmenkin Aq m_evmenkin@yahoo.com