]> icculus.org git repositories - btb/d2x.git/blob - arch/include/mouse.h
do away with Mouse.buttons
[btb/d2x.git] / arch / include / mouse.h
1 /*
2 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
3 SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
4 END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
5 ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
6 IN USING, DISPLAYING,  AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
7 SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
8 FREE PURPOSES.  IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
9 CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES.  THE END-USER UNDERSTANDS
10 AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.  
11 COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION.  ALL RIGHTS RESERVED.
12 */
13
14 /*
15  *
16  * Header for mouse functions
17  *
18  *
19  */
20
21 #ifndef MOUSE_H
22 #define MOUSE_H
23
24 #include "pstypes.h"
25 #include "fix.h"
26
27
28 #define MOUSE_MAX_BUTTONS   16
29
30 #define MB_LEFT                 0
31 #define MB_RIGHT                1
32 #define MB_MIDDLE               2
33 #define MB_Z_UP                 3
34 #define MB_Z_DOWN               4
35 #define MB_PITCH_BACKWARD       5
36 #define MB_PITCH_FORWARD        6
37 #define MB_BANK_LEFT            7
38 #define MB_BANK_RIGHT           8
39 #define MB_HEAD_LEFT            9
40 #define MB_HEAD_RIGHT           10
41
42 #define MOUSE_LBTN 1
43 #define MOUSE_RBTN 2
44 #define MOUSE_MBTN 4
45
46 //========================================================================
47 // Check for mouse driver, reset driver if installed. returns number of
48 // buttons if driver is present.
49
50 #ifdef SVGALIB_INPUT
51 extern int d_mouse_init(int enable_cyberman); /* conflict with <vgamouse.h> */
52 #else
53 extern int mouse_init(int enable_cyberman);
54 #endif
55 /* changed from int to void */
56 extern void mouse_set_limits( int x1, int y1, int x2, int y2 );
57 extern void mouse_flush();      // clears all mice events...
58
59 //========================================================================
60 // Shutdowns mouse system.
61 #ifdef SVGALIB_INPUT
62 extern void d_mouse_close(); /* conflict with <vgamouse.h> */
63 #else
64 extern void mouse_close();
65 #endif
66
67 //========================================================================
68 extern void mouse_get_pos( int *x, int *y );
69 extern void mouse_get_delta( int *dx, int *dy );
70 #ifdef SDL_INPUT
71 extern void mouse_get_pos_z( int *x, int *y, int *z );
72 extern void mouse_get_delta_z( int *dx, int *dy, int *dz );
73 #endif
74 extern int mouse_get_btns();
75 extern void mouse_set_pos( int x, int y);
76 extern void mouse_get_cyberman_pos( int *x, int *y );
77
78 // Returns how long this button has been down since last call.
79 #define mouse_button_down_time(button) key_down_time(KEY_MB1 + (button))
80
81 // Returns how many times this button has went down since last call.
82 #define mouse_button_down_count(button) key_down_count(KEY_MB1 + (button))
83
84 // Returns 1 if this button is currently down
85 extern int mouse_button_state(int button);
86
87
88 #endif