/
mouse.h
94 lines (73 loc) · 2.51 KB
/
mouse.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
/* $Id$
* MegaZeux
*
* Copyright (C) 1996 Greg Janson
* Copyright (C) 1998 Matthew D. Williams - dbwilli@scsn.net
* Copyright (C) 1999 Charles Goetzman
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* Prototypes and declarations for MOUSE.CPP */
#ifndef __MOUSE_H
#define __MOUSE_H
//Code returned by getkey for mouse events
#define MOUSE_EVENT -513
//Size of mouse "click" ahead buffer
#define MOUSE_BUFFERSIZE 16
//Bit defines for mouse driver function 12 -- define handler
//Also used for mouse queue status
#define MOUSEMOVE 1
#define LEFTBPRESS 2
#define LEFTBRELEASE 4
#define RIGHTBPRESS 8
#define RIGHTBRELEASE 16
//Bits for button presses from button status function
#define LEFTBDOWN 1
#define RIGHTBDOWN 2
//Mouse information record
struct mouse_info_rec {
char buttonstat;
char cx,cy;
};
typedef struct mouse_info_rec mouse_info_rec;
extern char mousehidden;
extern unsigned int mouseinstalled;
extern char driver_activated;
extern volatile int mousex,mousey,mybutton;
extern volatile int mmx, mmy;
extern int mouse_count;
//Initialize the mouse routines
void m_init(void);
//Deinitialize the mouse routines
void m_deinit(void);
//Take a snapshot of current mouse state (in saved_mouse_x, etc)
void m_snapshot(void);
//Change the current video segment
void m_vidseg(unsigned int newseg);
//Hide the mouse cursor
void m_hide(void);
//Show the mouse cursor
void m_show(void);
//Move the mouse cursor
void m_move(int newx,int newy);
//Return non-0 if there are events waiting in the buffer
char m_check(void);
//Look at the next event in the buffer, but don't pull it out
void m_preview(mouse_info_rec *mir);
//Get and remove next event from the buffer
void m_get(mouse_info_rec *mir);
//Return the current status of the mouse buttons
int m_buttonstatus(void);
#endif