2 * $Logfile: /Freespace2/code/Io/Mouse.h $
7 * Include file for mouse reading routines
10 * Revision 1.1 2002/05/03 03:28:12 root
14 * 2 10/07/98 10:53a Dave
17 * 1 10/07/98 10:49a Dave
19 * 17 5/11/98 5:29p Hoffoss
20 * Added mouse button mapped to joystick button support.
22 * 16 5/07/98 6:58p Hoffoss
23 * Made changes to mouse code to fix a number of problems.
25 * 15 5/05/98 8:38p Hoffoss
26 * Added sensitivity adjustment to options menu and made it save to pilot
29 * 14 5/01/98 5:45p Hoffoss
30 * Made further improvements to the mouse code.
32 * 13 5/01/98 1:14p Hoffoss
33 * Changed mouse usage so directInput is only used for release version.
35 * 12 4/30/98 5:40p Hoffoss
36 * Added mouse as a supported control to fly the ship.
38 * 11 4/29/98 12:13a Lawrance
39 * Add function to check down count of mouse button without reseting the
40 * internal count. Added hook to reset demo trailer timer when a button
43 * 10 4/02/98 5:26p John
45 * 9 12/04/97 3:47p John
46 * Made joystick move mouse cursor
48 * 8 11/20/97 5:36p Dave
49 * Hooked in a bunch of main hall changes (including sound). Made it
50 * possible to reposition (rewind/ffwd)
51 * sound buffer pointers. Fixed animation direction change framerate
54 * 7 4/22/97 12:32p John
55 * added mouse_init function
57 * 6 3/26/97 10:52a Lawrance
58 * mouse always on in menus, disappears in gameplay after 1 second
60 * 5 3/11/97 1:37p Lawrance
61 * added mouse_up_count(), changed mouse_mark() to mouse_mark_button() &
64 * 4 2/17/97 5:18p John
65 * Added a bunch of RCS headers to a bunch of old files that don't have
76 extern int Mouse_sensitivity;
77 extern int Use_mouse_to_fly;
78 extern int Mouse_hidden;
79 extern int Keep_mouse_centered;
81 // call once to init the mouse
84 extern void mouse_mark_button( uint flags, int set );
86 // Fills in xpos & ypos if not NULL.
87 // Returns Button states
88 // Always returns coordinates clipped to screen coordinates.
89 extern int mouse_get_pos( int *xpos, int *ypos );
91 // get_real_pos could be negative.
92 extern void mouse_get_real_pos(int *mx, int *my);
94 extern void mouse_set_pos(int xpos,int ypos);
96 #define MOUSE_LEFT_BUTTON (1<<0)
97 #define MOUSE_RIGHT_BUTTON (1<<1)
98 #define MOUSE_MIDDLE_BUTTON (1<<2)
100 #define MOUSE_NUM_BUTTONS 3
102 // keep the following two #defines up to date with the #defines above
103 #define LOWEST_MOUSE_BUTTON (1<<0)
104 #define HIGHEST_MOUSE_BUTTON (1<<2)
106 // Returns the number of times button n went from up to down since last call
107 int mouse_down_count(int n, int reset_count = 1);
108 // Returns the number of times button n went from down to up since last call
109 int mouse_up_count(int n);
111 extern void mouse_flush();
113 int mouse_down(int btn); // returns 1 if mouse button btn is down, 0 otherwise
114 float mouse_down_time(int btn); // returns the fraction of time btn has been down since last call
115 int mouse_is_visible(); // returns 1 if mouse is visible, 0 otherwise
117 void mouse_eval_deltas();
118 void mouse_get_delta(int *dx = NULL, int *dy = NULL, int *dz = NULL);