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
150 .Bl -tag -width MOUSE
151 .It bit 4..7 ACCELERATION
152 This flag controls the amount of acceleration effect.
153 The smaller the value of this flag is, more sensitive the movement becomes.
154 The minimum value allowed, thus the value for the most sensitive setting,
156 Setting this flag to zero will completely disables the
162 commands for mouse drivers.
163 These commands and related structures and constants are defined in
165 General description of the commands is given in
167 This section explains the features specific to the
171 .Bl -tag -width MOUSE -compact
172 .It Dv MOUSE_GETLEVEL Ar int *level
173 .It Dv MOUSE_SETLEVEL Ar int *level
174 These commands manipulate the operation level of the
178 .It Dv MOUSE_GETHWINFO Ar mousehw_t *hw
179 Returns the hardware information of the attached device in the following
183 field is guaranteed to be filled with the correct value by the current
188 typedef struct mousehw {
189 int buttons; /* number of buttons */
190 int iftype; /* I/F type */
191 int type; /* mouse/track ball/pad... */
192 int model; /* I/F dependent model ID */
193 int hwid; /* I/F dependent hardware ID */
199 field holds the number of buttons on the device.
206 .Dv MOUSE_IF_INPORT .
212 .Dv MOUSE_TRACKBALL ,
221 .Dv MOUSE_MODEL_GENERIC
222 at the operation level 0.
224 .Dv MOUSE_MODEL_GENERIC
227 constants at higher operation levels.
233 .It Dv MOUSE_GETMODE Ar mousemode_t *mode
234 The command gets the current operation parameters of the mouse
237 typedef struct mousemode {
238 int protocol; /* MOUSE_PROTO_XXX */
239 int rate; /* report rate (per sec), -1 if unknown */
240 int resolution; /* MOUSE_RES_XXX, -1 if unknown */
241 int accelfactor; /* acceleration factor */
242 int level; /* driver operation level */
243 int packetsize; /* the length of the data packet */
244 unsigned char syncmask[2]; /* sync. bits */
253 .Dv MOUSE_PROTO_INPORT
254 at the operation level zero.
255 .Dv MOUSE_PROTO_SYSMOUSE
256 at the operation level one.
260 is the status report rate (reports/sec) at which the device will send
261 movement report to the host computer.
262 As there is no standard to detect the current setting,
263 this field is always set to -1.
271 field holds a value to control acceleration feature
274 It is zero or greater.
275 If it is zero, acceleration is disabled.
279 field specifies the length of the data packet.
283 .Bl -tag -width level_0__ -compact
292 holds a bit mask and pattern to detect the first byte of the
295 is the bit mask to be ANDed with a byte.
296 If the result is equal to
298 the byte is likely to be the first byte of the data packet.
299 Note that this detection method is not 100% reliable,
300 thus, should be taken only as an advisory measure.
306 are modifiable by the
309 Changing the other field does not cause error, but has no effect.
311 .It Dv MOUSE_SETMODE Ar mousemode_t *mode
312 The command changes the current operation parameters of the mouse driver
320 Setting values in the other field does not generate
321 error and has no effect.
323 .\" .It Dv MOUSE_GETVARS Ar mousevar_t *vars
324 .\" .It Dv MOUSE_SETVARS Ar mousevar_t *vars
325 .\" These commands are not supported by the
329 .It Dv MOUSE_READDATA Ar mousedata_t *data
330 .It Dv MOUSE_READSTATE Ar mousedata_t *state
331 These commands are not supported by the
335 .It Dv MOUSE_GETSTATUS Ar mousestatus_t *status
336 The command returns the current state of buttons and
337 movement counts as described in
341 .Bl -tag -width /dev/nmse0 -compact
343 `non-blocking' device node in the system without
348 `non-blocking' device node under
355 .Pa /boot/device.hints :
356 .Dl hint.mse.0.at="isa"
357 .Dl hint.mse.0.port="0x23c"
358 .Dl hint.mse.0.irq="5"
362 driver at the primary port address with the IRQ 5.
366 .Dl hint.mse.1.at="isa"
367 .Dl hint.mse.1.port="0x238"
368 .Dl hint.mse.1.irq="4"
369 .Dl hint.mse.1.flags="0x30"
373 driver at the secondary port address with the IRQ 4 and the acceleration
383 Some bus mouse interface cards generate interrupts at the fixed report rate
384 when enabled, whether or not the mouse state is changing.
385 The others generate interrupts only when the state is changing.