1*55107Storek /* 2*55107Storek * Copyright (c) 1992 The Regents of the University of California. 3*55107Storek * All rights reserved. 4*55107Storek * 5*55107Storek * This software was developed by the Computer Systems Engineering group 6*55107Storek * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and 7*55107Storek * contributed to Berkeley. 8*55107Storek * 9*55107Storek * %sccs.include.redist.c% 10*55107Storek * 11*55107Storek * @(#)vuid_event.h 7.1 (Berkeley) 07/13/92 12*55107Storek * 13*55107Storek * from: $Header: vuid_event.h,v 1.3 92/06/17 05:35:51 torek Exp $ (LBL) 14*55107Storek */ 15*55107Storek 16*55107Storek /* 17*55107Storek * The following is a minimal emulation of Sun's `Firm_event' structures 18*55107Storek * and related operations necessary to make X11 happy (i.e., make it 19*55107Storek * compile, and make old X11 binaries run). 20*55107Storek */ 21*55107Storek typedef struct firm_event { 22*55107Storek u_short id; /* key or MS_* or LOC_[XY]_DELTA */ 23*55107Storek u_short pad; /* unused, at least by X11 */ 24*55107Storek int value; /* VKEY_{UP,DOWN} or locator delta */ 25*55107Storek struct timeval time; 26*55107Storek } Firm_event; 27*55107Storek 28*55107Storek /* 29*55107Storek * Special `id' fields. These weird numbers simply match the old binaries. 30*55107Storek * Others are in 0..0x7f and are keyboard key numbers (keyboard dependent!). 31*55107Storek */ 32*55107Storek #define MS_LEFT 0x7f20 /* left mouse button */ 33*55107Storek #define MS_MIDDLE 0x7f21 /* middle mouse button */ 34*55107Storek #define MS_RIGHT 0x7f22 /* right mouse button */ 35*55107Storek #define LOC_X_DELTA 0x7f80 /* mouse delta-X */ 36*55107Storek #define LOC_Y_DELTA 0x7f81 /* mouse delta-Y */ 37*55107Storek 38*55107Storek /* 39*55107Storek * Special `value' fields. These apply to keys and mouse buttons. The 40*55107Storek * value of a mouse delta is the delta. Note that positive deltas are 41*55107Storek * left and up (not left and down as you might expect). 42*55107Storek */ 43*55107Storek #define VKEY_UP 0 /* key or button went up */ 44*55107Storek #define VKEY_DOWN 1 /* key or button went down */ 45*55107Storek 46*55107Storek /* 47*55107Storek * The following ioctls are clearly intended to take things in and out 48*55107Storek * of `firm event' mode. Since we always run in this mode (as far as 49*55107Storek * /dev/kbd and /dev/mouse are concerned, anyway), we always claim to 50*55107Storek * be in this mode and reject anything else. 51*55107Storek */ 52*55107Storek #define VUIDSFORMAT _IOW('v', 1, int) 53*55107Storek #define VUIDGFORMAT _IOR('v', 2, int) 54*55107Storek #define VUID_FIRM_EVENT 1 /* the only format we support */ 55