xref: /netbsd/sys/arch/shark/include/mouse.h (revision d8480905)
1*d8480905Sdholland /*	$NetBSD: mouse.h,v 1.3 2015/09/07 03:49:45 dholland Exp $	*/
280675955Sthorpej 
380675955Sthorpej /*
480675955Sthorpej  * Copyright (c) Mark Brinicombe 1996 All rights reserved
580675955Sthorpej  * Copyright (c) Scott Stevens 1995 All rights reserved
680675955Sthorpej  * Copyright (c) Melvin Tang-Richardson 1995 All rights reserved
780675955Sthorpej  *
880675955Sthorpej  * Redistribution and use in source and binary forms, with or without
980675955Sthorpej  * modification, are permitted provided that the following conditions
1080675955Sthorpej  * are met:
1180675955Sthorpej  * 1. Redistributions of source code must retain the above copyright
1280675955Sthorpej  *    notice, this list of conditions and the following disclaimer.
1380675955Sthorpej  * 2. Redistributions in binary form must reproduce the above copyright
1480675955Sthorpej  *    notice, this list of conditions and the following disclaimer in the
1580675955Sthorpej  *    documentation and/or other materials provided with the distribution.
1680675955Sthorpej  * 3. All advertising materials mentioning features or use of this software
1780675955Sthorpej  *    must display the following acknowledgement:
1880675955Sthorpej  *	This product includes software developed by the RiscBSD team.
1980675955Sthorpej  * 4. The name of the author may not be used to endorse or promote products
2080675955Sthorpej  *    derived from this software without specific prior written permission.
2180675955Sthorpej  *
2280675955Sthorpej  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
2380675955Sthorpej  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
2480675955Sthorpej  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
2580675955Sthorpej  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
2680675955Sthorpej  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
2780675955Sthorpej  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2880675955Sthorpej  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2980675955Sthorpej  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
3080675955Sthorpej  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
3180675955Sthorpej  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3280675955Sthorpej  */
3380675955Sthorpej 
34*d8480905Sdholland #include <sys/ioccom.h>
35*d8480905Sdholland 
3680675955Sthorpej /*
3780675955Sthorpej #define MOUSE_BUTTON_RIGHT  0x10
3880675955Sthorpej #define MOUSE_BUTTON_MIDDLE 0x20
3980675955Sthorpej #define MOUSE_BUTTON_LEFT   0x40
4080675955Sthorpej */
4180675955Sthorpej 
42b430d917Swiz /* Used in opms.c */
4380675955Sthorpej 
4480675955Sthorpej #define BUTSTATMASK	0x07	/* Any mouse button down if any bit set */
4580675955Sthorpej #define BUTCHNGMASK	0x38	/* Any mouse button changed if any bit set */
4680675955Sthorpej 
4780675955Sthorpej #define BUT3STAT	0x01	/* Button 3 down if set */
4880675955Sthorpej #define BUT2STAT	0x02	/* Button 2 down if set */
4980675955Sthorpej #define BUT1STAT	0x04	/* Button 1 down if set */
5080675955Sthorpej #define BUT3CHNG	0x08	/* Button 3 changed if set */
5180675955Sthorpej #define BUT2CHNG	0x10	/* Button 2 changed if set */
5280675955Sthorpej #define BUT1CHNG	0x20	/* Button 1 changed if set */
5380675955Sthorpej #define MOVEMENT	0x40	/* Mouse movement detected */
5480675955Sthorpej #define IOC_ACK		0x80	/* Acknowledge an ioctl */
5580675955Sthorpej 
5680675955Sthorpej /* Define user visible mouse structures */
5780675955Sthorpej 
5880675955Sthorpej struct mouseinfo {
5980675955Sthorpej 	u_int status;
6080675955Sthorpej 	int xmotion, ymotion;
6180675955Sthorpej };
6280675955Sthorpej 
6380675955Sthorpej struct mousebufrec {
6480675955Sthorpej 	int status;
6580675955Sthorpej 	int x,y;
6680675955Sthorpej 	struct timeval event_time;
6780675955Sthorpej };
6880675955Sthorpej 
6980675955Sthorpej struct mouse_state {
7080675955Sthorpej 	signed short x, y;
7180675955Sthorpej 	int buttons;
7280675955Sthorpej };
7380675955Sthorpej 
7480675955Sthorpej struct mouse_boundingbox {
7580675955Sthorpej 	int x, y, a, b;
7680675955Sthorpej };
7780675955Sthorpej 
7880675955Sthorpej struct mouse_origin {
7980675955Sthorpej 	int x, y;
8080675955Sthorpej };
8180675955Sthorpej 
8280675955Sthorpej /* Define mouse ioctls + associated data */
8380675955Sthorpej 
8480675955Sthorpej #define MOUSEIOC_WRITEX		_IO ( 'M', 100 )
8580675955Sthorpej #define MOUSEIOC_WRITEY		_IO ( 'M', 101 )
8680675955Sthorpej 
8780675955Sthorpej #define MOUSEIOC_SETSTATE	_IOW ( 'M', 102, struct mouse_state )
8880675955Sthorpej #define MOUSEIOC_SETBOUNDS	_IOW ( 'M', 103, struct mouse_boundingbox )
8980675955Sthorpej #define MOUSEIOC_SETORIGIN	_IOW ( 'M', 104, struct mouse_origin )
9080675955Sthorpej 
9180675955Sthorpej #define MOUSEIOC_GETSTATE	_IOR ( 'M', 105, struct mouse_state )
9280675955Sthorpej #define MOUSEIOC_READ		MOUSEIOC_GETSTATE
9380675955Sthorpej #define MOUSEIOC_GETBOUNDS	_IOR ( 'M', 106, struct mouse_boundingbox )
9480675955Sthorpej #define MOUSEIOC_GETORIGIN	_IOR ( 'M', 107, struct mouse_origin )
9580675955Sthorpej 
9680675955Sthorpej #define MOUSEIOC_SETMODE	_IO ( 'M', 108 )
9780675955Sthorpej #define MOUSEMODE_ABS		0x00
9880675955Sthorpej #define MOUSEMODE_REL		0x01
9980675955Sthorpej /* End of mouse.h */
100