1.\" $NetBSD: wsmouse.4,v 1.22 2012/05/27 12:05:40 wiz Exp $ 2.\" 3.\" Copyright (c) 1999 4.\" Matthias Drochner. All rights reserved. 5.\" 6.\" Copyright (c) 2006 7.\" Julio M. Merino Vidal. All rights reserved. 8.\" 9.\" Redistribution and use in source and binary forms, with or without 10.\" modification, are permitted provided that the following conditions 11.\" are met: 12.\" 1. Redistributions of source code must retain the above copyright 13.\" notice, this list of conditions and the following disclaimer. 14.\" 2. Redistributions in binary form must reproduce the above copyright 15.\" notice, this list of conditions and the following disclaimer in the 16.\" documentation and/or other materials provided with the distribution. 17.\" 18.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 19.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 22.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28.\" SUCH DAMAGE. 29.\" 30.Dd May 27, 2012 31.Dt WSMOUSE 4 32.Os 33.Sh NAME 34.Nm wsmouse 35.Nd generic mouse support in wscons 36.Sh SYNOPSIS 37.Cd "wsmouse* at pms? mux 0" 38(PS/2 mouse, including ``IntelliMouse''-compatible wheel mice) 39.Cd "wsmouse* at ums? mux 0" 40(USB mouse) 41.Cd "wsmouse* at uts? mux 0" 42(USB touchscreen) 43.Cd "wsmouse* at lms? mux 0" 44(Logitech bus mouse, i386 only) 45.Cd "wsmouse* at mms? mux 0" 46(Microsoft InPort mouse, i386 only) 47.Cd "wsmouse0 at ams? mux 0" 48(Apple ADB mouse) 49.Cd "wsmouse* at btms? mux 0" 50(Bluetooth mouse) 51.Cd "wsmouse* at lkms? mux 0" 52(DEC VSXXX serial mice) 53.Sh DESCRIPTION 54The 55.Nm 56driver is an abstraction layer for mice within the 57.Xr wscons 4 58framework. 59It is attached to the hardware specific mouse drivers and 60provides a character device interface which returns 61.Fa struct wscons_event 62via 63.Xr read 2 . 64For use with X servers, 65.Dq mouse events 66can be generated. 67.Pp 68The 69.Xr wsconsctl 8 70utility gives access to several configurable details that affect this 71driver. 72.Ss Ioctls 73The following 74.Xr ioctl 2 75calls are provided by the 76.Nm 77driver or by devices which use it. 78Their definitions are found in 79.Pa dev/wscons/wsconsio.h . 80.Bl -tag -width Dv 81.It Dv WSMOUSEIO_GETREPEAT Pq Li "struct wsmouse_repeat" 82Retrieve the current automatic button repeating configuration. 83The structure returned is as follows: 84.Bd -literal -offset indent 85struct wsmouse_repeat { 86 unsigned long wr_buttons; 87 unsigned int wr_delay_first; 88 unsigned int wr_delay_decrement; 89 unsigned int wr_delay_minimum; 90}; 91.Ed 92.Pp 93The 94.Va wr_buttons 95field is a bit mask that specifies which buttons send press and 96release events periodically while they are physically held down. 97The least significant bit corresponds to button 0. 98.Pp 99The other three fields describe the frequency upon which these 100automatic events are sent. 101.Va wr_delay_first 102specifies the milliseconds before the first repeated event is sent. 103.Va wr_delay_decrement 104is used to calculate the delay between the most recently generated 105event and the forthcoming one: the previous delay is taken and it is 106decreased by the value given in this variable. 107.Va wr_delay_minimum 108specifies the minimum delay, in milliseconds, between two consecutive 109events. 110.Pp 111.It Dv WSMOUSEIO_SETREPEAT Pq Li "struct wsmouse_repeat" 112Set the automatic button repeating configuration. 113See 114.Dv WSMOUSEIO_GETREPEAT 115above for more details. 116.It Dv WSMOUSEIO_SETVERSION Pq Li "int" 117Set the wscons_event protocol version. 118The default is 0 for binary compatibility. 119The latest version is 120always available as 121.Dv WSMOUSE_EVENT_VERSION , 122and is currently 1. 123All new code should use a call similar to the below to ensure the 124correct version is returned. 125.Bd -literal -offset indent 126int ver = WSMOUSE_EVENT_VERSION; 127if (ioctl(fd, WSMOUSEIO_SETVERSION, &ver) == -1) 128 err(EXIT_FAILURE, "cannot set version"); 129.Ed 130.El 131.Sh FILES 132.Bl -item 133.It 134.Pa /dev/wsmouse* 135.It 136.Pa /usr/include/dev/wscons/wsconsio.h . 137.El 138.Sh SEE ALSO 139.Xr btms 4 , 140.Xr lms 4 , 141.Xr mms 4 , 142.Xr pms 4 , 143.Xr uep 4 , 144.Xr ums 4 , 145.Xr uts 4 , 146.Xr wscons 4 , 147.Xr wsmux 4 , 148.Xr moused 8 , 149.Xr wsconsctl 8 , 150.Xr wsmoused 8 , 151.Xr wsmouse 9 152