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