1 .\" Copyright 1992 by the University of Guelph
3 .\" Permission to use, copy and modify this
4 .\" software and its documentation for any purpose and without
5 .\" fee is hereby granted, provided that the above copyright
6 .\" notice appear in all copies and that both that copyright
7 .\" notice and this permission notice appear in supporting
9 .\" University of Guelph makes no representations about the suitability of
10 .\" this software for any purpose. It is provided "as is"
11 .\" without express or implied warranty.
20 .Nd bus and InPort mice driver
22 .\" .Cd "options MSE_XXX=N"
26 .Pa /boot/device.hints :
27 .Cd hint.mse.0.at="isa"
28 .Cd hint.mse.0.port="0x23c"
29 .Cd hint.mse.0.irq="5"
33 driver provides support for the bus mouse and the InPort mouse, which
34 are often collectively called ``bus'' mice, as these mice are sold with
35 an interface card which needs to be installed in an expansion bus slot.
36 The interface circuit may come on an integrated I/O card or as an option
39 The bus and InPort mice have two or three buttons,
40 and a D-sub 9-pin male connector or a round DIN 9-pin
43 The primary port address of the bus and InPort mouse interface cards
45 Some cards may also be set to use the secondary port
47 The interface cards require a single IRQ, which may be
49 Some cards may offer additional IRQs.
50 The port number and the IRQ number are configured by jumpers on the cards
51 or by software provided with the card.
53 Frequency, or report rate, at which the device sends movement
54 and button state reports to the host system, may also be configurable on
56 It may be 15, 30, 60 or 120Hz.
58 The difference between the two types of the mice is not in mouse devices
59 (in fact they are exactly the same).
60 But in the circuit on the interface
62 This means that the device from a bus mouse package can be
63 connected to the interface card from an InPort mouse package, or vice
64 versa, provided that their connectors match.
68 driver has two levels of operation.
69 The current operation level can be set via an ioctl call.
71 At the level zero the basic support is provided; the device driver will report
72 horizontal and vertical movement of the attached device
73 and state of up to three buttons in the format described below.
74 It is a subset of the MouseSystems protocol.
76 .Bl -tag -width Byte_1 -compact
78 .Bl -tag -width bit_7 -compact
84 Left button status; cleared if pressed, otherwise set.
86 Middle button status; cleared if pressed, otherwise set.
88 if the device does not have the middle button.
90 Right button status; cleared if pressed, otherwise set.
93 Horizontal movement count in two's compliment; -128 through 127.
95 Vertical movement count in two's compliment; -128 through 127.
102 This is the default level of operation and the driver is initially
103 at this level when opened by the user program.
105 At the operation level one (extended level), a data packet is encoded
106 in the standard format
107 .Dv MOUSE_PROTO_SYSMOUSE
113 driver can somewhat `accelerate' the movement of the pointing device.
114 The faster you move the device, the further the pointer
115 travels on the screen.
116 The driver has an internal variable which governs the effect of
118 Its value can be modified via the driver flag
119 or via an ioctl call.
121 The minor device number of the
124 .Bd -literal -offset indent
125 minor = (`unit' << 1) | `non-blocking'
128 where `unit' is the device number (usually 0) and the `non-blocking' bit
129 is set to indicate ``do not block waiting for mouse input,
130 return immediately''.
131 The `non-blocking' bit should be set for \fIXFree86\fP,
132 therefore the minor device number usually used for \fIXFree86\fP is 1.
135 for device node names.
136 .Sh DRIVER CONFIGURATION
137 .\" .Ss Kernel Configuration Options
141 driver accepts the following driver flag.
143 kernel configuration file
146 or in the User Configuration Menu at
151 .Bl -tag -width MOUSE
152 .It bit 4..7 ACCELERATION
153 This flag controls the amount of acceleration effect.
154 The smaller the value of this flag is, more sensitive the movement becomes.
155 The minimum value allowed, thus the value for the most sensitive setting,
157 Setting this flag to zero will completely disables the
163 commands for mouse drivers.
164 These commands and related structures and constants are defined in
166 General description of the commands is given in
168 This section explains the features specific to the
172 .Bl -tag -width MOUSE -compact
173 .It Dv MOUSE_GETLEVEL Ar int *level
174 .It Dv MOUSE_SETLEVEL Ar int *level
175 These commands manipulate the operation level of the
179 .It Dv MOUSE_GETHWINFO Ar mousehw_t *hw
180 Returns the hardware information of the attached device in the following
184 field is guaranteed to be filled with the correct value by the current
189 typedef struct mousehw {
190 int buttons; /* number of buttons */
191 int iftype; /* I/F type */
192 int type; /* mouse/track ball/pad... */
193 int model; /* I/F dependent model ID */
194 int hwid; /* I/F dependent hardware ID */
200 field holds the number of buttons on the device.
207 .Dv MOUSE_IF_INPORT .
213 .Dv MOUSE_TRACKBALL ,
222 .Dv MOUSE_MODEL_GENERIC
223 at the operation level 0.
225 .Dv MOUSE_MODEL_GENERIC
228 constants at higher operation levels.
234 .It Dv MOUSE_GETMODE Ar mousemode_t *mode
235 The command gets the current operation parameters of the mouse
238 typedef struct mousemode {
239 int protocol; /* MOUSE_PROTO_XXX */
240 int rate; /* report rate (per sec), -1 if unknown */
241 int resolution; /* MOUSE_RES_XXX, -1 if unknown */
242 int accelfactor; /* acceleration factor */
243 int level; /* driver operation level */
244 int packetsize; /* the length of the data packet */
245 unsigned char syncmask[2]; /* sync. bits */
254 .Dv MOUSE_PROTO_INPORT
255 at the operation level zero.
256 .Dv MOUSE_PROTO_SYSMOUSE
257 at the operation level one.
261 is the status report rate (reports/sec) at which the device will send
262 movement report to the host computer.
263 As there is no standard to detect the current setting,
264 this field is always set to -1.
272 field holds a value to control acceleration feature
275 It is zero or greater.
276 If it is zero, acceleration is disabled.
280 field specifies the length of the data packet.
284 .Bl -tag -width level_0__ -compact
293 holds a bit mask and pattern to detect the first byte of the
296 is the bit mask to be ANDed with a byte.
297 If the result is equal to
299 the byte is likely to be the first byte of the data packet.
300 Note that this detection method is not 100% reliable,
301 thus, should be taken only as an advisory measure.
307 are modifiable by the
310 Changing the other field does not cause error, but has no effect.
312 .It Dv MOUSE_SETMODE Ar mousemode_t *mode
313 The command changes the current operation parameters of the mouse driver
321 Setting values in the other field does not generate
322 error and has no effect.
324 .\" .It Dv MOUSE_GETVARS Ar mousevar_t *vars
325 .\" .It Dv MOUSE_SETVARS Ar mousevar_t *vars
326 .\" These commands are not supported by the
330 .It Dv MOUSE_READDATA Ar mousedata_t *data
331 .It Dv MOUSE_READSTATE Ar mousedata_t *state
332 These commands are not supported by the
336 .It Dv MOUSE_GETSTATUS Ar mousestatus_t *status
337 The command returns the current state of buttons and
338 movement counts as described in
342 .Bl -tag -width /dev/nmse0 -compact
344 `non-blocking' device node in the system without
349 `non-blocking' device node under
356 .Pa /boot/device.hints :
357 .Dl hint.mse.0.at="isa"
358 .Dl hint.mse.0.port="0x23c"
359 .Dl hint.mse.0.irq="5"
363 driver at the primary port address with the IRQ 5.
367 .Dl hint.mse.1.at="isa"
368 .Dl hint.mse.1.port="0x238"
369 .Dl hint.mse.1.irq="4"
370 .Dl hint.mse.1.flags="0x30"
374 driver at the secondary port address with the IRQ 4 and the acceleration
377 Some bus mouse interface cards generate interrupts at the fixed report rate
378 when enabled, whether or not the mouse state is changing.
379 The others generate interrupts only when the state is changing.