1.\" $NetBSD: ms.4,v 1.5 2009/10/20 19:10:10 snj Exp $ 2.\" 3.\" Copyright (c) 1995 Leo Weppelman 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: 9.\" 1. Redistributions of source code must retain the above copyright 10.\" notice, this list of conditions and the following disclaimer. 11.\" 2. Redistributions in binary form must reproduce the above copyright 12.\" notice, this list of conditions and the following disclaimer in the 13.\" documentation and/or other materials provided with the distribution. 14.\" 15.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 16.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 17.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 18.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 19.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25.\" 26.\" 27.Dd October 16, 1995 28.Dt MS 4 atari 29.Os 30.Sh NAME 31.Nm ms 32.Nd 33.Tn Atari 34mouse interface 35.Sh SYNOPSIS 36.Cd "pseudo-device mouse 1" 37.Sh DESCRIPTION 38The Atari mouse driver supports both the original Atari mouse and the third 39party 3-button mouse that has its middle button connected to the up-switch 40of the second joystick port. To accommodate X11 users with a standard mouse, 41the driver is able to emulate the middle button. See the section on ioctls 42for more info. 43.Ss Supported ioctls 44.Bl -tag -width MIOCG3B_EMUL -compact 45.It MIOCS3B_EMUL 46This ioctl turns the middle button emulation on or off depending on its 47argument. The middle button event is triggered by simultaneously pressing 48the left and right buttons. The default emulation mode is on. 49.Pp 50Note that the emulation status is retained across multiple open/close calls. 51.It MIOCG3B_EMUL 52This ioctl allows you to get the actual status of the emulation mode. 53.El 54.Ss Interface description 55The Atari mouse interface works on a minimal emulation of Sun's Firm_event 56structures. The primary reason for this is easy interfacing with X11. 57.Pp 58The movement and button events are read as structures of the form: 59.Bd -literal 60typedef struct Firm_event { 61 u_int_16_t id; /* key or MS_* or LOC_[XY]_DELTA */ 62 u_int_16_t pad; /* unused */ 63 int_16_t value; /* VKEY_{UP,DOWN} or locator delta */ 64 struct timeval time; /* time stamp of the event */ 65} 66.Ed 67.Pp 68The values of 'id' concerning the mouse: 69.Bd -literal 70#define MS_LEFT 0x7f20 /* left mouse button */ 71#define MS_MIDDLE 0x7f21 /* middle mouse button */ 72#define MS_RIGHT 0x7f22 /* right mouse button */ 73#define LOC_X_DELTA 0x7f80 /* mouse delta-X */ 74#define LOC_Y_DELTA 0x7f81 /* mouse delta-Y */ 75.Ed 76.Pp 77The values of 'value' concerning a button event: 78.Bd -literal 79#define VKEY_UP 0 /* a button went up */ 80#define VKEY_DOWN 1 /* a button went down */ 81.Ed 82.Sh FILES 83.Bl -tag -width /dev/mouse0 -compact 84.It Pa /dev/mouse0 85The real mouse device 86.It Pa /dev/mouse 87The currently active mouse device 88.El 89.Sh BUGS 90The time interval that defines 'simultaneous' cannot be set. 91