vkQuake2 doxygen  1.0 dev
in_win.c
Go to the documentation of this file.
1 /*
2 Copyright (C) 1997-2001 Id Software, Inc.
3 Copyright (C) 2018-2019 Krzysztof Kondrak
4 
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License
7 as published by the Free Software Foundation; either version 2
8 of the License, or (at your option) any later version.
9 
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 
14 See the GNU General Public License for more details.
15 
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 
20 */
21 // in_win.c -- windows 95 mouse and joystick code
22 // 02/21/97 JCB Added extended DirectInput code to support external controllers.
23 
24 #include "../client/client.h"
25 #include "winquake.h"
26 
27 extern unsigned sys_msg_time;
28 
29 // joystick defines and variables
30 // where should defines be moved?
31 #define JOY_ABSOLUTE_AXIS 0x00000000 // control like a joystick
32 #define JOY_RELATIVE_AXIS 0x00000010 // control like a mouse, spinner, trackball
33 #define JOY_MAX_AXES 6 // X, Y, Z, R, U, V
34 #define JOY_AXIS_X 0
35 #define JOY_AXIS_Y 1
36 #define JOY_AXIS_Z 2
37 #define JOY_AXIS_R 3
38 #define JOY_AXIS_U 4
39 #define JOY_AXIS_V 5
40 
42 {
44 };
45 
47 {
48  JOY_RETURNX, JOY_RETURNY, JOY_RETURNZ, JOY_RETURNR, JOY_RETURNU, JOY_RETURNV
49 };
50 
54 
57 
58 
59 // none of these cvars are saved over a session
60 // this means that advanced controller configuration needs to be executed
61 // each time. this avoids any problems with getting back to a default usage
62 // or when changing from one controller to another. this way at least something
63 // works.
82 
85 
86 int joy_id;
89 
90 static JOYINFOEX ji;
91 
93 
94 // forward-referenced functions
95 void IN_StartupJoystick (void);
96 void Joy_AdvancedUpdate_f (void);
97 void IN_JoyMove (usercmd_t *cmd);
98 
99 /*
100 ============================================================
101 
102  MOUSE CONTROL
103 
104 ============================================================
105 */
106 
107 // mouse variables
109 
111 
112 void IN_MLookDown (void) { mlooking = true; }
113 void IN_MLookUp (void) {
114 mlooking = false;
115 if (!freelook->value && lookspring->value)
116  IN_CenterView ();
117 }
118 
123 
125 
126 qboolean mouseactive; // false when not focus app
127 
130 int originalmouseparms[3], newmouseparms[3] = {0, 0, 0}; // explicitly disable mouse acceleration
132 
135 
136 
137 /*
138 ===========
139 IN_ActivateMouse
140 
141 Called when the window gains focus or changes in some way
142 ===========
143 */
144 void IN_ActivateMouse (void)
145 {
146  int width, height;
147 
148  if (!mouseinitialized)
149  return;
150  if (!in_mouse->value)
151  {
152  mouseactive = false;
153  return;
154  }
155  if (mouseactive)
156  return;
157 
158  mouseactive = true;
159 
160  if (mouseparmsvalid)
161  restore_spi = SystemParametersInfo (SPI_SETMOUSE, 0, newmouseparms, 0);
162 
163  width = GetSystemMetrics (SM_CXSCREEN);
164  height = GetSystemMetrics (SM_CYSCREEN);
165 
166  GetWindowRect ( cl_hwnd, &window_rect);
167 
168  window_center_x = (window_rect.right + window_rect.left)/2;
169  window_center_y = (window_rect.top + window_rect.bottom)/2;
170 
171  SetCursorPos (window_center_x, window_center_y);
172 
175 
176  SetCapture ( cl_hwnd );
177  ClipCursor (&window_rect);
178  while (ShowCursor (FALSE) >= 0)
179  ;
180 }
181 
182 
183 /*
184 ===========
185 IN_DeactivateMouse
186 
187 Called when the window loses focus
188 ===========
189 */
191 {
192  if (!mouseinitialized)
193  return;
194  if (!mouseactive)
195  return;
196 
197  if (restore_spi)
198  SystemParametersInfo (SPI_SETMOUSE, 0, originalmouseparms, 0);
199 
200  mouseactive = false;
201 
202  ClipCursor (NULL);
203  ReleaseCapture ();
204  while (ShowCursor (TRUE) < 0)
205  ;
206 }
207 
208 
209 
210 /*
211 ===========
212 IN_StartupMouse
213 ===========
214 */
215 void IN_StartupMouse (void)
216 {
217  cvar_t *cv;
218 
219  cv = Cvar_Get ("in_initmouse", "1", CVAR_NOSET);
220  if ( !cv->value )
221  return;
222 
223  mouseinitialized = true;
224  mouseparmsvalid = SystemParametersInfo (SPI_GETMOUSE, 0, originalmouseparms, 0);
225  mouse_buttons = 3;
226 }
227 
228 /*
229 ===========
230 IN_MouseEvent
231 ===========
232 */
233 void IN_MouseEvent (int mstate)
234 {
235  int i;
236 
237  if (!mouseinitialized)
238  return;
239 
240 // perform button actions
241  for (i=0 ; i<mouse_buttons ; i++)
242  {
243  if ( (mstate & (1<<i)) &&
244  !(mouse_oldbuttonstate & (1<<i)) )
245  {
246  Key_Event (K_MOUSE1 + i, true, sys_msg_time);
247  }
248 
249  if ( !(mstate & (1<<i)) &&
250  (mouse_oldbuttonstate & (1<<i)) )
251  {
252  Key_Event (K_MOUSE1 + i, false, sys_msg_time);
253  }
254  }
255 
256  mouse_oldbuttonstate = mstate;
257 }
258 
259 
260 /*
261 ===========
262 IN_MouseMove
263 ===========
264 */
266 {
267  int mx, my;
268 
269  if (!mouseactive)
270  return;
271 
272  // find mouse movement
273  if (!GetCursorPos (&current_pos))
274  return;
275 
276  mx = current_pos.x - window_center_x;
277  my = current_pos.y - window_center_y;
278 
279 #if 0
280  if (!mx && !my)
281  return;
282 #endif
283 
284  if (m_filter->value)
285  {
286  mouse_x = (mx + old_mouse_x) * 0.5;
287  mouse_y = (my + old_mouse_y) * 0.5;
288  }
289  else
290  {
291  mouse_x = mx;
292  mouse_y = my;
293  }
294 
295  old_mouse_x = mx;
296  old_mouse_y = my;
297 
300 
301 // add mouse X/Y movement to cmd
302  if ( (in_strafe.state & 1) || (lookstrafe->value && mlooking ))
303  cmd->sidemove += m_side->value * mouse_x;
304  else
306 
307  if ( (mlooking || freelook->value) && !(in_strafe.state & 1))
308  {
310  }
311  else
312  {
313  cmd->forwardmove -= m_forward->value * mouse_y;
314  }
315 
316  // force the mouse to the center, so there's room to move
317  if (mx || my)
318  SetCursorPos (window_center_x, window_center_y);
319 }
320 
321 
322 /*
323 =========================================================================
324 
325 VIEW CENTERING
326 
327 =========================================================================
328 */
329 
332 
333 
334 /*
335 ===========
336 IN_Init
337 ===========
338 */
339 void IN_Init (void)
340 {
341  // mouse variables
342  m_filter = Cvar_Get ("m_filter", "0", 0);
343  in_mouse = Cvar_Get ("in_mouse", "1", CVAR_ARCHIVE);
344 
345  // joystick variables
346  in_joystick = Cvar_Get ("in_joystick", "0", CVAR_ARCHIVE);
347  joy_name = Cvar_Get ("joy_name", "joystick", 0);
348  joy_advanced = Cvar_Get ("joy_advanced", "0", 0);
349  joy_advaxisx = Cvar_Get ("joy_advaxisx", "0", 0);
350  joy_advaxisy = Cvar_Get ("joy_advaxisy", "0", 0);
351  joy_advaxisz = Cvar_Get ("joy_advaxisz", "0", 0);
352  joy_advaxisr = Cvar_Get ("joy_advaxisr", "0", 0);
353  joy_advaxisu = Cvar_Get ("joy_advaxisu", "0", 0);
354  joy_advaxisv = Cvar_Get ("joy_advaxisv", "0", 0);
355  joy_forwardthreshold = Cvar_Get ("joy_forwardthreshold", "0.15", 0);
356  joy_sidethreshold = Cvar_Get ("joy_sidethreshold", "0.15", 0);
357  joy_upthreshold = Cvar_Get ("joy_upthreshold", "0.15", 0);
358  joy_pitchthreshold = Cvar_Get ("joy_pitchthreshold", "0.15", 0);
359  joy_yawthreshold = Cvar_Get ("joy_yawthreshold", "0.15", 0);
360  joy_forwardsensitivity = Cvar_Get ("joy_forwardsensitivity", "-1", 0);
361  joy_sidesensitivity = Cvar_Get ("joy_sidesensitivity", "-1", 0);
362  joy_upsensitivity = Cvar_Get ("joy_upsensitivity", "-1", 0);
363  joy_pitchsensitivity = Cvar_Get ("joy_pitchsensitivity", "1", 0);
364  joy_yawsensitivity = Cvar_Get ("joy_yawsensitivity", "-1", 0);
365 
366  // centering
367  v_centermove = Cvar_Get ("v_centermove", "0.15", 0);
368  v_centerspeed = Cvar_Get ("v_centerspeed", "500", 0);
369 
370  Cmd_AddCommand ("+mlook", IN_MLookDown);
371  Cmd_AddCommand ("-mlook", IN_MLookUp);
372 
373  Cmd_AddCommand ("joy_advancedupdate", Joy_AdvancedUpdate_f);
374 
375  IN_StartupMouse ();
377 }
378 
379 /*
380 ===========
381 IN_Shutdown
382 ===========
383 */
384 void IN_Shutdown (void)
385 {
387 }
388 
389 
390 /*
391 ===========
392 IN_Activate
393 
394 Called when the main window gains or loses focus.
395 The window may have been destroyed and recreated
396 between a deactivate and an activate.
397 ===========
398 */
399 void IN_Activate (qboolean active)
400 {
401  in_appactive = active;
402  mouseactive = !active; // force a new window check or turn off
403 }
404 
405 
406 /*
407 ==================
408 IN_Frame
409 
410 Called every frame, even if not generating commands
411 ==================
412 */
413 void IN_Frame (void)
414 {
415  if (!mouseinitialized)
416  return;
417 
418  if (!in_mouse || !in_appactive)
419  {
421  return;
422  }
423 
424  if ( !cl.refresh_prepped
425  || cls.key_dest == key_console
426  || cls.key_dest == key_menu)
427  {
428  // temporarily deactivate if in fullscreen
429  if (Cvar_VariableValue ("vid_fullscreen") == 0)
430  {
432  return;
433  }
434  }
435 
436  IN_ActivateMouse ();
437 }
438 
439 /*
440 ===========
441 IN_Move
442 ===========
443 */
444 void IN_Move (usercmd_t *cmd)
445 {
446  IN_MouseMove (cmd);
447 
448  if (ActiveApp)
449  IN_JoyMove (cmd);
450 }
451 
452 
453 /*
454 ===================
455 IN_ClearStates
456 ===================
457 */
458 void IN_ClearStates (void)
459 {
460  mx_accum = 0;
461  my_accum = 0;
463 }
464 
465 
466 /*
467 =========================================================================
468 
469 JOYSTICK
470 
471 =========================================================================
472 */
473 
474 /*
475 ===============
476 IN_StartupJoystick
477 ===============
478 */
479 void IN_StartupJoystick (void)
480 {
481  int numdevs;
482  JOYCAPS jc;
483  MMRESULT mmr;
484  cvar_t *cv;
485 
486  // assume no joystick
487  joy_avail = false;
488 
489  // abort startup if user requests no joystick
490  cv = Cvar_Get ("in_initjoy", "1", CVAR_NOSET);
491  if ( !cv->value )
492  return;
493 
494  // verify joystick driver is present
495  if ((numdevs = joyGetNumDevs ()) == 0)
496  {
497 // Com_Printf ("\njoystick not found -- driver not present\n\n");
498  return;
499  }
500 
501  // cycle through the joystick ids for the first valid one
502  for (joy_id=0 ; joy_id<numdevs ; joy_id++)
503  {
504  memset (&ji, 0, sizeof(ji));
505  ji.dwSize = sizeof(ji);
506  ji.dwFlags = JOY_RETURNCENTERED;
507 
508  if ((mmr = joyGetPosEx (joy_id, &ji)) == JOYERR_NOERROR)
509  break;
510  }
511 
512  // abort startup if we didn't find a valid joystick
513  if (mmr != JOYERR_NOERROR)
514  {
515  Com_Printf ("\njoystick not found -- no valid joysticks (%x)\n\n", mmr);
516  return;
517  }
518 
519  // get the capabilities of the selected joystick
520  // abort startup if command fails
521  memset (&jc, 0, sizeof(jc));
522  if ((mmr = joyGetDevCaps (joy_id, &jc, sizeof(jc))) != JOYERR_NOERROR)
523  {
524  Com_Printf ("\njoystick not found -- invalid joystick capabilities (%x)\n\n", mmr);
525  return;
526  }
527 
528  // save the joystick's number of buttons and POV status
529  joy_numbuttons = jc.wNumButtons;
530  joy_haspov = jc.wCaps & JOYCAPS_HASPOV;
531 
532  // old button and POV states default to no buttons pressed
534 
535  // mark the joystick as available and advanced initialization not completed
536  // this is needed as cvars are not available during initialization
537 
538  joy_avail = true;
539  joy_advancedinit = false;
540 
541  Com_Printf ("\njoystick detected\n\n");
542 }
543 
544 
545 /*
546 ===========
547 RawValuePointer
548 ===========
549 */
550 PDWORD RawValuePointer (int axis)
551 {
552  switch (axis)
553  {
554  case JOY_AXIS_X:
555  return &ji.dwXpos;
556  case JOY_AXIS_Y:
557  return &ji.dwYpos;
558  case JOY_AXIS_Z:
559  return &ji.dwZpos;
560  case JOY_AXIS_R:
561  return &ji.dwRpos;
562  case JOY_AXIS_U:
563  return &ji.dwUpos;
564  case JOY_AXIS_V:
565  return &ji.dwVpos;
566  }
567 
568  return NULL;
569 }
570 
571 
572 /*
573 ===========
574 Joy_AdvancedUpdate_f
575 ===========
576 */
578 {
579 
580  // called once by IN_ReadJoystick and by user whenever an update is needed
581  // cvars are now available
582  int i;
583  DWORD dwTemp;
584 
585  // initialize all the maps
586  for (i = 0; i < JOY_MAX_AXES; i++)
587  {
588  dwAxisMap[i] = AxisNada;
591  }
592 
593  if( joy_advanced->value == 0.0)
594  {
595  // default joystick initialization
596  // 2 axes only with joystick control
598  // dwControlMap[JOY_AXIS_X] = JOY_ABSOLUTE_AXIS;
600  // dwControlMap[JOY_AXIS_Y] = JOY_ABSOLUTE_AXIS;
601  }
602  else
603  {
604  if (strcmp (joy_name->string, "joystick") != 0)
605  {
606  // notify user of advanced controller
607  Com_Printf ("\n%s configured\n\n", joy_name->string);
608  }
609 
610  // advanced initialization here
611  // data supplied by user via joy_axisn cvars
612  dwTemp = (DWORD) joy_advaxisx->value;
613  dwAxisMap[JOY_AXIS_X] = dwTemp & 0x0000000f;
615  dwTemp = (DWORD) joy_advaxisy->value;
616  dwAxisMap[JOY_AXIS_Y] = dwTemp & 0x0000000f;
618  dwTemp = (DWORD) joy_advaxisz->value;
619  dwAxisMap[JOY_AXIS_Z] = dwTemp & 0x0000000f;
621  dwTemp = (DWORD) joy_advaxisr->value;
622  dwAxisMap[JOY_AXIS_R] = dwTemp & 0x0000000f;
624  dwTemp = (DWORD) joy_advaxisu->value;
625  dwAxisMap[JOY_AXIS_U] = dwTemp & 0x0000000f;
627  dwTemp = (DWORD) joy_advaxisv->value;
628  dwAxisMap[JOY_AXIS_V] = dwTemp & 0x0000000f;
630  }
631 
632  // compute the axes to collect from DirectInput
633  joy_flags = JOY_RETURNCENTERED | JOY_RETURNBUTTONS | JOY_RETURNPOV;
634  for (i = 0; i < JOY_MAX_AXES; i++)
635  {
636  if (dwAxisMap[i] != AxisNada)
637  {
638  joy_flags |= dwAxisFlags[i];
639  }
640  }
641 }
642 
643 
644 /*
645 ===========
646 IN_Commands
647 ===========
648 */
649 void IN_Commands (void)
650 {
651  int i, key_index;
652  DWORD buttonstate, povstate;
653 
654  if (!joy_avail)
655  {
656  return;
657  }
658 
659 
660  // loop through the joystick buttons
661  // key a joystick event or auxillary event for higher number buttons for each state change
662  buttonstate = ji.dwButtons;
663  for (i=0 ; i < joy_numbuttons ; i++)
664  {
665  if ( (buttonstate & (1<<i)) && !(joy_oldbuttonstate & (1<<i)) )
666  {
667  key_index = (i < 4) ? K_JOY1 : K_AUX1;
668  Key_Event (key_index + i, true, 0);
669  }
670 
671  if ( !(buttonstate & (1<<i)) && (joy_oldbuttonstate & (1<<i)) )
672  {
673  key_index = (i < 4) ? K_JOY1 : K_AUX1;
674  Key_Event (key_index + i, false, 0);
675  }
676  }
677  joy_oldbuttonstate = buttonstate;
678 
679  if (joy_haspov)
680  {
681  // convert POV information into 4 bits of state information
682  // this avoids any potential problems related to moving from one
683  // direction to another without going through the center position
684  povstate = 0;
685  if(ji.dwPOV != JOY_POVCENTERED)
686  {
687  if (ji.dwPOV == JOY_POVFORWARD)
688  povstate |= 0x01;
689  if (ji.dwPOV == JOY_POVRIGHT)
690  povstate |= 0x02;
691  if (ji.dwPOV == JOY_POVBACKWARD)
692  povstate |= 0x04;
693  if (ji.dwPOV == JOY_POVLEFT)
694  povstate |= 0x08;
695  }
696  // determine which bits have changed and key an auxillary event for each change
697  for (i=0 ; i < 4 ; i++)
698  {
699  if ( (povstate & (1<<i)) && !(joy_oldpovstate & (1<<i)) )
700  {
701  Key_Event (K_AUX29 + i, true, 0);
702  }
703 
704  if ( !(povstate & (1<<i)) && (joy_oldpovstate & (1<<i)) )
705  {
706  Key_Event (K_AUX29 + i, false, 0);
707  }
708  }
709  joy_oldpovstate = povstate;
710  }
711 }
712 
713 
714 /*
715 ===============
716 IN_ReadJoystick
717 ===============
718 */
720 {
721 
722  memset (&ji, 0, sizeof(ji));
723  ji.dwSize = sizeof(ji);
724  ji.dwFlags = joy_flags;
725 
726  if (joyGetPosEx (joy_id, &ji) == JOYERR_NOERROR)
727  {
728  return true;
729  }
730  else
731  {
732  // read error occurred
733  // turning off the joystick seems too harsh for 1 read error,\
734  // but what should be done?
735  // Com_Printf ("IN_ReadJoystick: no response\n");
736  // joy_avail = false;
737  return false;
738  }
739 }
740 
741 
742 /*
743 ===========
744 IN_JoyMove
745 ===========
746 */
748 {
749  float speed, aspeed;
750  float fAxisValue;
751  int i;
752 
753  // complete initialization if first time in
754  // this is needed as cvars are not available at initialization time
755  if( joy_advancedinit != true )
756  {
758  joy_advancedinit = true;
759  }
760 
761  // verify joystick is available and that the user wants to use it
762  if (!joy_avail || !in_joystick->value)
763  {
764  return;
765  }
766 
767  // collect the joystick data, if possible
768  if (IN_ReadJoystick () != true)
769  {
770  return;
771  }
772 
773  if ( (in_speed.state & 1) ^ (int)cl_run->value)
774  speed = 2;
775  else
776  speed = 1;
777  aspeed = speed * cls.frametime;
778 
779  // loop through the axes
780  for (i = 0; i < JOY_MAX_AXES; i++)
781  {
782  // get the floating point zero-centered, potentially-inverted data for the current axis
783  fAxisValue = (float) *pdwRawValue[i];
784  // move centerpoint to zero
785  fAxisValue -= 32768.0;
786 
787  // convert range from -32768..32767 to -1..1
788  fAxisValue /= 32768.0;
789 
790  switch (dwAxisMap[i])
791  {
792  case AxisForward:
793  if ((joy_advanced->value == 0.0) && mlooking)
794  {
795  // user wants forward control to become look control
796  if (fabs(fAxisValue) > joy_pitchthreshold->value)
797  {
798  // if mouse invert is on, invert the joystick pitch value
799  // only absolute control support here (joy_advanced is false)
800  if (m_pitch->value < 0.0)
801  {
802  cl.viewangles[PITCH] -= (fAxisValue * joy_pitchsensitivity->value) * aspeed * cl_pitchspeed->value;
803  }
804  else
805  {
806  cl.viewangles[PITCH] += (fAxisValue * joy_pitchsensitivity->value) * aspeed * cl_pitchspeed->value;
807  }
808  }
809  }
810  else
811  {
812  // user wants forward control to be forward control
813  if (fabs(fAxisValue) > joy_forwardthreshold->value)
814  {
815  cmd->forwardmove += (fAxisValue * joy_forwardsensitivity->value) * speed * cl_forwardspeed->value;
816  }
817  }
818  break;
819 
820  case AxisSide:
821  if (fabs(fAxisValue) > joy_sidethreshold->value)
822  {
823  cmd->sidemove += (fAxisValue * joy_sidesensitivity->value) * speed * cl_sidespeed->value;
824  }
825  break;
826 
827  case AxisUp:
828  if (fabs(fAxisValue) > joy_upthreshold->value)
829  {
830  cmd->upmove += (fAxisValue * joy_upsensitivity->value) * speed * cl_upspeed->value;
831  }
832  break;
833 
834  case AxisTurn:
835  if ((in_strafe.state & 1) || (lookstrafe->value && mlooking))
836  {
837  // user wants turn control to become side control
838  if (fabs(fAxisValue) > joy_sidethreshold->value)
839  {
840  cmd->sidemove -= (fAxisValue * joy_sidesensitivity->value) * speed * cl_sidespeed->value;
841  }
842  }
843  else
844  {
845  // user wants turn control to be turn control
846  if (fabs(fAxisValue) > joy_yawthreshold->value)
847  {
849  {
850  cl.viewangles[YAW] += (fAxisValue * joy_yawsensitivity->value) * aspeed * cl_yawspeed->value;
851  }
852  else
853  {
854  cl.viewangles[YAW] += (fAxisValue * joy_yawsensitivity->value) * speed * 180.0;
855  }
856 
857  }
858  }
859  break;
860 
861  case AxisLook:
862  if (mlooking)
863  {
864  if (fabs(fAxisValue) > joy_pitchthreshold->value)
865  {
866  // pitch movement detected and pitch movement desired by user
868  {
869  cl.viewangles[PITCH] += (fAxisValue * joy_pitchsensitivity->value) * aspeed * cl_pitchspeed->value;
870  }
871  else
872  {
873  cl.viewangles[PITCH] += (fAxisValue * joy_pitchsensitivity->value) * speed * 180.0;
874  }
875  }
876  }
877  break;
878 
879  default:
880  break;
881  }
882  }
883 }
884 
sensitivity
cvar_t * sensitivity
Definition: cl_main.c:65
IN_MLookUp
void IN_MLookUp(void)
Definition: in_win.c:113
dwAxisMap
DWORD dwAxisMap[JOY_MAX_AXES]
Definition: in_win.c:51
height
GLsizei height
Definition: qgl_win.c:69
IN_JoyMove
void IN_JoyMove(usercmd_t *cmd)
Definition: in_win.c:747
dwAxisFlags
DWORD dwAxisFlags[JOY_MAX_AXES]
Definition: in_win.c:46
YAW
#define YAW
Definition: q_shared.h:73
_ControlList
_ControlList
Definition: in_win.c:41
JOY_ABSOLUTE_AXIS
#define JOY_ABSOLUTE_AXIS
Definition: in_win.c:31
TRUE
#define TRUE
Definition: stb_vorbis.c:617
joy_id
int joy_id
Definition: in_win.c:86
old_y
int old_y
Definition: in_win.c:124
CVAR_NOSET
#define CVAR_NOSET
Definition: q_shared.h:319
IN_MouseEvent
void IN_MouseEvent(int mstate)
Definition: in_win.c:233
kbutton_t::state
int state
Definition: client.h:474
AxisNada
@ AxisNada
Definition: in_win.c:43
v_centerspeed
cvar_t * v_centerspeed
Definition: in_win.c:331
dwControlMap
DWORD dwControlMap[JOY_MAX_AXES]
Definition: in_win.c:52
cl_run
cvar_t * cl_run
Definition: cl_input.c:230
in_speed
kbutton_t in_speed
Definition: cl_input.c:61
Key_Event
void Key_Event(int key, qboolean down, unsigned time)
Definition: keys.c:744
joy_forwardsensitivity
cvar_t * joy_forwardsensitivity
Definition: in_win.c:76
IN_StartupJoystick
void IN_StartupJoystick(void)
Definition: in_win.c:479
joy_avail
qboolean joy_avail
Definition: in_win.c:83
K_JOY1
#define K_JOY1
Definition: keys.h:89
joy_name
cvar_t * joy_name
Definition: in_win.c:64
old_x
int old_x
Definition: in_win.c:124
joy_advaxisr
cvar_t * joy_advaxisr
Definition: in_win.c:69
cl_upspeed
cvar_t * cl_upspeed
Definition: cl_input.c:223
joy_sidesensitivity
cvar_t * joy_sidesensitivity
Definition: in_win.c:77
K_MOUSE1
#define K_MOUSE1
Definition: keys.h:82
window_center_y
int window_center_y
Definition: in_win.c:133
joy_oldpovstate
DWORD joy_oldpovstate
Definition: in_win.c:84
m_side
cvar_t * m_side
Definition: cl_main.c:70
originalmouseparms
int originalmouseparms[3]
Definition: in_win.c:130
cvar_s::string
char * string
Definition: q_shared.h:327
in_mouse
cvar_t * in_mouse
Definition: in_win.c:55
qboolean
qboolean
Definition: q_shared.h:63
client_state_t::viewangles
vec3_t viewangles
Definition: client.h:125
cl_sidespeed
cvar_t * cl_sidespeed
Definition: cl_input.c:225
my_accum
int my_accum
Definition: in_win.c:122
JOY_AXIS_R
#define JOY_AXIS_R
Definition: in_win.c:37
IN_ClearStates
void IN_ClearStates(void)
Definition: in_win.c:458
i
int i
Definition: q_shared.c:305
IN_DeactivateMouse
void IN_DeactivateMouse(void)
Definition: in_win.c:190
mouse_x
int mouse_x
Definition: in_win.c:122
joy_flags
DWORD joy_flags
Definition: in_win.c:87
joy_upsensitivity
cvar_t * joy_upsensitivity
Definition: in_win.c:81
winquake.h
mlooking
qboolean mlooking
Definition: in_win.c:110
m_forward
cvar_t * m_forward
Definition: cl_main.c:69
RawValuePointer
PDWORD RawValuePointer(int axis)
Definition: in_win.c:550
PITCH
#define PITCH
Definition: q_shared.h:72
joy_oldbuttonstate
DWORD joy_oldbuttonstate
Definition: in_win.c:84
width
GLint GLsizei width
Definition: qgl_win.c:115
Joy_AdvancedUpdate_f
void Joy_AdvancedUpdate_f(void)
Definition: in_win.c:577
JOY_AXIS_X
#define JOY_AXIS_X
Definition: in_win.c:34
usercmd_s::forwardmove
short forwardmove
Definition: q_shared.h:522
joy_pitchthreshold
cvar_t * joy_pitchthreshold
Definition: in_win.c:74
JOY_AXIS_Z
#define JOY_AXIS_Z
Definition: in_win.c:36
Cvar_Get
cvar_t * Cvar_Get(char *var_name, char *var_value, int flags)
Definition: cvar.c:127
joy_yawthreshold
cvar_t * joy_yawthreshold
Definition: in_win.c:75
cvar_s
Definition: q_shared.h:324
cl_yawspeed
cvar_t * cl_yawspeed
Definition: cl_input.c:227
key_menu
@ key_menu
Definition: client.h:200
window_center_x
int window_center_x
Definition: in_win.c:133
AxisUp
@ AxisUp
Definition: in_win.c:43
JOY_RELATIVE_AXIS
#define JOY_RELATIVE_AXIS
Definition: in_win.c:32
freelook
cvar_t * freelook
Definition: cl_main.c:24
joy_sidethreshold
cvar_t * joy_sidethreshold
Definition: in_win.c:73
IN_Activate
void IN_Activate(qboolean active)
Definition: in_win.c:399
restore_spi
qboolean restore_spi
Definition: in_win.c:128
AxisLook
@ AxisLook
Definition: in_win.c:43
IN_MLookDown
void IN_MLookDown(void)
Definition: in_win.c:112
in_joystick
cvar_t * in_joystick
Definition: in_win.c:56
joy_yawsensitivity
cvar_t * joy_yawsensitivity
Definition: in_win.c:79
K_AUX29
#define K_AUX29
Definition: keys.h:126
joy_haspov
qboolean joy_haspov
Definition: in_win.c:83
usercmd_s::sidemove
short sidemove
Definition: q_shared.h:522
IN_ReadJoystick
qboolean IN_ReadJoystick(void)
Definition: in_win.c:719
current_pos
POINT current_pos
Definition: in_win.c:121
JOY_AXIS_U
#define JOY_AXIS_U
Definition: in_win.c:38
cl_forwardspeed
cvar_t * cl_forwardspeed
Definition: cl_input.c:224
JOY_AXIS_V
#define JOY_AXIS_V
Definition: in_win.c:39
JOY_AXIS_Y
#define JOY_AXIS_Y
Definition: in_win.c:35
joy_advaxisx
cvar_t * joy_advaxisx
Definition: in_win.c:66
IN_Frame
void IN_Frame(void)
Definition: in_win.c:413
newmouseparms
int newmouseparms[3]
Definition: in_win.c:130
mouseparmsvalid
qboolean mouseparmsvalid
Definition: in_win.c:131
old_mouse_x
int old_mouse_x
Definition: in_win.c:122
pdwRawValue
PDWORD pdwRawValue[JOY_MAX_AXES]
Definition: in_win.c:53
Cmd_AddCommand
void Cmd_AddCommand(char *cmd_name, xcommand_t function)
Definition: cmd.c:691
client_state_t::refresh_prepped
qboolean refresh_prepped
Definition: client.h:98
v_centermove
cvar_t * v_centermove
Definition: in_win.c:330
m_yaw
cvar_t * m_yaw
Definition: cl_main.c:68
AxisForward
@ AxisForward
Definition: in_win.c:43
lookspring
cvar_t * lookspring
Definition: cl_main.c:63
CVAR_ARCHIVE
#define CVAR_ARCHIVE
Definition: q_shared.h:316
cl_hwnd
HWND cl_hwnd
Definition: vid_dll.c:58
mouse_buttons
int mouse_buttons
Definition: in_win.c:119
lookstrafe
cvar_t * lookstrafe
Definition: cl_main.c:64
cvar_s::value
float value
Definition: q_shared.h:331
joy_advaxisy
cvar_t * joy_advaxisy
Definition: in_win.c:67
mouseactive
qboolean mouseactive
Definition: in_win.c:126
key_console
@ key_console
Definition: client.h:200
NULL
#define NULL
Definition: q_shared.h:67
joy_advaxisv
cvar_t * joy_advaxisv
Definition: in_win.c:71
AxisSide
@ AxisSide
Definition: in_win.c:43
window_rect
RECT window_rect
Definition: in_win.c:134
mouse_oldbuttonstate
int mouse_oldbuttonstate
Definition: in_win.c:120
IN_Commands
void IN_Commands(void)
Definition: in_win.c:649
usercmd_s::upmove
short upmove
Definition: q_shared.h:522
joy_advaxisz
cvar_t * joy_advaxisz
Definition: in_win.c:68
mx_accum
int mx_accum
Definition: in_win.c:122
in_appactive
qboolean in_appactive
Definition: in_win.c:92
joy_upthreshold
cvar_t * joy_upthreshold
Definition: in_win.c:80
IN_StartupMouse
void IN_StartupMouse(void)
Definition: in_win.c:215
areanode_s::axis
int axis
Definition: sv_world.c:43
IN_Shutdown
void IN_Shutdown(void)
Definition: in_win.c:384
m_filter
cvar_t * m_filter
Definition: in_win.c:108
m_pitch
cvar_t * m_pitch
Definition: cl_main.c:67
ActiveApp
qboolean ActiveApp
Definition: sys_win.c:43
joy_advancedinit
qboolean joy_advancedinit
Definition: in_win.c:83
usercmd_s
Definition: q_shared.h:517
sys_msg_time
unsigned sys_msg_time
Definition: sys_win.c:48
K_AUX1
#define K_AUX1
Definition: keys.h:98
IN_ActivateMouse
void IN_ActivateMouse(void)
Definition: in_win.c:144
cl_pitchspeed
cvar_t * cl_pitchspeed
Definition: cl_input.c:228
client_static_t::frametime
float frametime
Definition: client.h:209
ji
static JOYINFOEX ji
Definition: in_win.c:90
mouseinitialized
qboolean mouseinitialized
Definition: in_win.c:129
joy_advaxisu
cvar_t * joy_advaxisu
Definition: in_win.c:70
IN_Init
void IN_Init(void)
Definition: in_win.c:339
joy_forwardthreshold
cvar_t * joy_forwardthreshold
Definition: in_win.c:72
mouse_y
int mouse_y
Definition: in_win.c:122
AxisTurn
@ AxisTurn
Definition: in_win.c:43
IN_CenterView
void IN_CenterView(void)
Definition: cl_input.c:404
joy_advanced
cvar_t * joy_advanced
Definition: in_win.c:65
client_static_t::key_dest
keydest_t key_dest
Definition: client.h:205
DWORD
DWORD
Definition: qgl_win.c:49
IN_Move
void IN_Move(usercmd_t *cmd)
Definition: in_win.c:444
JOY_MAX_AXES
#define JOY_MAX_AXES
Definition: in_win.c:33
joy_pitchsensitivity
cvar_t * joy_pitchsensitivity
Definition: in_win.c:78
Com_Printf
void Com_Printf(char *fmt,...)
Definition: common.c:104
FALSE
#define FALSE
Definition: stb_vorbis.c:618
IN_MouseMove
void IN_MouseMove(usercmd_t *cmd)
Definition: in_win.c:265
cls
client_static_t cls
Definition: cl_main.c:90
cl
client_state_t cl
Definition: cl_main.c:91
old_mouse_y
int old_mouse_y
Definition: in_win.c:122
joy_numbuttons
DWORD joy_numbuttons
Definition: in_win.c:88
Cvar_VariableValue
float Cvar_VariableValue(char *var_name)
Definition: cvar.c:63
in_strafe
kbutton_t in_strafe
Definition: cl_input.c:61