FS2_Open
Open source remastering of the Freespace 2 engine
mouse.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (C) Volition, Inc. 1999. All rights reserved.
3  *
4  * All source code herein is the property of Volition, Inc. You may not sell
5  * or otherwise commercially exploit the source or things you created based on the
6  * source.
7  *
8 */
9 
10 
11 
12 #ifdef _WIN32
13 #include <windows.h>
14 #include <windowsx.h>
15 #endif
16 
17 #include "io/mouse.h"
18 #include "graphics/2d.h"
19 #include "parse/scripting.h"
20 
21 #define THREADED // to use the proper set of macros
22 #include "osapi/osapi.h"
23 #include "cmdline/cmdline.h"
24 
25 #define MOUSE_MODE_DI 0
26 #define MOUSE_MODE_WIN 1
27 
29 
30 int mouse_inited = 0;
31 #ifdef WIN32
32  LOCAL int Di_mouse_inited = 0;
33 #endif
36 
38 
43 int mouse_left_up = 0;
46 int Mouse_dx = 0;
47 int Mouse_dy = 0;
48 int Mouse_dz = 0;
49 
52 int Mouse_hidden = 0;
54 
55 #ifdef WIN32
56 int di_init();
57 void di_cleanup();
58 void mouse_eval_deltas_di();
59 #endif
60 
61 void mouse_force_pos(int x, int y);
62 
63 static bool Mouse_in_focus = true;
64 
66 {
67  if ( !mouse_inited ) return;
68 
69  Mouse_in_focus = true;
70 
71  mouse_flush();
72 }
73 
75 {
76  if ( !mouse_inited ) return;
77 
78  Mouse_in_focus = false;
79 
80  mouse_flush();
81 }
82 
84 {
85  return !Mouse_hidden;
86 }
87 
89 {
90  if (!mouse_inited)
91  return;
92 
93 #ifdef WIN32
95  di_cleanup();
96 #endif
97 
98  mouse_inited = 0;
99 
101 }
102 
104 {
105  // Initialize queue
106  if ( mouse_inited ) return;
107  mouse_inited = 1;
108 
110 
112 
113  mouse_flags = 0;
114  Mouse_x = gr_screen.max_w / 2;
115  Mouse_y = gr_screen.max_h / 2;
116 
117  #ifdef WIN32
118  if (Cmdline_no_di_mouse) {
120  } else {
121  if (!di_init() || Cmdline_window || Cmdline_fullscreen_window)
123  else
125  }
126  #else
128  #endif
129 
130 
131 #ifdef SCP_UNIX
132  // we poll for mouse motion events so be sure to skip those in normal event polling
133  SDL_EventState( SDL_MOUSEMOTION, SDL_IGNORE );
134 
135  // we do want to make sure that button presses go through event polling though
136  // (should be on by default already, just here as a reminder)
137  SDL_EventState( SDL_MOUSEBUTTONDOWN, SDL_ENABLE );
138  SDL_EventState( SDL_MOUSEBUTTONUP, SDL_ENABLE );
139 #endif
140 
142 
143  atexit( mouse_close );
144 }
145 
146 
147 // ----------------------------------------------------------------------------
148 // mouse_mark_button() is called asynchronously by the OS when a mouse button
149 // goes up or down. The mouse button that is affected is passed via the
150 // flags parameter.
151 //
152 // parameters: flags ==> mouse button pressed/released
153 // set ==> 1 - button is pressed
154 // 0 - button is released
155 
156 void mouse_mark_button( uint flags, int set)
157 {
158  if ( !mouse_inited ) return;
159 
161 
162  if ( !(mouse_flags & MOUSE_LEFT_BUTTON) ) {
163 
164  if ( (flags & MOUSE_LEFT_BUTTON) && (set == 1) ) {
166  }
167  }
168  else {
169  if ( (flags & MOUSE_LEFT_BUTTON) && (set == 0) ){
170  mouse_left_up++;
171  }
172  }
173 
174  if ( !(mouse_flags & MOUSE_RIGHT_BUTTON) ) {
175 
176  if ( (flags & MOUSE_RIGHT_BUTTON) && (set == 1) ){
178  }
179  }
180  else {
181  if ( (flags & MOUSE_RIGHT_BUTTON) && (set == 0) ){
182  mouse_right_up++;
183  }
184  }
185 
186  if ( !(mouse_flags & MOUSE_MIDDLE_BUTTON) ) {
187 
188  if ( (flags & MOUSE_MIDDLE_BUTTON) && (set == 1) ){
190  }
191  }
192  else {
193  if ( (flags & MOUSE_MIDDLE_BUTTON) && (set == 0) ){
194  mouse_middle_up++;
195  }
196  }
197 
198  if ( set ){
199  mouse_flags |= flags;
200  } else {
201  mouse_flags &= ~flags;
202  }
203 
205 
206  Script_system.SetHookVar("MouseButton", 'i', &flags);
207 
208  //WMC - On Mouse Pressed and On Mouse Released hooks
209  if (set == 1)
210  {
212  }
213  else if (set == 0)
214  {
216  }
217 
218  Script_system.RemHookVar("MouseButton");
219 }
220 
222 {
223  if (!mouse_inited)
224  return;
225 
227  Mouse_dx = Mouse_dy = Mouse_dz = 0;
229  mouse_left_pressed = 0;
232  mouse_flags = 0;
234 }
235 
236 int mouse_down_count(int n, int reset_count)
237 {
238  int tmp = 0;
239  if ( !mouse_inited ) return 0;
240 
241  if ( (n < LOWEST_MOUSE_BUTTON) || (n > HIGHEST_MOUSE_BUTTON)) return 0;
242 
244 
245  switch (n) {
246  case MOUSE_LEFT_BUTTON:
247  tmp = mouse_left_pressed;
248  if ( reset_count ) {
249  mouse_left_pressed = 0;
250  }
251  break;
252 
253  case MOUSE_RIGHT_BUTTON:
254  tmp = mouse_right_pressed;
255  if ( reset_count ) {
257  }
258  break;
259 
260  case MOUSE_MIDDLE_BUTTON:
261  tmp = mouse_middle_pressed;
262  if ( reset_count ) {
264  }
265  break;
266  } // end switch
267 
269 
270  return tmp;
271 }
272 
273 // mouse_up_count() returns the number of times button n has gone from down to up
274 // since the last call
275 //
276 // parameters: n - button of mouse (see #define's in mouse.h)
277 //
279 {
280  int tmp = 0;
281  if ( !mouse_inited ) return 0;
282 
283  if ( (n < LOWEST_MOUSE_BUTTON) || (n > HIGHEST_MOUSE_BUTTON)) return 0;
284 
286 
287  switch (n) {
288  case MOUSE_LEFT_BUTTON:
289  tmp = mouse_left_up;
290  mouse_left_up = 0;
291  break;
292 
293  case MOUSE_RIGHT_BUTTON:
294  tmp = mouse_right_up;
295  mouse_right_up = 0;
296  break;
297 
298  case MOUSE_MIDDLE_BUTTON:
299  tmp = mouse_middle_up;
300  mouse_middle_up = 0;
301  break;
302 
303  default:
304  Assert(0); // can't happen
305  break;
306  } // end switch
307 
309 
310  return tmp;
311 }
312 
313 // returns 1 if mouse button btn is down, 0 otherwise
314 
315 int mouse_down(int btn)
316 {
317  int tmp;
318  if ( !mouse_inited ) return 0;
319 
320  if ( (btn < LOWEST_MOUSE_BUTTON) || (btn > HIGHEST_MOUSE_BUTTON)) return 0;
321 
322 
324 
325 
326  if ( mouse_flags & btn )
327  tmp = 1;
328  else
329  tmp = 0;
330 
332 
333  return tmp;
334 }
335 
336 // returns the fraction of time btn has been down since last call
337 // (currently returns 1 if buttons is down, 0 otherwise)
338 //
339 float mouse_down_time(int btn)
340 {
341  float tmp;
342  if ( !mouse_inited ) return 0.0f;
343 
344  if ( (btn < LOWEST_MOUSE_BUTTON) || (btn > HIGHEST_MOUSE_BUTTON)) return 0.0f;
345 
347 
348  if ( mouse_flags & btn )
349  tmp = 1.0f;
350  else
351  tmp = 0.0f;
352 
354 
355  return tmp;
356 }
357 
358 void mouse_get_delta(int *dx, int *dy, int *dz)
359 {
360  if (dx)
361  *dx = Mouse_dx;
362  if (dy)
363  *dy = Mouse_dy;
364  if (dz)
365  *dz = Mouse_dz;
366 }
367 
368 // Forces the actual windows cursor to be at (x,y). This may be independent of our tracked (x,y) mouse pos.
369 void mouse_force_pos(int x, int y)
370 {
371  if (os_foreground()) { // only mess with windows's mouse if we are in control of it
372  POINT pnt;
373 
374  pnt.x = x;
375  pnt.y = y;
376  setWindowMousePos(&pnt);
377  }
378 }
379 
381 
382 // change in mouse position since last call
384 {
385  static int old_x = 0;
386  static int old_y = 0;
387  int tmp_x, tmp_y, cx, cy;
388 
389  Mouse_dx = Mouse_dy = Mouse_dz = 0;
390  if (!mouse_inited)
391  return;
392 
393 #ifdef WIN32
394  if (Mouse_mode == MOUSE_MODE_DI) {
395  mouse_eval_deltas_di();
396  return;
397  }
398 #endif
399 
400  cx = gr_screen.max_w / 2;
401  cy = gr_screen.max_h / 2;
402 
404 
405  POINT pnt;
406  getWindowMousePos(&pnt);
407  tmp_x = pnt.x;
408  tmp_y = pnt.y;
409 
410  Mouse_dx = tmp_x - old_x;
411  Mouse_dy = tmp_y - old_y;
412  Mouse_dz = 0;
413 
414  // Speeds up the menu mouse on higher resolutions. The check for a
415  // visible mouse should eliminate any possible gameplay changes.
416  if ( mouse_is_visible() ) {
418  }
419 
421  if (Mouse_dx || Mouse_dy)
422  mouse_force_pos(cx, cy);
423 
424  old_x = cx;
425  old_y = cy;
426 
427  } else {
428  old_x = tmp_x;
429  old_y = tmp_y;
430  }
431 
433 
434  //WMC - For On Mouse Moved trigger
435  if(Mouse_dx != 0 || Mouse_dy != 0)
436  {
438  }
439 }
440 
441 #ifdef WIN32
442 #include "directx/vdinput.h"
443 
444 static LPDIRECTINPUT Di_mouse_obj = NULL;
445 static LPDIRECTINPUTDEVICE Di_mouse = NULL;
446 
447 void mouse_eval_deltas_di()
448 {
449  int repeat = 1;
450  HRESULT hr = 0;
451  DIMOUSESTATE mouse_state;
452 
453  Mouse_dx = Mouse_dy = Mouse_dz = 0;
454  if (!Di_mouse_inited)
455  return;
456 
457  repeat = 1;
458  memset(&mouse_state, 0, sizeof(mouse_state));
459  while (repeat) {
460  repeat = 0;
461 
462  hr = Di_mouse->GetDeviceState(sizeof(mouse_state), &mouse_state);
463  if ((hr == DIERR_INPUTLOST) || (hr == DIERR_NOTACQUIRED)) {
464  // DirectInput is telling us that the input stream has
465  // been interrupted. We aren't tracking any state
466  // between polls, so we don't have any special reset
467  // that needs to be done. We just re-acquire and
468  // try again.
469  Sleep(500); // Pause a half second...
470  hr = Di_mouse->Acquire();
471  if (SUCCEEDED(hr))
472  repeat = 1;
473  }
474  }
475 
476  if (SUCCEEDED(hr)) {
477  Mouse_dx = (int) mouse_state.lX;
478  Mouse_dy = (int) mouse_state.lY;
479  Mouse_dz = (int) mouse_state.lZ;
480 
481  } else {
482  Mouse_dx = Mouse_dy = Mouse_dz = 0;
483  }
484 
485  // Speeds up the menu mouse on higher resolutions. The check for a
486  // visible mouse should eliminate any possible gameplay changes.
487  if ( mouse_is_visible() ) {
489  }
490 
491  Mouse_x += Mouse_dx;
492  Mouse_y += Mouse_dy;
493 
494  if (Mouse_x < 0)
495  Mouse_x = 0;
496 
497  if (Mouse_y < 0)
498  Mouse_y = 0;
499 
500  if (Mouse_x >= gr_screen.max_w)
501  Mouse_x = gr_screen.max_w - 1;
502 
503  if (Mouse_y >= gr_screen.max_h)
504  Mouse_y = gr_screen.max_h - 1;
505 
506  // keep the mouse inside our window so we don't switch applications or anything (debug bug people reported?)
507  // JH: Dang! This makes the mouse readings in DirectInput act screwy!
508 // mouse_force_pos(gr_screen.max_w / 2, gr_screen.max_h / 2);
509 }
510 #endif //#ifdef WIN32
511 
512 int mouse_get_pos(int *xpos, int *ypos)
513 {
514  int flags;
515 
516  if (!Mouse_in_focus)
517  {
518  if (xpos)
519  *xpos = Mouse_x;
520 
521  if (ypos)
522  *ypos = Mouse_y;
523 
524  return 0;
525  }
526 
527  if (Mouse_mode == MOUSE_MODE_DI) {
528  if (xpos)
529  *xpos = Mouse_x;
530 
531  if (ypos)
532  *ypos = Mouse_y;
533 
534  return mouse_flags;
535  }
536 
537  if (!mouse_inited) {
538  *xpos = *ypos = 0;
539  return 0;
540  }
541 
542  POINT pnt;
543  getWindowMousePos(&pnt);
544 
545 // EnterCriticalSection(&mouse_lock);
546 
547  flags = mouse_flags;
548  Mouse_x = pnt.x;
549  Mouse_y = pnt.y;
550 
551 // LeaveCriticalSection(&mouse_lock);
552 
553  if (Mouse_x < 0){
554  Mouse_x = 0;
555  }
556 
557  if (Mouse_y < 0){
558  Mouse_y = 0;
559  }
560 
561  if (Mouse_x >= gr_screen.max_w){
562  Mouse_x = gr_screen.max_w - 1;
563  }
564 
565  if (Mouse_y >= gr_screen.max_h){
566  Mouse_y = gr_screen.max_h - 1;
567  }
568 
569  if (xpos){
570  *xpos = Mouse_x;
571  }
572 
573  if (ypos){
574  *ypos = Mouse_y;
575  }
576 
577  return flags;
578 }
579 
580 int mouse_get_pos_unscaled( int *xpos, int *ypos )
581 {
582  int flags = mouse_get_pos( xpos, ypos );
583 
584  gr_unsize_screen_pos( (xpos) ? xpos : NULL, (ypos) ? ypos : NULL, NULL, NULL, GR_RESIZE_MENU );
585 
586  return flags;
587 }
588 
589 void mouse_get_real_pos(int *mx, int *my)
590 {
591  if (Mouse_mode == MOUSE_MODE_DI) {
592  *mx = Mouse_x;
593  *my = Mouse_y;
594  return;
595  }
596 
597  POINT pnt;
598  getWindowMousePos(&pnt);
599 
600  *mx = pnt.x;
601  *my = pnt.y;
602 }
603 
604 void mouse_set_pos(int xpos, int ypos)
605 {
606  if (Mouse_mode == MOUSE_MODE_DI) {
607  Mouse_x = xpos;
608  Mouse_y = ypos;
609  return;
610  }
611 
612  if ((xpos != Mouse_x) || (ypos != Mouse_y)){
613  mouse_force_pos(xpos, ypos);
614  }
615 }
616 
617 #ifdef WIN32
618 int di_init()
619 {
620  HRESULT hr;
621 
622  if (Mouse_mode == MOUSE_MODE_WIN){
623  return 0;
624  }
625 
626  Di_mouse_inited = 0;
627  hr = DirectInputCreate(GetModuleHandle(NULL), DIRECTINPUT_VERSION, &Di_mouse_obj, NULL);
628  if (FAILED(hr)) {
629  hr = DirectInputCreate(GetModuleHandle(NULL), 0x300, &Di_mouse_obj, NULL);
630  if (FAILED(hr)) {
631  mprintf(( "DirectInputCreate() failed!\n" ));
632  return FALSE;
633  }
634  }
635 
636  hr = Di_mouse_obj->CreateDevice(GUID_SysMouse, &Di_mouse, NULL);
637  if (FAILED(hr)) {
638  mprintf(( "CreateDevice() failed!\n" ));
639  return FALSE;
640  }
641 
642  hr = Di_mouse->SetDataFormat(&c_dfDIMouse);
643  if (FAILED(hr)) {
644  mprintf(( "SetDataFormat() failed!\n" ));
645  return FALSE;
646  }
647 
648  hr = Di_mouse->SetCooperativeLevel((HWND)os_get_window(), DISCL_NONEXCLUSIVE | DISCL_FOREGROUND);
649  if (FAILED(hr)) {
650  mprintf(( "SetCooperativeLevel() failed!\n" ));
651  return FALSE;
652  }
653 /*
654  DIPROPDWORD hdr;
655 
656  // Turn on buffering
657  hdr.diph.dwSize = sizeof(DIPROPDWORD);
658  hdr.diph.dwHeaderSize = sizeof(DIPROPHEADER);
659  hdr.diph.dwObj = 0;
660  hdr.diph.dwHow = DIPH_DEVICE; // Apply to entire device
661  hdr.dwData = 16; //MAX_BUFFERED_KEYBOARD_EVENTS;
662 
663  hr = Di_mouse->SetProperty( DIPROP_BUFFERSIZE, &hdr.diph );
664  if (FAILED(hr)) {
665  mprintf(( "SetProperty DIPROP_BUFFERSIZE failed\n" ));
666  return FALSE;
667  }
668 
669  Di_event = CreateEvent( NULL, FALSE, FALSE, NULL );
670  Assert(Di_event != NULL);
671 
672  hr = Di_mouse->SetEventNotification(Di_event);
673  if (FAILED(hr)) {
674  mprintf(( "SetEventNotification failed\n" ));
675  return FALSE;
676  }
677 */
678  Di_mouse->Acquire();
679 
680  Di_mouse_inited = 1;
681  return TRUE;
682 }
683 
684 
685 void di_cleanup()
686 {
687  // Destroy any lingering IDirectInputDevice object.
688  if (Di_mouse) {
689  // Unacquire the device one last time just in case we got really confused
690  // and tried to exit while the device is still acquired.
691  Di_mouse->Unacquire();
692 
693  Di_mouse->Release();
694  Di_mouse = NULL;
695  }
696 
697  // Destroy any lingering IDirectInput object.
698  if (Di_mouse_obj) {
699  Di_mouse_obj->Release();
700  Di_mouse_obj = NULL;
701  }
702 
703  Di_mouse_inited = 0;
704 }
705 #endif //ifdef WIN32
706 
707 // portable routine to get the mouse position, relative
708 // to current window
710 {
711  Assert(pt != NULL);
712 
713 #ifdef _WIN32
714  GetCursorPos(pt);
715  ScreenToClient((HWND)os_get_window(), pt);
716 #else
717  SDL_GetMouseState(&pt->x, &pt->y);
718 #endif
719 }
720 
721 
722 // portable routine to get the mouse position, relative
723 // to current window
725 {
726  Assert(pt != NULL);
727 
728 #ifdef _WIN32
729  ClientToScreen((HWND) os_get_window(), pt);
730  SetCursorPos(pt->x, pt->y);
731 #else
732  SDL_WarpMouse(pt->x, pt->y);
733 #endif
734 }
#define CHA_MOUSEPRESSED
Definition: scripting.h:58
int Keep_mouse_centered
Definition: mouse.cpp:53
int Mouse_dy
Definition: mouse.cpp:47
#define DISCL_NONEXCLUSIVE
Definition: vdinput.h:623
void * HWND
Definition: config.h:104
#define DIERR_INPUTLOST
Definition: vdinput.h:1649
void mouse_set_pos(int xpos, int ypos)
Definition: mouse.cpp:604
int os_foreground()
Definition: osapi.cpp:202
int Mouse_sensitivity
Definition: mouse.cpp:50
Definition: config.h:286
#define DELETE_CRITICAL_SECTION(csc)
Definition: osapi.h:41
void RemHookVar(char *name)
Definition: scripting.cpp:749
#define GR_RESIZE_MENU
Definition: 2d.h:684
#define MOUSE_LEFT_BUTTON
Definition: mouse.h:43
int mouse_right_up
Definition: mouse.cpp:44
LOCAL int Mouse_y
Definition: mouse.cpp:35
Assert(pm!=NULL)
#define mprintf(args)
Definition: pstypes.h:238
int mouse_left_pressed
Definition: mouse.cpp:40
#define MOUSE_MIDDLE_BUTTON
Definition: mouse.h:45
#define TRUE
Definition: pstypes.h:399
SDL_mutex * CRITICAL_SECTION
Definition: config.h:213
#define DIERR_NOTACQUIRED
Definition: vdinput.h:1661
#define DirectInputCreate
Definition: vdinput.h:1487
int mouse_get_pos(int *xpos, int *ypos)
Definition: mouse.cpp:512
#define MOUSE_MODE_WIN
Definition: mouse.cpp:26
int mouse_flags
Definition: mouse.cpp:39
script_state Script_system("FS2_Open Scripting")
int mouse_get_pos_unscaled(int *xpos, int *ypos)
Definition: mouse.cpp:580
int mouse_middle_up
Definition: mouse.cpp:45
int mouse_down(int btn)
Definition: mouse.cpp:315
uint os_get_window()
Definition: osapi.cpp:208
typedef int(SCP_EXT_CALLCONV *SCPDLL_PFVERSION)(SCPDLL_Version *)
void mouse_lost_focus()
Definition: mouse.cpp:74
#define HIGHEST_MOUSE_BUTTON
Definition: mouse.h:51
unsigned int uint
Definition: pstypes.h:64
void mouse_force_pos(int x, int y)
Definition: mouse.cpp:369
int mouse_inited
Definition: mouse.cpp:30
void mouse_close()
Definition: mouse.cpp:88
float mouse_down_time(int btn)
Definition: mouse.cpp:339
#define DISCL_FOREGROUND
Definition: vdinput.h:624
struct IDirectInput * LPDIRECTINPUT
Definition: vdinput.h:1381
#define ENTER_CRITICAL_SECTION(csc)
Definition: osapi.h:42
int mouse_right_pressed
Definition: mouse.cpp:41
int Use_mouse_to_fly
Definition: mouse.cpp:51
LOCAL int Mouse_mode
Definition: mouse.cpp:28
int Mouse_hidden
Definition: mouse.cpp:52
struct IDirectInputDevice * LPDIRECTINPUTDEVICE
Definition: vdinput.h:764
int Cmdline_window
Definition: cmdline.cpp:502
void getWindowMousePos(POINT *pt)
Definition: mouse.cpp:709
void mouse_eval_deltas()
Definition: mouse.cpp:383
int mouse_is_visible()
Definition: mouse.cpp:83
void mouse_get_delta(int *dx, int *dy, int *dz)
Definition: mouse.cpp:358
const DIDATAFORMAT c_dfDIMouse
#define MOUSE_MODE_DI
Definition: mouse.cpp:25
GLint GLint GLint GLint GLint x
Definition: Glext.h:5182
GLclampd n
Definition: Glext.h:7286
int x
Definition: config.h:287
int Cmdline_no_di_mouse
Definition: cmdline.cpp:447
long HRESULT
Definition: vddraw.h:115
int Cmdline_fullscreen_window
Definition: cmdline.cpp:503
int max_w
Definition: 2d.h:360
GLbitfield flags
Definition: Glext.h:6722
int mouse_left_up
Definition: mouse.cpp:43
int RunCondition(int condition, char format='\0', void *data=NULL, class object *objp=NULL, int more_data=0)
Definition: scripting.cpp:924
bool gr_resize_screen_pos(int *x, int *y, int *w, int *h, int resize_mode)
Definition: 2d.cpp:212
#define MOUSE_RIGHT_BUTTON
Definition: mouse.h:44
void mouse_init()
Definition: mouse.cpp:103
#define LEAVE_CRITICAL_SECTION(csc)
Definition: osapi.h:43
int Mouse_dz
Definition: mouse.cpp:48
int mouse_up_count(int n)
Definition: mouse.cpp:278
#define INITIALIZE_CRITICAL_SECTION(csc)
Definition: osapi.h:40
screen gr_screen
Definition: 2d.cpp:46
#define DIRECTINPUT_VERSION
Definition: vdinput.h:27
void Sleep(int mili)
int max_h
Definition: 2d.h:360
void SetHookVar(char *name, char format, void *data=NULL)
Definition: scripting.cpp:650
bool gr_unsize_screen_pos(int *x, int *y, int *w, int *h, int resize_mode)
Definition: 2d.cpp:320
int mouse_middle_pressed
Definition: mouse.cpp:42
void mouse_get_real_pos(int *mx, int *my)
Definition: mouse.cpp:589
#define LOWEST_MOUSE_BUTTON
Definition: mouse.h:50
CRITICAL_SECTION mouse_lock
Definition: mouse.cpp:37
#define CHA_MOUSERELEASED
Definition: scripting.h:59
LOCAL int Mouse_x
Definition: mouse.cpp:34
int Mouse_dx
Definition: mouse.cpp:46
int y
Definition: config.h:287
void setWindowMousePos(POINT *pt)
Definition: mouse.cpp:724
void mouse_got_focus()
Definition: mouse.cpp:65
#define FALSE
Definition: pstypes.h:400
int mouse_down_count(int n, int reset_count)
Definition: mouse.cpp:236
#define LOCAL
Definition: pstypes.h:37
void mouse_mark_button(uint flags, int set)
Definition: mouse.cpp:156
void mouse_flush()
Definition: mouse.cpp:221
GLint y
Definition: Gl.h:1505
#define CHA_MOUSEMOVED
Definition: scripting.h:57