NetBSD/share/man/man4/man4.i386/busmouse.4

83 lines
2.9 KiB
Groff
Raw Normal View History

.\" $NetBSD: busmouse.4,v 1.7 2000/07/05 16:13:48 msaitoh Exp $
.\"
.\" Copyright (c) 1996 Michael Graff
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\" 3. All advertising materials mentioning features or use of this software
.\" must display the following acknowledgement:
.\" This product includes software developed by Michael Graff for the
.\" NetBSD Foundation, Inc.
1999-04-07 00:24:37 +04:00
.\" 4. The name of the author may not be used to endorse or promote products
.\" derived from this software without specific prior written permission
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
.Dd March 12, 1997
1998-03-09 08:52:57 +03:00
.Dt BUSMOUSE 4 i386
.Os
.Sh NAME
.Nm busmouse
.Nd Bus mouse driver
.Sh SYNOPSIS
.Fd #include <machine/mouse.h>
.Sh DESCRIPTION
Many mouse drivers internally convert the protocol
the mouse uses natively to a common busmouse protocol.
.Pp
The drivers allow information to be retrieved from the driver using an
.Xr ioctl 2
call or by reading the device directly using
.Xr read 2 .
.Pp
The
.Dv MOUSEIOCREAD
.Xr ioctl 2
is defined in the header
.Aq Pa machine/mouse.h .
It returns a
.Li struct mouseinfo .
.Pp
When reading the mouse device directly, each change of button state or
mouse movement generates a five byte event.
The bytes contain:
.Bl -tag -width -offset indent -compact
.It 1
Button status. (u_char)
.It 2
Right/left movement. Positive values indicate right, negative
left. (char)
.It 3
Up/down movement. Positive values indicate up, negative down. (char)
.It 4
Reserved. Should be zero. (char)
.It 5
Reserved. Should be zero. (char)
.El
.Pp
The direction bytes are signed characters, giving a range of +127 to -127.
A positive value indicates movement to the right or up, and a negative
value movement left or down.
.Sh SEE ALSO
.Xr ioctl 2 ,
.Xr read 2 ,
.Xr lms 4 ,
.Xr mms 4 ,
.Xr pms 4