xref: /netbsd/sys/arch/shark/include/mouse.h (revision 80675955)
1*80675955Sthorpej /*	$NetBSD: mouse.h,v 1.1 2002/02/10 01:57:29 thorpej Exp $	*/
2*80675955Sthorpej 
3*80675955Sthorpej /*
4*80675955Sthorpej  * Copyright (c) Mark Brinicombe 1996 All rights reserved
5*80675955Sthorpej  * Copyright (c) Scott Stevens 1995 All rights reserved
6*80675955Sthorpej  * Copyright (c) Melvin Tang-Richardson 1995 All rights reserved
7*80675955Sthorpej  *
8*80675955Sthorpej  * Redistribution and use in source and binary forms, with or without
9*80675955Sthorpej  * modification, are permitted provided that the following conditions
10*80675955Sthorpej  * are met:
11*80675955Sthorpej  * 1. Redistributions of source code must retain the above copyright
12*80675955Sthorpej  *    notice, this list of conditions and the following disclaimer.
13*80675955Sthorpej  * 2. Redistributions in binary form must reproduce the above copyright
14*80675955Sthorpej  *    notice, this list of conditions and the following disclaimer in the
15*80675955Sthorpej  *    documentation and/or other materials provided with the distribution.
16*80675955Sthorpej  * 3. All advertising materials mentioning features or use of this software
17*80675955Sthorpej  *    must display the following acknowledgement:
18*80675955Sthorpej  *	This product includes software developed by the RiscBSD team.
19*80675955Sthorpej  * 4. The name of the author may not be used to endorse or promote products
20*80675955Sthorpej  *    derived from this software without specific prior written permission.
21*80675955Sthorpej  *
22*80675955Sthorpej  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
23*80675955Sthorpej  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
24*80675955Sthorpej  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
25*80675955Sthorpej  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
26*80675955Sthorpej  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
27*80675955Sthorpej  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28*80675955Sthorpej  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29*80675955Sthorpej  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30*80675955Sthorpej  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
31*80675955Sthorpej  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32*80675955Sthorpej  */
33*80675955Sthorpej 
34*80675955Sthorpej /*
35*80675955Sthorpej #define MOUSE_BUTTON_RIGHT  0x10
36*80675955Sthorpej #define MOUSE_BUTTON_MIDDLE 0x20
37*80675955Sthorpej #define MOUSE_BUTTON_LEFT   0x40
38*80675955Sthorpej */
39*80675955Sthorpej 
40*80675955Sthorpej /* Used in pms.c */
41*80675955Sthorpej 
42*80675955Sthorpej #define BUTSTATMASK	0x07	/* Any mouse button down if any bit set */
43*80675955Sthorpej #define BUTCHNGMASK	0x38	/* Any mouse button changed if any bit set */
44*80675955Sthorpej 
45*80675955Sthorpej #define BUT3STAT	0x01	/* Button 3 down if set */
46*80675955Sthorpej #define BUT2STAT	0x02	/* Button 2 down if set */
47*80675955Sthorpej #define BUT1STAT	0x04	/* Button 1 down if set */
48*80675955Sthorpej #define BUT3CHNG	0x08	/* Button 3 changed if set */
49*80675955Sthorpej #define BUT2CHNG	0x10	/* Button 2 changed if set */
50*80675955Sthorpej #define BUT1CHNG	0x20	/* Button 1 changed if set */
51*80675955Sthorpej #define MOVEMENT	0x40	/* Mouse movement detected */
52*80675955Sthorpej #define IOC_ACK		0x80	/* Acknowledge an ioctl */
53*80675955Sthorpej 
54*80675955Sthorpej /* Define user visible mouse structures */
55*80675955Sthorpej 
56*80675955Sthorpej struct mouseinfo {
57*80675955Sthorpej 	u_int status;
58*80675955Sthorpej 	int xmotion, ymotion;
59*80675955Sthorpej };
60*80675955Sthorpej 
61*80675955Sthorpej struct mousebufrec {
62*80675955Sthorpej 	int status;
63*80675955Sthorpej 	int x,y;
64*80675955Sthorpej 	struct timeval event_time;
65*80675955Sthorpej };
66*80675955Sthorpej 
67*80675955Sthorpej struct mouse_state {
68*80675955Sthorpej 	signed short x, y;
69*80675955Sthorpej 	int buttons;
70*80675955Sthorpej };
71*80675955Sthorpej 
72*80675955Sthorpej struct mouse_boundingbox {
73*80675955Sthorpej 	int x, y, a, b;
74*80675955Sthorpej };
75*80675955Sthorpej 
76*80675955Sthorpej struct mouse_origin {
77*80675955Sthorpej 	int x, y;
78*80675955Sthorpej };
79*80675955Sthorpej 
80*80675955Sthorpej /* Define mouse ioctls + associated data */
81*80675955Sthorpej 
82*80675955Sthorpej #define MOUSEIOC_WRITEX		_IO ( 'M', 100 )
83*80675955Sthorpej #define MOUSEIOC_WRITEY		_IO ( 'M', 101 )
84*80675955Sthorpej 
85*80675955Sthorpej #define MOUSEIOC_SETSTATE	_IOW ( 'M', 102, struct mouse_state )
86*80675955Sthorpej #define MOUSEIOC_SETBOUNDS	_IOW ( 'M', 103, struct mouse_boundingbox )
87*80675955Sthorpej #define MOUSEIOC_SETORIGIN	_IOW ( 'M', 104, struct mouse_origin )
88*80675955Sthorpej 
89*80675955Sthorpej #define MOUSEIOC_GETSTATE	_IOR ( 'M', 105, struct mouse_state )
90*80675955Sthorpej #define MOUSEIOC_READ		MOUSEIOC_GETSTATE
91*80675955Sthorpej #define MOUSEIOC_GETBOUNDS	_IOR ( 'M', 106, struct mouse_boundingbox )
92*80675955Sthorpej #define MOUSEIOC_GETORIGIN	_IOR ( 'M', 107, struct mouse_origin )
93*80675955Sthorpej 
94*80675955Sthorpej #define MOUSEIOC_SETMODE	_IO ( 'M', 108 )
95*80675955Sthorpej #define MOUSEMODE_ABS		0x00
96*80675955Sthorpej #define MOUSEMODE_REL		0x01
97*80675955Sthorpej /* End of mouse.h */
98