1virtualkm(7D) Devices virtualkm(7D)
2
3
4
6 virtualkm - Virtual keyboard and mouse
7
9 /dev/kbd
10
11
12 /dev/mouse
13
14
15 #include <sys/types.h>
16
17
18 #include <sys/kbio.h>
19
20
21 int ioctl(int fildes, int command, ... /*arg*/);
22
23
25 A virtual keyboard or mouse is an abstraction of one or more physical
26 keyboards or mice (USB or PS2) connected to a system. Input streams
27 for these physical devices are coalesced into a single input stream
28 and appear as a single device to the upper layers.
29
30
31 /dev/kbd is the virtual keyboard device file. Inputs from multiple key‐
32 boards are coalesced into a single input stream, meaning that all key‐
33 boards appear as a single keyboard to a console or window system and
34 accordingly, are treated as a single device. The virtual keyboard lay‐
35 out is consistent with the layout of the first keyboard plugged into
36 the system. Note that on x86 platforms, the virtual keyboard layout can
37 be overloaded by eeprom(1M).
38
39
40 /dev/mouse is the virtual mouse device file. Inputs from multiple mice
41 are coalesced into a single input stream, meaning that all mice appear
42 as single mouse to the window system.
43
44
45 Commands from applications are dispatched by the virtual keyboard/mouse
46 facility to the underlying physical devices and will succeed provided
47 that one of the underlying devices responds with success. For example,
48 a single command issued to turn on LED's will turn on corresponding
49 LED's for all underlying physical keyboards.
50
51
52 Although physical keyboards/mice are linked to the virtual key‐
53 board/mouse facility, each may be opened separately by accessing its
54 associated device file. (For example, /dev/usb/hid0 for a usb mouse).
55 Directly accessing a device file can be useful for multi-seat, gok(1)
56 or similar purposes.
57
58
59 When a single physical device is opened via its associated device file,
60 it is automatically removed from the single virtual input stream. When
61 closed, it is automatically re- coalesced into the single virtual input
62 stream.
63
64
65 Under the virtualkm facility, the PS/2 mouse is coalesced into a vir‐
66 tual mouse single input stream and can be accessed using the /dev/mouse
67 file. (Note that in previous releases, the PS/2 mouse was accessed via
68 the /dev/kdmouse physical device file). In the current release, you use
69 the /dev/kdmouse file to directly access the physical PS/2 mouse.
70
71 INTERFACES
72 The virtual mouse provides the following event ID's for mouse capabil‐
73 ity changes:
74
75 MOUSE_CAP_CHANGE_NUM_BUT This event is reported when the total
76 number of mouse buttons changes. The
77 Firm_event.value is set to the new button
78 total, which is the maximum number of all
79 mice buttons. Other fields are ignored.
80
81
82 MOUSE_CAP_CHANGE_NUM_WHEEL This event is reported when the total
83 number of mouse wheels changes. The
84 Firm_event.value is set to the new wheel
85 total. Other fields are ignored. The
86 event value (Firm_event.value) can be 0
87 (no wheel), 1 (vertical wheel), or 2
88 (vertical and horizontal wheel).
89
90
91
92 The Firm_event structure is described in <sys/vuid_event.h>. As with
93 other events, firm events are received using read(2).
94
95
96 Event ID's are used by applications (including certain mouse demo
97 applications) that are programmed to graphically represent the actual
98 number of buttons and wheels on a mouse. When an application of this
99 type receives a Firm_event with a ID MOUSE_CAP_CHANGE_NUM_BUT or
100 MOUSE_CAP_CHANGE_NUM_WHEEL event, it is instructed to update its state
101 information using the new value. Consider, for example, a mouse demo
102 application whose sole function is to display a mouse with buttons that
103 graphically correspond to the actual number of buttons on the mouse.
104 If, for example, the system has a single two-button USB mouse attached,
105 the application, by default, will graphically display the mouse with a
106 left and a right button. However, if a another three-button USB mouse
107 is hot-plugged into the system, a MOUSE_CAP_CHANGE_NUM_BUT Firm event
108 with Firm_event.value of three instructs the demo application to
109 update the mouse display to indicate three buttons.
110
112 KIOCSETFREQ Sets the frequency for either keyboard beeper or console
113 beeper. To set the corresponding beeper frequency, arg
114 must point to a freq_request structure:
115
116 struct freq_request {
117 enum fr_beep_type type; /* beep type */
118 int16_t freq; /* frequency */
119 };
120
121 Where type is the corresponding beeper type defined as:
122
123 enum fr_beep_type { CONSOLE_BEEP =1, KBD_BEEP =2 };
124
125 and freq is the frequency value to be set as the beeper
126 frequency indicated by type. This value should be
127 between 0 and 32767 with border inclusive.
128
129
131 /dev/kbd Virtual Keyboard device file.
132
133
134 /dev/mouse Virtual Mouse device file.
135
136
137 /dev/kdmouse Physical PS/2 mouse device file.
138
139
140 /dev/usb/hid* Physical USB keyboard/mouse device file.
141
142
143 /etc/dacf.conf Device auto-configuration file.
144
145
147 See attributes(5) for descriptions of the following attributes:
148
149
150
151
152 ┌───────────────────────────────────────────────────────────┐
153 │ATTRIBUTE TYPE ATTRIBUTE VALUE │
154 │Architecture SPARC, x86 │
155 │Availability SUNWckr, SUNWcsd, SUNWusb, │
156 │ SUNWpsdcr, SUNWcakr.i │
157 │Interface Stability Evolving │
158 └───────────────────────────────────────────────────────────┘
159
161 kbd(1), eeprom(1M), read(2), attributes(5), hid(7D), usba(7D), kb(7M),
162 usbkbm(7M), usbms(7M), vuidmice(7M)
163
164
165 See gok(1) in the GNOME man pages, available in the SUNWgnome package.
166
168 The messages described below may appear on the system console as well
169 as being logged. All messages are formatted in the following manner:
170
171 WARNING: Error message...
172
173
174
175 conskbd: keyboard is not available for system debugging: device_path.
176
177 Errors were encountered while entering kmdb during initialization
178 for debugger mode. As a result, the keyboard is not available.
179
180
181 conskbd: keyboard is not available: <device_path>
182
183 Errors were encountered while exiting kmdb during un-initialization
184 for debugger mode. As a result, the keyboard is not available.
185
186
187 Failed to relink the mouse <device_path> underneath virtual mouse
188
189 An error was encountered and the mouse is unavailable. (When a
190 mouse is physically opened via a physical device file such as
191 /dev/usb/hid0, it is removed from the single virtual input stream
192 (/dev/mouse). When closed, it is re-coalesced into a single virtual
193 input stream beneath /dev/mouse. If an error is encountered, (for
194 example, the mouse has been physically removed), it is unavailable
195 beneath /dev/mouse.
196
197
199 Currently, the virtualkm device supports only USB and PS2 keyboards
200 and mice.
201
202
203 The virtualkm device maintains complete compatibility on select legacy
204 systems, (including Ultra 10's), that are equipped with serial key‐
205 board/mouse.
206
207
208
209 SunOS 5.11 16 Jan 2007 virtualkm(7D)