[BACK]Return to wsmouse.9 CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / share / man / man9

File: [cvs.NetBSD.org] / src / share / man / man9 / wsmouse.9 (download)

Revision 1.16, Wed Apr 30 13:10:59 2008 UTC (15 years, 11 months ago) by martin
Branch: MAIN
CVS Tags: yamt-pf42-base4, yamt-pf42-base3, yamt-pf42-base2, wrstuden-revivesa-base-3, wrstuden-revivesa-base-2, wrstuden-revivesa-base-1, wrstuden-revivesa-base, wrstuden-revivesa, uebayasi-xip-base6, uebayasi-xip-base5, uebayasi-xip-base4, uebayasi-xip-base3, uebayasi-xip-base2, uebayasi-xip-base1, uebayasi-xip, netbsd-5-base, netbsd-5-2-RELEASE, netbsd-5-2-RC1, netbsd-5-2-3-RELEASE, netbsd-5-2-2-RELEASE, netbsd-5-2-1-RELEASE, netbsd-5-2, netbsd-5-1-RELEASE, netbsd-5-1-RC4, netbsd-5-1-RC3, netbsd-5-1-RC2, netbsd-5-1-RC1, netbsd-5-1-5-RELEASE, netbsd-5-1-4-RELEASE, netbsd-5-1-3-RELEASE, netbsd-5-1-2-RELEASE, netbsd-5-1-1-RELEASE, netbsd-5-1, netbsd-5-0-RELEASE, netbsd-5-0-RC4, netbsd-5-0-RC3, netbsd-5-0-RC2, netbsd-5-0-RC1, netbsd-5-0-2-RELEASE, netbsd-5-0-1-RELEASE, netbsd-5-0, netbsd-5, mjf-devfs2-base, matt-premerge-20091211, matt-nb5-pq3-base, matt-nb5-pq3, matt-nb5-mips64-u2-k2-k4-k7-k8-k9, matt-nb5-mips64-u1-k1-k5, matt-nb5-mips64-premerge-20101231, matt-nb5-mips64-premerge-20091211, matt-nb5-mips64-k15, matt-nb5-mips64, matt-nb4-mips64-k7-u2a-k9b, matt-mips64-base2, jym-xensuspend-nbase, jym-xensuspend-base, jym-xensuspend, hpcarm-cleanup-nbase
Changes since 1.15: +1 -8 lines

Convert TNF licenses to new 2 clause variant

.\"     $NetBSD: wsmouse.9,v 1.16 2008/04/30 13:10:59 martin Exp $
.\"
.\" Copyright (c) 2001 The NetBSD Foundation, Inc.
.\" All rights reserved.
.\"
.\" This code is derived from software contributed to The NetBSD Foundation
.\" by Gregory McGarry.
.\"
.\" 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.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
.\" ``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 FOUNDATION OR CONTRIBUTORS
.\" 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 November 12, 2006
.Dt WSMOUSE 9
.Os
.Sh NAME
.Nm wsmouse ,
.Nm wsmouse_input ,
.Nm wsmousedevprint
.Nd wscons mouse support
.Sh SYNOPSIS
.In dev/wscons/wsconsio.h
.In dev/wscons/wsmousevar.h
.Ft void
.Fn wsmouse_input "struct device *msdev" "u_int btns" \
"int x" "int y" "int z" "int w" "u_int flags"
.Ft int
.Fn wsmousedevprint "void *aux" "const char *pnp"
.Sh DESCRIPTION
The
.Nm
module is a component of the
.Xr wscons 9
framework to provide machine-independent mouse support.
Most of the support is provided by the
.Xr wsmouse 4
device driver, which must be a child of the hardware device driver.
.Sh DATA TYPES
Mouse drivers providing support for wscons pointer devices will make use
of the following data types:
.Bl -tag -width compact
.It Fa struct wsmouse_accessops
A structure used to specify the mouse access functions.
All pointer devices must provide this structure and pass it to the
.Xr wsmouse 4
child device.
It has the following members:
.Bd -literal
	int	(*enable)(void *);
	int	(*ioctl)(void *v, u_long cmd, void *data,
			int flag, struct lwp *l);
	void	(*disable)(void *);
.Ed
.Pp
The
.Fa enable
member defines the function to be called to enable monitoring pointer
movements and passing these events to
wscons.
The
.Fa disable
member defines the function to disable movement events.
The
.Fa ioctl
member defines the function to be called to perform mouse-specific
ioctl calls.
.Pp
There is a
.Fa void *
cookie provided by the mouse driver associated with these functions,
which is passed to them when they are invoked.
.It Fa struct wsmousedev_attach_args
A structure used to attach the
.Xr wsmouse 4
child device.
It has the following members:
.Bd -literal
	const struct wsmouse_accessops *accessops;
	void *accesscookie;
.Ed
.El
.Sh FUNCTIONS
.Bl -tag -width compact
.It Fn wsmouse_input "msdev" "btns" "x" "y" "z" "w" "flags"
Callback from the mouse driver to the wsmouse interface driver.
Arguments are as follows:
.Bl -tag -width msdev -compact
.It Fa msdev
This is the
.Fa struct device
pointer passed from
.Fn config_found
on attaching the child
.Xr wsmouse 4
to specify the mouse device.
.It Fa btns
This specifies the current button status.
Bits for pressed buttons (which will cause the
.Dv WSCONS_EVENT_MOUSE_DOWN
event on
.Xr wsmouse 4
device) should be set, and bits for released buttons (which will cause the
.Dv WSCONS_EVENT_MOUSE_UP
event) should be zero.
The left most button state should be in LSB,
i.e. for typical three button mouse,
the left button is 0x01,
the middle button is 0x02,
and the right button is 0x04.
.It Fa x
Absolute or relative X-axis value to specify the pointer coordinate.
Rightward (moving the mouse right) is positive.
.It Fa y
Absolute or relative Y-axis value to specify the pointer coordinate.
Upward (moving the mouse forward) is positive.
Note that this aspect is opposite from the one used in the X server dix layer.
.It Fa z
Absolute or relative Z-axis value to specify the pointer coordinate.
Usually this axis is used for the wheel.
Downward (turning the wheel backward) is positive.
.It Fa w
Absolute or relative W-axis value to specify the pointer coordinate.
Usually this axis would be used for the horizontal component of the wheel.
.It Fa flags
This argument specifies whether the pointer device and the measurement
of the
.Fa x ,
.Fa y ,
.Fa z ,
and
.Fa w
axes is in relative or absolute mode.
Valid values for
.Fa flags
are:
.Bl -tag -width compact
.It WSMOUSE_INPUT_DELTA
Relative mode.
.It WSMOUSE_INPUT_ABSOLUTE_X
Absolute mode in
.Fa x
axis.
.It WSMOUSE_INPUT_ABSOLUTE_Y
Absolute mode in
.Fa y
axis.
.It WSMOUSE_INPUT_ABSOLUTE_Z
Absolute mode in
.Fa z
axis.
.It WSMOUSE_INPUT_ABSOLUTE_W
Absolute mode in
.Fa w
axis.
.El
.El
.It Fn wsmousedevprint "aux" "pnp"
The default wsmouse printing routine used by
.Fn config_found .
(see
.Xr autoconf 9 ) .
.El
.Sh AUTOCONFIGURATION
Mouse drivers which want to use the wsmouse module must be a
parent to the
.Xr wsmouse 4
device and provide an attachment interface.
To attach the
.Xr wsmouse 4
device, the mouse driver must allocate and populate a
.Fa wsmousedev_attach_args
structure with the supported operations and callbacks and call
.Fn config_found
to perform the attach (see
.Xr autoconf 9 ) .
.Sh OPERATION
When a mouse-movement event is received, the device driver must
perform any necessary movement decoding to wscons events and pass the
events to wscons via
.Fn wsmouse_input .
.Pp
The wscons framework calls back into the hardware driver by invoking
the functions that are specified in the
.Em accessops
structure.
The
.Fn enable
and
.Fn disable
functions are relatively simple and self-explanatory.
The
.Fn ioctl
function is called by the wscons interface to perform
mouse-specific ioctl operations (see
.Xr ioctl 2 ) .
The argument
.Fa cmd
to the
.Fn ioctl
function specifies the specific command to perform using the data
.Fa data .
Valid commands are listed in
.Pa sys/dev/wscons/wsconsio.h .
.Sh CODE REFERENCES
This section describes places within the
.Nx
source tree where actual code implementing or using the
machine-independent wscons subsystem can be found.
All pathnames are relative to
.Pa /usr/src .
.Pp
The wscons subsystem is implemented within the directory
.Pa sys/dev/wscons .
The
.Nm
module itself is implement within the file
.Pa sys/dev/wscons/wsmouse.c .
.Xr ioctl 2
operations are listed in
.Pa sys/dev/wscons/wsconsio.h .
.Sh SEE ALSO
.Xr ioctl 2 ,
.Xr pms 4 ,
.Xr wscons 4 ,
.Xr wsmouse 4 ,
.Xr autoconf 9 ,
.Xr driver 9 ,
.Xr intro 9 ,
.Xr wscons 9 ,
.Xr wsdisplay 9 ,
.Xr wskbd 9