Deleted Added
full compact
mouse.4 (54142) mouse.4 (57676)
1.\"
2.\" Copyright (c) 1997
3.\" Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp>
4.\" All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:

--- 10 unchanged lines hidden (view full) ---

19.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26.\"
1.\"
2.\" Copyright (c) 1997
3.\" Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp>
4.\" All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:

--- 10 unchanged lines hidden (view full) ---

19.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26.\"
27.\" $FreeBSD: head/share/man/man4/mouse.4 54142 1999-12-05 07:54:43Z yokota $
27.\" $FreeBSD: head/share/man/man4/mouse.4 57676 2000-03-01 14:50:24Z sheldonh $
28.\"
29.Dd December 3, 1997
30.Dt MOUSE 4
31.Os FreeBSD
32.Sh NAME
33.Nm mouse
34.Nd mouse and pointing device drivers
35.Sh SYNOPSIS

--- 43 unchanged lines hidden (view full) ---

79.Bl -tag -width bit_7 -compact
80.It bit 7
81Always one.
82.It bit 6..3
83Always zero.
84.It bit 2
85Left button status; cleared if pressed, otherwise set.
86.It bit 1
28.\"
29.Dd December 3, 1997
30.Dt MOUSE 4
31.Os FreeBSD
32.Sh NAME
33.Nm mouse
34.Nd mouse and pointing device drivers
35.Sh SYNOPSIS

--- 43 unchanged lines hidden (view full) ---

79.Bl -tag -width bit_7 -compact
80.It bit 7
81Always one.
82.It bit 6..3
83Always zero.
84.It bit 2
85Left button status; cleared if pressed, otherwise set.
86.It bit 1
87Middle button status; cleared if pressed, otherwise set. Always one,
87Middle button status; cleared if pressed, otherwise set.
88Always one,
88if the device does not have the middle button.
89.It bit 0
90Right button status; cleared if pressed, otherwise set.
91.El
92.It Byte 2
93The first half of horizontal movement count in two's complement;
94-128 through 127.
95.It Byte 3
96The first half of vertical movement count in two's complement;
97-128 through 127.
98.It Byte 4
99The second half of the horizontal movement count in two's complement;
100-128 through 127. To obtain the full horizontal movement count, add
101the byte 2 and 4.
102.It Byte 5
103The second half of the vertical movement count in two's complement;
104-128 through 127. To obtain the full vertical movement count, add
105the byte 3 and 5.
106.It Byte 6
89if the device does not have the middle button.
90.It bit 0
91Right button status; cleared if pressed, otherwise set.
92.El
93.It Byte 2
94The first half of horizontal movement count in two's complement;
95-128 through 127.
96.It Byte 3
97The first half of vertical movement count in two's complement;
98-128 through 127.
99.It Byte 4
100The second half of the horizontal movement count in two's complement;
101-128 through 127. To obtain the full horizontal movement count, add
102the byte 2 and 4.
103.It Byte 5
104The second half of the vertical movement count in two's complement;
105-128 through 127. To obtain the full vertical movement count, add
106the byte 3 and 5.
107.It Byte 6
107The bit 7 is always zero. The lower 7 bits encode the first half of
108The bit 7 is always zero.
109The lower 7 bits encode the first half of
108Z axis movement count in two's complement; -64 through 63.
109.It Byte 7
110Z axis movement count in two's complement; -64 through 63.
111.It Byte 7
110The bit 7 is always zero. The lower 7 bits encode the second half of
112The bit 7 is always zero.
113The lower 7 bits encode the second half of
111the Z axis movement count in two's complement; -64 through 63.
112To obtain the full Z axis movement count, add the byte 6 and 7.
113.It Byte 8
114the Z axis movement count in two's complement; -64 through 63.
115To obtain the full Z axis movement count, add the byte 6 and 7.
116.It Byte 8
114The bit 7 is always zero. The bits 0 through 6 reflect the state
117The bit 7 is always zero.
118The bits 0 through 6 reflect the state
115of the buttons 4 through 10.
119of the buttons 4 through 10.
116If a button is pressed, the corresponding bit is cleared. Otherwise
120If a button is pressed, the corresponding bit is cleared.
121Otherwise
117the bit is set.
118.El
119.Pp
120The first 5 bytes of this format is compatible with the MouseSystems
122the bit is set.
123.El
124.Pp
125The first 5 bytes of this format is compatible with the MouseSystems
121format. The additional 3 bytes have their MSBs always set to zero.
126format.
127The additional 3 bytes have their MSBs always set to zero.
122Thus, if the user program can interpret the MouseSystems data format and
123tries to find the first byte of the format by detecting the bit pattern
12410000xxxb,
125it will discard the additional bytes, thus, be able to decode x, y
126and states of 3 buttons correctly.
127.Pp
128Device drivers may offer operation levels higher than one.
129Refer to manual pages of individual drivers for details.
130.Sh IOCTLS
131The following
132.Xr ioctl 2
128Thus, if the user program can interpret the MouseSystems data format and
129tries to find the first byte of the format by detecting the bit pattern
13010000xxxb,
131it will discard the additional bytes, thus, be able to decode x, y
132and states of 3 buttons correctly.
133.Pp
134Device drivers may offer operation levels higher than one.
135Refer to manual pages of individual drivers for details.
136.Sh IOCTLS
137The following
138.Xr ioctl 2
133commands are defined for the mouse drivers. The degree of support
134varies from one driver to another. This section gives general
139commands are defined for the mouse drivers.
140The degree of support
141varies from one driver to another.
142This section gives general
135description of the commands.
136Refer to manual pages of individual drivers for specific details.
137.Pp
138.Bl -tag -width MOUSE -compact
139.It Dv MOUSE_GETLEVEL Ar int *level
140.It Dv MOUSE_SETLEVEL Ar int *level
141These commands manipulate the operation level of the mouse driver.
142.Pp

--- 11 unchanged lines hidden (view full) ---

154 int type; /* mouse/track ball/pad... */
155 int model; /* I/F dependent model ID */
156 int hwid; /* I/F dependent hardware ID */
157} mousehw_t;
158.Ed
159.Pp
160The
161.Dv buttons
143description of the commands.
144Refer to manual pages of individual drivers for specific details.
145.Pp
146.Bl -tag -width MOUSE -compact
147.It Dv MOUSE_GETLEVEL Ar int *level
148.It Dv MOUSE_SETLEVEL Ar int *level
149These commands manipulate the operation level of the mouse driver.
150.Pp

--- 11 unchanged lines hidden (view full) ---

162 int type; /* mouse/track ball/pad... */
163 int model; /* I/F dependent model ID */
164 int hwid; /* I/F dependent hardware ID */
165} mousehw_t;
166.Ed
167.Pp
168The
169.Dv buttons
162field holds the number of buttons detected by the driver. The driver
170field holds the number of buttons detected by the driver.
171The driver
163may put an arbitrary value, such as two, in this field, if it cannot
164determine the exact number.
165.Pp
166The
167.Dv iftype
168is the type of interface:
169.Dv MOUSE_IF_SERIAL ,
170.Dv MOUSE_IF_BUS ,

--- 19 unchanged lines hidden (view full) ---

190may be
191.Dv MOUSE_MODEL_GENERIC
192or one of
193.Dv MOUSE_MODEL_XXX
194constants.
195.Pp
196The
197.Dv hwid
172may put an arbitrary value, such as two, in this field, if it cannot
173determine the exact number.
174.Pp
175The
176.Dv iftype
177is the type of interface:
178.Dv MOUSE_IF_SERIAL ,
179.Dv MOUSE_IF_BUS ,

--- 19 unchanged lines hidden (view full) ---

199may be
200.Dv MOUSE_MODEL_GENERIC
201or one of
202.Dv MOUSE_MODEL_XXX
203constants.
204.Pp
205The
206.Dv hwid
198is the ID value returned by the pointing device. It
207is the ID value returned by the pointing device.
208It
199depend on the interface type; refer to the manual page of
200specific mouse drivers for possible values.
201.Pp
202.It Dv MOUSE_GETMODE Ar mousemode_t *mode
203The command reports the current operation parameters of the mouse driver.
204.Bd -literal
205typedef struct mousemode {
206 int protocol; /* MOUSE_PROTO_XXX */

--- 39 unchanged lines hidden (view full) ---

246The size depends on the interface type, the device type and model, the
247protocol and the operation level of the driver.
248.Pp
249The array
250.Dv syncmask
251holds a bit mask and pattern to detect the first byte of the
252data packet.
253.Dv syncmask[0]
209depend on the interface type; refer to the manual page of
210specific mouse drivers for possible values.
211.Pp
212.It Dv MOUSE_GETMODE Ar mousemode_t *mode
213The command reports the current operation parameters of the mouse driver.
214.Bd -literal
215typedef struct mousemode {
216 int protocol; /* MOUSE_PROTO_XXX */

--- 39 unchanged lines hidden (view full) ---

256The size depends on the interface type, the device type and model, the
257protocol and the operation level of the driver.
258.Pp
259The array
260.Dv syncmask
261holds a bit mask and pattern to detect the first byte of the
262data packet.
263.Dv syncmask[0]
254is the bit mask to be ANDed with a byte. If the result is equal to
264is the bit mask to be ANDed with a byte.
265If the result is equal to
255.Dv syncmask[1] ,
256the byte is likely to be the first byte of the data packet.
257Note that this method of detecting the first byte is not 100% reliable,
258thus, should be taken only as an advisory measure.
259.Pp
260.It Dv MOUSE_SETMODE Ar mousemode_t *mode
261The command changes the current operation parameters of the mouse driver
262as specified in
263.Ar mode .
264Only
265.Dv rate ,
266.Dv resolution ,
267.Dv level
268and
269.Dv accelfactor
266.Dv syncmask[1] ,
267the byte is likely to be the first byte of the data packet.
268Note that this method of detecting the first byte is not 100% reliable,
269thus, should be taken only as an advisory measure.
270.Pp
271.It Dv MOUSE_SETMODE Ar mousemode_t *mode
272The command changes the current operation parameters of the mouse driver
273as specified in
274.Ar mode .
275Only
276.Dv rate ,
277.Dv resolution ,
278.Dv level
279and
280.Dv accelfactor
270may be modifiable. Setting values in the other field does not generate
281may be modifiable.
282Setting values in the other field does not generate
271error and has no effect.
272.Pp
273If you do not want to change the current setting of a field, put -1
274there.
275You may also put zero in
276.Dv resolution
277and
278.Dv rate ,

--- 74 unchanged lines hidden (view full) ---

353If the mouse has moved since the last call, the
354.Dv MOUSE_POSCHANGED
355bit in the
356.Dv flags
357field will also be set.
358.Pp
359The other fields hold movement counts since the last
360.Dv MOUSE_GETSTATUS
283error and has no effect.
284.Pp
285If you do not want to change the current setting of a field, put -1
286there.
287You may also put zero in
288.Dv resolution
289and
290.Dv rate ,

--- 74 unchanged lines hidden (view full) ---

365If the mouse has moved since the last call, the
366.Dv MOUSE_POSCHANGED
367bit in the
368.Dv flags
369field will also be set.
370.Pp
371The other fields hold movement counts since the last
372.Dv MOUSE_GETSTATUS
361call. The internal counters will be reset after every call to this
373call.
374The internal counters will be reset after every call to this
362command.
363.El
364.Sh FILES
365.Bl -tag -width /dev/sysmouseXX -compact
366.It Pa /dev/cuaa%d
367serial ports
368.It Pa /dev/mse%d
369bus and InPort mouse device

--- 18 unchanged lines hidden ---
375command.
376.El
377.Sh FILES
378.Bl -tag -width /dev/sysmouseXX -compact
379.It Pa /dev/cuaa%d
380serial ports
381.It Pa /dev/mse%d
382bus and InPort mouse device

--- 18 unchanged lines hidden ---