MS(4) | Device Drivers Manual (atari) | MS(4) |
ms
— Atari mouse
interface
pseudo-device mouse 1
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.
Note that the emulation status is retained across multiple open/close calls.
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 */
The time interval that defines 'simultaneous' cannot be set.
October 16, 1995 | NetBSD 10.99 |