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