MS(4)

NAME
ms - Atari mouse interface

SYNOPSIS
pseudo-device mouse 1

DESCRIPTION
The Atari mouse driver supports both the original Atari mouse and the third party 3-button mouse that has its middle button connected to the up-switch of the second joystick port. To accommodate X11 users with a standard mouse, the driver is able to emulate the middle button. See the section on ioctls for more info.

  Supported ioctls
MIOCS3B_EMUL
    This ioctl turns the middle button emulation on or off depending on its argument. The middle button event is triggered by simultaneously pressing the left and right buttons. The default emulation mode is on.

    Note that the emulation status is retained across multiple open/close calls.
MIOCG3B_EMUL
    This ioctl allows you to get the actual status of the emulation mode.

  Interface description
The Atari mouse interface works on a minimal emulation of Sun's Firm_event structures. The primary reason for this is easy interfacing with X11.

The movement and button events are read as structures of the form:

    typedef struct Firm_event {
    	u_int_16_t      id;       /* key or MS_* or LOC_[XY]_DELTA   */
    	u_int_16_t      pad;      /* unused                          */
    	int_16_t        value;    /* VKEY_{UP,DOWN} or locator delta */
    	struct timeval  time;     /* time stamp of the event         */
    }

The values of 'id' concerning the mouse:

    #define MS_LEFT         0x7f20    /* left mouse button   */
    #define MS_MIDDLE       0x7f21    /* middle mouse button */
    #define MS_RIGHT        0x7f22    /* right mouse button  */
    #define LOC_X_DELTA     0x7f80    /* mouse delta-X       */
    #define LOC_Y_DELTA     0x7f81    /* mouse delta-Y       */

The values of 'value' concerning a button event:

    #define VKEY_UP         0         /* a button went up   */
    #define VKEY_DOWN       1         /* a button went down */

FILES
/dev/mouse0
    The real mouse device
/dev/mouse
    The currently active mouse device

BUGS
The time interval that defines 'simultaneous' cannot be set.