vkQuake2 doxygen  1.0 dev
cl_input.c File Reference
#include "client.h"

Go to the source code of this file.

Functions

void KeyDown (kbutton_t *b)
 
void KeyUp (kbutton_t *b)
 
void IN_KLookDown (void)
 
void IN_KLookUp (void)
 
void IN_UpDown (void)
 
void IN_UpUp (void)
 
void IN_DownDown (void)
 
void IN_DownUp (void)
 
void IN_LeftDown (void)
 
void IN_LeftUp (void)
 
void IN_RightDown (void)
 
void IN_RightUp (void)
 
void IN_ForwardDown (void)
 
void IN_ForwardUp (void)
 
void IN_BackDown (void)
 
void IN_BackUp (void)
 
void IN_LookupDown (void)
 
void IN_LookupUp (void)
 
void IN_LookdownDown (void)
 
void IN_LookdownUp (void)
 
void IN_MoveleftDown (void)
 
void IN_MoveleftUp (void)
 
void IN_MoverightDown (void)
 
void IN_MoverightUp (void)
 
void IN_SpeedDown (void)
 
void IN_SpeedUp (void)
 
void IN_StrafeDown (void)
 
void IN_StrafeUp (void)
 
void IN_AttackDown (void)
 
void IN_AttackUp (void)
 
void IN_UseDown (void)
 
void IN_UseUp (void)
 
void IN_Impulse (void)
 
float CL_KeyState (kbutton_t *key)
 
void CL_AdjustAngles (void)
 
void CL_BaseMove (usercmd_t *cmd)
 
void CL_ClampPitch (void)
 
void CL_FinishMove (usercmd_t *cmd)
 
usercmd_t CL_CreateCmd (void)
 
void IN_CenterView (void)
 
void CL_InitInput (void)
 
void CL_SendCmd (void)
 

Variables

cvar_tcl_nodelta
 
unsigned sys_frame_time
 
unsigned frame_msec
 
unsigned old_sys_frame_time
 
kbutton_t in_klook
 
kbutton_t in_left
 
kbutton_t in_right
 
kbutton_t in_forward
 
kbutton_t in_back
 
kbutton_t in_lookup
 
kbutton_t in_lookdown
 
kbutton_t in_moveleft
 
kbutton_t in_moveright
 
kbutton_t in_strafe
 
kbutton_t in_speed
 
kbutton_t in_use
 
kbutton_t in_attack
 
kbutton_t in_up
 
kbutton_t in_down
 
int in_impulse
 
cvar_tcl_upspeed
 
cvar_tcl_forwardspeed
 
cvar_tcl_sidespeed
 
cvar_tcl_yawspeed
 
cvar_tcl_pitchspeed
 
cvar_tcl_run
 
cvar_tcl_anglespeedkey
 

Function Documentation

◆ CL_AdjustAngles()

void CL_AdjustAngles ( void  )

Definition at line 242 of file cl_input.c.

243 {
244  float speed;
245  float up, down;
246 
247  if (in_speed.state & 1)
248  speed = cls.frametime * cl_anglespeedkey->value;
249  else
250  speed = cls.frametime;
251 
252  if (!(in_strafe.state & 1))
253  {
256  }
257  if (in_klook.state & 1)
258  {
261  }
262 
263  up = CL_KeyState (&in_lookup);
264  down = CL_KeyState(&in_lookdown);
265 
266  cl.viewangles[PITCH] -= speed*cl_pitchspeed->value * up;
267  cl.viewangles[PITCH] += speed*cl_pitchspeed->value * down;
268 }

Referenced by CL_BaseMove().

◆ CL_BaseMove()

void CL_BaseMove ( usercmd_t cmd)

Definition at line 277 of file cl_input.c.

278 {
279  CL_AdjustAngles ();
280 
281  memset (cmd, 0, sizeof(*cmd));
282 
283  VectorCopy (cl.viewangles, cmd->angles);
284  if (in_strafe.state & 1)
285  {
288  }
289 
292 
293  cmd->upmove += cl_upspeed->value * CL_KeyState (&in_up);
294  cmd->upmove -= cl_upspeed->value * CL_KeyState (&in_down);
295 
296  if (! (in_klook.state & 1) )
297  {
300  }
301 
302 //
303 // adjust for speed key / running
304 //
305  if ( (in_speed.state & 1) ^ (int)(cl_run->value) )
306  {
307  cmd->forwardmove *= 2;
308  cmd->sidemove *= 2;
309  cmd->upmove *= 2;
310  }
311 }

Referenced by CL_CreateCmd().

◆ CL_ClampPitch()

void CL_ClampPitch ( void  )

Definition at line 313 of file cl_input.c.

314 {
315  float pitch;
316 
318  if (pitch > 180)
319  pitch -= 360;
320 
321  if (cl.viewangles[PITCH] + pitch < -360)
322  cl.viewangles[PITCH] += 360; // wrapped
323  if (cl.viewangles[PITCH] + pitch > 360)
324  cl.viewangles[PITCH] -= 360; // wrapped
325 
326  if (cl.viewangles[PITCH] + pitch > 89)
327  cl.viewangles[PITCH] = 89 - pitch;
328  if (cl.viewangles[PITCH] + pitch < -89)
329  cl.viewangles[PITCH] = -89 - pitch;
330 }

Referenced by CL_FinishMove().

◆ CL_CreateCmd()

usercmd_t CL_CreateCmd ( void  )

Definition at line 378 of file cl_input.c.

379 {
380  usercmd_t cmd;
381 
383  if (frame_msec < 1)
384  frame_msec = 1;
385  if (frame_msec > 200)
386  frame_msec = 200;
387 
388  // get basic movement from keyboard
389  CL_BaseMove (&cmd);
390 
391  // allow mice or other external controllers to add to the move
392  IN_Move (&cmd);
393 
394  CL_FinishMove (&cmd);
395 
397 
398 //cmd.impulse = cls.framecount;
399 
400  return cmd;
401 }

Referenced by CL_SendCmd().

◆ CL_FinishMove()

void CL_FinishMove ( usercmd_t cmd)

Definition at line 337 of file cl_input.c.

338 {
339  int ms;
340  int i;
341 
342 //
343 // figure button bits
344 //
345  if ( in_attack.state & 3 )
346  cmd->buttons |= BUTTON_ATTACK;
347  in_attack.state &= ~2;
348 
349  if (in_use.state & 3)
350  cmd->buttons |= BUTTON_USE;
351  in_use.state &= ~2;
352 
353  if (anykeydown && cls.key_dest == key_game)
354  cmd->buttons |= BUTTON_ANY;
355 
356  // send milliseconds of time to apply the move
357  ms = cls.frametime * 1000;
358  if (ms > 250)
359  ms = 100; // time was unreasonable
360  cmd->msec = ms;
361 
362  CL_ClampPitch ();
363  for (i=0 ; i<3 ; i++)
364  cmd->angles[i] = ANGLE2SHORT(cl.viewangles[i]);
365 
366  cmd->impulse = in_impulse;
367  in_impulse = 0;
368 
369 // send the ambient light level at the player's current position
371 }

Referenced by CL_CreateCmd().

◆ CL_InitInput()

void CL_InitInput ( void  )

Definition at line 414 of file cl_input.c.

415 {
416  Cmd_AddCommand ("centerview",IN_CenterView);
417 
418  Cmd_AddCommand ("+moveup",IN_UpDown);
419  Cmd_AddCommand ("-moveup",IN_UpUp);
420  Cmd_AddCommand ("+movedown",IN_DownDown);
421  Cmd_AddCommand ("-movedown",IN_DownUp);
422  Cmd_AddCommand ("+left",IN_LeftDown);
423  Cmd_AddCommand ("-left",IN_LeftUp);
424  Cmd_AddCommand ("+right",IN_RightDown);
425  Cmd_AddCommand ("-right",IN_RightUp);
426  Cmd_AddCommand ("+forward",IN_ForwardDown);
427  Cmd_AddCommand ("-forward",IN_ForwardUp);
428  Cmd_AddCommand ("+back",IN_BackDown);
429  Cmd_AddCommand ("-back",IN_BackUp);
430  Cmd_AddCommand ("+lookup", IN_LookupDown);
431  Cmd_AddCommand ("-lookup", IN_LookupUp);
432  Cmd_AddCommand ("+lookdown", IN_LookdownDown);
433  Cmd_AddCommand ("-lookdown", IN_LookdownUp);
434  Cmd_AddCommand ("+strafe", IN_StrafeDown);
435  Cmd_AddCommand ("-strafe", IN_StrafeUp);
436  Cmd_AddCommand ("+moveleft", IN_MoveleftDown);
437  Cmd_AddCommand ("-moveleft", IN_MoveleftUp);
438  Cmd_AddCommand ("+moveright", IN_MoverightDown);
439  Cmd_AddCommand ("-moveright", IN_MoverightUp);
440  Cmd_AddCommand ("+speed", IN_SpeedDown);
441  Cmd_AddCommand ("-speed", IN_SpeedUp);
442  Cmd_AddCommand ("+attack", IN_AttackDown);
443  Cmd_AddCommand ("-attack", IN_AttackUp);
444  Cmd_AddCommand ("+use", IN_UseDown);
445  Cmd_AddCommand ("-use", IN_UseUp);
446  Cmd_AddCommand ("impulse", IN_Impulse);
447  Cmd_AddCommand ("+klook", IN_KLookDown);
448  Cmd_AddCommand ("-klook", IN_KLookUp);
449 
450  cl_nodelta = Cvar_Get ("cl_nodelta", "0", 0);
451 }

Referenced by CL_InitLocal().

◆ CL_KeyState()

float CL_KeyState ( kbutton_t key)

Definition at line 186 of file cl_input.c.

187 {
188  float val;
189  int msec;
190 
191  key->state &= 1; // clear impulses
192 
193  msec = key->msec;
194  key->msec = 0;
195 
196  if (key->state)
197  { // still down
198  msec += sys_frame_time - key->downtime;
199  key->downtime = sys_frame_time;
200  }
201 
202 #if 0
203  if (msec)
204  {
205  Com_Printf ("%i ", msec);
206  }
207 #endif
208 
209  val = (float)msec / frame_msec;
210  if (val < 0)
211  val = 0;
212  if (val > 1)
213  val = 1;
214 
215  return val;
216 }

Referenced by CL_AdjustAngles(), and CL_BaseMove().

◆ CL_SendCmd()

void CL_SendCmd ( void  )

Definition at line 460 of file cl_input.c.

461 {
462  sizebuf_t buf;
463  byte data[128];
464  int i;
465  usercmd_t *cmd, *oldcmd;
466  usercmd_t nullcmd;
467  int checksumIndex;
468 
469  memset( &buf, 0, sizeof(buf) );
470 
471  // build a command even if not connected
472 
473  // save this command off for prediction
475  cmd = &cl.cmds[i];
476  cl.cmd_time[i] = cls.realtime; // for netgraph ping calculation
477 
478  *cmd = CL_CreateCmd ();
479 
480  cl.cmd = *cmd;
481 
483  return;
484 
485  if ( cls.state == ca_connected)
486  {
488  Netchan_Transmit (&cls.netchan, 0, buf.data);
489  return;
490  }
491 
492  // send a userinfo update if needed
493  if (userinfo_modified)
494  {
495  CL_FixUpGender();
496  userinfo_modified = false;
499  }
500 
501  SZ_Init (&buf, data, sizeof(data));
502 
503  if (cmd->buttons && cl.cinematictime > 0 && !cl.attractloop
504  && cls.realtime - cl.cinematictime > 1000)
505  { // skip the rest of the cinematic
507  }
508 
509  // begin a client move command
510  MSG_WriteByte (&buf, clc_move);
511 
512  // save the position for a checksum byte
513  checksumIndex = buf.cursize;
514  MSG_WriteByte (&buf, 0);
515 
516  // let the server know what the last frame we
517  // got was, so the next message can be delta compressed
519  MSG_WriteLong (&buf, -1); // no compression
520  else
522 
523  // send this and the previous cmds in the message, so
524  // if the last packet was dropped, it can be recovered
526  cmd = &cl.cmds[i];
527  memset (&nullcmd, 0, sizeof(nullcmd));
528  MSG_WriteDeltaUsercmd (&buf, &nullcmd, cmd);
529  oldcmd = cmd;
530 
532  cmd = &cl.cmds[i];
533  MSG_WriteDeltaUsercmd (&buf, oldcmd, cmd);
534  oldcmd = cmd;
535 
537  cmd = &cl.cmds[i];
538  MSG_WriteDeltaUsercmd (&buf, oldcmd, cmd);
539 
540  // calculate a checksum over the move commands
541  buf.data[checksumIndex] = COM_BlockSequenceCRCByte(
542  buf.data + checksumIndex + 1, buf.cursize - checksumIndex - 1,
544 
545  //
546  // deliver the message
547  //
548  Netchan_Transmit (&cls.netchan, buf.cursize, buf.data);
549 }

Referenced by CL_SendCommand().

◆ IN_AttackDown()

void IN_AttackDown ( void  )

Definition at line 171 of file cl_input.c.

171 {KeyDown(&in_attack);}

Referenced by CL_InitInput().

◆ IN_AttackUp()

void IN_AttackUp ( void  )

Definition at line 172 of file cl_input.c.

172 {KeyUp(&in_attack);}

Referenced by CL_InitInput().

◆ IN_BackDown()

void IN_BackDown ( void  )

Definition at line 155 of file cl_input.c.

155 {KeyDown(&in_back);}

Referenced by CL_InitInput().

◆ IN_BackUp()

void IN_BackUp ( void  )

Definition at line 156 of file cl_input.c.

156 {KeyUp(&in_back);}

Referenced by CL_InitInput().

◆ IN_CenterView()

void IN_CenterView ( void  )

Definition at line 404 of file cl_input.c.

Referenced by CL_InitInput(), and IN_MLookUp().

◆ IN_DownDown()

void IN_DownDown ( void  )

Definition at line 147 of file cl_input.c.

147 {KeyDown(&in_down);}

Referenced by CL_InitInput().

◆ IN_DownUp()

void IN_DownUp ( void  )

Definition at line 148 of file cl_input.c.

148 {KeyUp(&in_down);}

Referenced by CL_InitInput().

◆ IN_ForwardDown()

void IN_ForwardDown ( void  )

Definition at line 153 of file cl_input.c.

153 {KeyDown(&in_forward);}

Referenced by CL_InitInput().

◆ IN_ForwardUp()

void IN_ForwardUp ( void  )

Definition at line 154 of file cl_input.c.

154 {KeyUp(&in_forward);}

Referenced by CL_InitInput().

◆ IN_Impulse()

void IN_Impulse ( void  )

Definition at line 177 of file cl_input.c.

177 {in_impulse=atoi(Cmd_Argv(1));}

Referenced by CL_InitInput().

◆ IN_KLookDown()

void IN_KLookDown ( void  )

Definition at line 143 of file cl_input.c.

143 {KeyDown(&in_klook);}

Referenced by CL_InitInput().

◆ IN_KLookUp()

void IN_KLookUp ( void  )

Definition at line 144 of file cl_input.c.

144 {KeyUp(&in_klook);}

Referenced by CL_InitInput().

◆ IN_LeftDown()

void IN_LeftDown ( void  )

Definition at line 149 of file cl_input.c.

149 {KeyDown(&in_left);}

Referenced by CL_InitInput().

◆ IN_LeftUp()

void IN_LeftUp ( void  )

Definition at line 150 of file cl_input.c.

150 {KeyUp(&in_left);}

Referenced by CL_InitInput().

◆ IN_LookdownDown()

void IN_LookdownDown ( void  )

Definition at line 159 of file cl_input.c.

159 {KeyDown(&in_lookdown);}

Referenced by CL_InitInput().

◆ IN_LookdownUp()

void IN_LookdownUp ( void  )

Definition at line 160 of file cl_input.c.

160 {KeyUp(&in_lookdown);}

Referenced by CL_InitInput().

◆ IN_LookupDown()

void IN_LookupDown ( void  )

Definition at line 157 of file cl_input.c.

157 {KeyDown(&in_lookup);}

Referenced by CL_InitInput().

◆ IN_LookupUp()

void IN_LookupUp ( void  )

Definition at line 158 of file cl_input.c.

158 {KeyUp(&in_lookup);}

Referenced by CL_InitInput().

◆ IN_MoveleftDown()

void IN_MoveleftDown ( void  )

Definition at line 161 of file cl_input.c.

161 {KeyDown(&in_moveleft);}

Referenced by CL_InitInput().

◆ IN_MoveleftUp()

void IN_MoveleftUp ( void  )

Definition at line 162 of file cl_input.c.

162 {KeyUp(&in_moveleft);}

Referenced by CL_InitInput().

◆ IN_MoverightDown()

void IN_MoverightDown ( void  )

Definition at line 163 of file cl_input.c.

Referenced by CL_InitInput().

◆ IN_MoverightUp()

void IN_MoverightUp ( void  )

Definition at line 164 of file cl_input.c.

164 {KeyUp(&in_moveright);}

Referenced by CL_InitInput().

◆ IN_RightDown()

void IN_RightDown ( void  )

Definition at line 151 of file cl_input.c.

151 {KeyDown(&in_right);}

Referenced by CL_InitInput().

◆ IN_RightUp()

void IN_RightUp ( void  )

Definition at line 152 of file cl_input.c.

152 {KeyUp(&in_right);}

Referenced by CL_InitInput().

◆ IN_SpeedDown()

void IN_SpeedDown ( void  )

Definition at line 166 of file cl_input.c.

166 {KeyDown(&in_speed);}

Referenced by CL_InitInput().

◆ IN_SpeedUp()

void IN_SpeedUp ( void  )

Definition at line 167 of file cl_input.c.

167 {KeyUp(&in_speed);}

Referenced by CL_InitInput().

◆ IN_StrafeDown()

void IN_StrafeDown ( void  )

Definition at line 168 of file cl_input.c.

168 {KeyDown(&in_strafe);}

Referenced by CL_InitInput().

◆ IN_StrafeUp()

void IN_StrafeUp ( void  )

Definition at line 169 of file cl_input.c.

169 {KeyUp(&in_strafe);}

Referenced by CL_InitInput().

◆ IN_UpDown()

void IN_UpDown ( void  )

Definition at line 145 of file cl_input.c.

145 {KeyDown(&in_up);}

Referenced by CL_InitInput().

◆ IN_UpUp()

void IN_UpUp ( void  )

Definition at line 146 of file cl_input.c.

146 {KeyUp(&in_up);}

Referenced by CL_InitInput().

◆ IN_UseDown()

void IN_UseDown ( void  )

Definition at line 174 of file cl_input.c.

174 {KeyDown(&in_use);}

Referenced by CL_InitInput().

◆ IN_UseUp()

void IN_UseUp ( void  )

Definition at line 175 of file cl_input.c.

175 {KeyUp(&in_use);}

Referenced by CL_InitInput().

◆ KeyDown()

void KeyDown ( kbutton_t b)

Definition at line 67 of file cl_input.c.

68 {
69  int k;
70  char *c;
71 
72  c = Cmd_Argv(1);
73  if (c[0])
74  k = atoi(c);
75  else
76  k = -1; // typed manually at the console for continuous down
77 
78  if (k == b->down[0] || k == b->down[1])
79  return; // repeating key
80 
81  if (!b->down[0])
82  b->down[0] = k;
83  else if (!b->down[1])
84  b->down[1] = k;
85  else
86  {
87  Com_Printf ("Three keys down for a button!\n");
88  return;
89  }
90 
91  if (b->state & 1)
92  return; // still down
93 
94  // save timestamp
95  c = Cmd_Argv(2);
96  b->downtime = atoi(c);
97  if (!b->downtime)
98  b->downtime = sys_frame_time - 100;
99 
100  b->state |= 1 + 2; // down + impulse down
101 }

Referenced by IN_AttackDown(), IN_BackDown(), IN_DownDown(), IN_ForwardDown(), IN_KLookDown(), IN_LeftDown(), IN_LookdownDown(), IN_LookupDown(), IN_MoveleftDown(), IN_MoverightDown(), IN_RightDown(), IN_SpeedDown(), IN_StrafeDown(), IN_UpDown(), and IN_UseDown().

◆ KeyUp()

void KeyUp ( kbutton_t b)

Definition at line 103 of file cl_input.c.

104 {
105  int k;
106  char *c;
107  unsigned uptime;
108 
109  c = Cmd_Argv(1);
110  if (c[0])
111  k = atoi(c);
112  else
113  { // typed manually at the console, assume for unsticking, so clear all
114  b->down[0] = b->down[1] = 0;
115  b->state = 4; // impulse up
116  return;
117  }
118 
119  if (b->down[0] == k)
120  b->down[0] = 0;
121  else if (b->down[1] == k)
122  b->down[1] = 0;
123  else
124  return; // key up without coresponding down (menu pass through)
125  if (b->down[0] || b->down[1])
126  return; // some other key is still holding it down
127 
128  if (!(b->state & 1))
129  return; // still up (this should not happen)
130 
131  // save timestamp
132  c = Cmd_Argv(2);
133  uptime = atoi(c);
134  if (uptime)
135  b->msec += uptime - b->downtime;
136  else
137  b->msec += 10;
138 
139  b->state &= ~1; // now up
140  b->state |= 4; // impulse up
141 }

Referenced by IN_AttackUp(), IN_BackUp(), IN_DownUp(), IN_ForwardUp(), IN_KLookUp(), IN_LeftUp(), IN_LookdownUp(), IN_LookupUp(), IN_MoveleftUp(), IN_MoverightUp(), IN_RightUp(), IN_SpeedUp(), IN_StrafeUp(), IN_UpUp(), and IN_UseUp().

Variable Documentation

◆ cl_anglespeedkey

cvar_t* cl_anglespeedkey

Definition at line 232 of file cl_input.c.

Referenced by CL_AdjustAngles(), and CL_InitLocal().

◆ cl_forwardspeed

cvar_t* cl_forwardspeed

Definition at line 224 of file cl_input.c.

Referenced by CL_BaseMove(), CL_InitLocal(), and IN_JoyMove().

◆ cl_nodelta

cvar_t* cl_nodelta

Definition at line 25 of file cl_input.c.

Referenced by CL_InitInput(), and CL_SendCmd().

◆ cl_pitchspeed

cvar_t* cl_pitchspeed

Definition at line 228 of file cl_input.c.

Referenced by CL_AdjustAngles(), CL_InitLocal(), and IN_JoyMove().

◆ cl_run

cvar_t* cl_run

Definition at line 230 of file cl_input.c.

Referenced by CL_BaseMove(), CL_InitLocal(), ControlsSetMenuItemValues(), and IN_JoyMove().

◆ cl_sidespeed

cvar_t* cl_sidespeed

Definition at line 225 of file cl_input.c.

Referenced by CL_BaseMove(), CL_InitLocal(), and IN_JoyMove().

◆ cl_upspeed

cvar_t* cl_upspeed

Definition at line 223 of file cl_input.c.

Referenced by CL_BaseMove(), CL_InitLocal(), and IN_JoyMove().

◆ cl_yawspeed

cvar_t* cl_yawspeed

Definition at line 227 of file cl_input.c.

Referenced by CL_AdjustAngles(), CL_InitLocal(), and IN_JoyMove().

◆ frame_msec

unsigned frame_msec

Definition at line 28 of file cl_input.c.

Referenced by CL_CreateCmd(), and CL_KeyState().

◆ in_attack

kbutton_t in_attack

Definition at line 61 of file cl_input.c.

Referenced by CL_FinishMove(), IN_AttackDown(), and IN_AttackUp().

◆ in_back

kbutton_t in_back

Definition at line 59 of file cl_input.c.

Referenced by CL_AdjustAngles(), CL_BaseMove(), IN_BackDown(), and IN_BackUp().

◆ in_down

kbutton_t in_down

Definition at line 62 of file cl_input.c.

Referenced by CL_BaseMove(), IN_DownDown(), and IN_DownUp().

◆ in_forward

kbutton_t in_forward

Definition at line 59 of file cl_input.c.

Referenced by CL_AdjustAngles(), CL_BaseMove(), IN_ForwardDown(), and IN_ForwardUp().

◆ in_impulse

int in_impulse

Definition at line 64 of file cl_input.c.

Referenced by CL_FinishMove(), and IN_Impulse().

◆ in_klook

kbutton_t in_klook

Definition at line 58 of file cl_input.c.

Referenced by CL_AdjustAngles(), CL_BaseMove(), IN_KLookDown(), and IN_KLookUp().

◆ in_left

kbutton_t in_left

Definition at line 59 of file cl_input.c.

Referenced by CL_AdjustAngles(), CL_BaseMove(), IN_LeftDown(), and IN_LeftUp().

◆ in_lookdown

kbutton_t in_lookdown

Definition at line 60 of file cl_input.c.

Referenced by CL_AdjustAngles(), IN_LookdownDown(), and IN_LookdownUp().

◆ in_lookup

kbutton_t in_lookup

Definition at line 60 of file cl_input.c.

Referenced by CL_AdjustAngles(), IN_LookupDown(), and IN_LookupUp().

◆ in_moveleft

kbutton_t in_moveleft

Definition at line 60 of file cl_input.c.

Referenced by CL_BaseMove(), IN_MoveleftDown(), and IN_MoveleftUp().

◆ in_moveright

kbutton_t in_moveright

Definition at line 60 of file cl_input.c.

Referenced by CL_BaseMove(), IN_MoverightDown(), and IN_MoverightUp().

◆ in_right

kbutton_t in_right

Definition at line 59 of file cl_input.c.

Referenced by CL_AdjustAngles(), CL_BaseMove(), IN_RightDown(), and IN_RightUp().

◆ in_speed

kbutton_t in_speed

Definition at line 61 of file cl_input.c.

Referenced by CL_AdjustAngles(), CL_BaseMove(), IN_JoyMove(), IN_SpeedDown(), and IN_SpeedUp().

◆ in_strafe

kbutton_t in_strafe

◆ in_up

kbutton_t in_up

Definition at line 62 of file cl_input.c.

Referenced by CL_BaseMove(), IN_UpDown(), and IN_UpUp().

◆ in_use

kbutton_t in_use

Definition at line 61 of file cl_input.c.

Referenced by CL_FinishMove(), IN_UseDown(), and IN_UseUp().

◆ old_sys_frame_time

unsigned old_sys_frame_time

Definition at line 29 of file cl_input.c.

Referenced by CL_CreateCmd().

◆ sys_frame_time

unsigned sys_frame_time

Definition at line 49 of file sys_win.c.

Referenced by CL_CreateCmd(), CL_KeyState(), KeyDown(), and Sys_SendKeyEvents().

in_lookdown
kbutton_t in_lookdown
Definition: cl_input.c:60
IN_MoveleftUp
void IN_MoveleftUp(void)
Definition: cl_input.c:162
in_moveleft
kbutton_t in_moveleft
Definition: cl_input.c:60
usercmd_s::lightlevel
byte lightlevel
Definition: q_shared.h:524
usercmd_s::impulse
byte impulse
Definition: q_shared.h:523
curtime
int curtime
Definition: q_shwin.c:119
sizebuf_s
Definition: qcommon.h:92
YAW
#define YAW
Definition: q_shared.h:73
IN_AttackDown
void IN_AttackDown(void)
Definition: cl_input.c:171
CL_ClampPitch
void CL_ClampPitch(void)
Definition: cl_input.c:313
IN_UpDown
void IN_UpDown(void)
Definition: cl_input.c:145
MSG_WriteDeltaUsercmd
void MSG_WriteDeltaUsercmd(sizebuf_t *buf, usercmd_t *from, usercmd_t *cmd)
Definition: common.c:387
IN_SpeedDown
void IN_SpeedDown(void)
Definition: cl_input.c:166
client_state_t::attractloop
qboolean attractloop
Definition: client.h:153
kbutton_t::state
int state
Definition: client.h:474
cl_lightlevel
cvar_t * cl_lightlevel
Definition: cl_main.c:72
in_klook
kbutton_t in_klook
Definition: cl_input.c:58
ca_disconnected
@ ca_disconnected
Definition: client.h:186
IN_SpeedUp
void IN_SpeedUp(void)
Definition: cl_input.c:167
cl_run
cvar_t * cl_run
Definition: cl_input.c:230
client_state_t::cmd_time
int cmd_time[CMD_BACKUP]
Definition: client.h:106
in_speed
kbutton_t in_speed
Definition: cl_input.c:61
CL_AdjustAngles
void CL_AdjustAngles(void)
Definition: cl_input.c:242
IN_LookupUp
void IN_LookupUp(void)
Definition: cl_input.c:158
netchan_t::message
sizebuf_t message
Definition: qcommon.h:608
cl_upspeed
cvar_t * cl_upspeed
Definition: cl_input.c:223
ca_connecting
@ ca_connecting
Definition: client.h:187
Cvar_Userinfo
char * Cvar_Userinfo(void)
Definition: cvar.c:504
IN_RightUp
void IN_RightUp(void)
Definition: cl_input.c:152
client_state_t::viewangles
vec3_t viewangles
Definition: client.h:125
cl_sidespeed
cvar_t * cl_sidespeed
Definition: cl_input.c:225
i
int i
Definition: q_shared.c:305
anykeydown
int anykeydown
Definition: keys.c:34
in_back
kbutton_t in_back
Definition: cl_input.c:59
IN_BackUp
void IN_BackUp(void)
Definition: cl_input.c:156
MSG_WriteLong
void MSG_WriteLong(sizebuf_t *sb, int c)
Definition: common.c:330
PITCH
#define PITCH
Definition: q_shared.h:72
client_state_t::cinematictime
int cinematictime
Definition: client.h:145
BUTTON_USE
#define BUTTON_USE
Definition: q_shared.h:512
CL_KeyState
float CL_KeyState(kbutton_t *key)
Definition: cl_input.c:186
SZ_Init
void SZ_Init(sizebuf_t *buf, byte *data, int length)
Definition: common.c:885
usercmd_s::forwardmove
short forwardmove
Definition: q_shared.h:522
sizebuf_s::data
byte * data
Definition: qcommon.h:96
cl_nodelta
cvar_t * cl_nodelta
Definition: cl_input.c:25
Cvar_Get
cvar_t * Cvar_Get(char *var_name, char *var_value, int flags)
Definition: cvar.c:127
cl_yawspeed
cvar_t * cl_yawspeed
Definition: cl_input.c:227
in_attack
kbutton_t in_attack
Definition: cl_input.c:61
BUTTON_ATTACK
#define BUTTON_ATTACK
Definition: q_shared.h:511
frame_msec
unsigned frame_msec
Definition: cl_input.c:28
Cmd_Argv
char * Cmd_Argv(int arg)
Definition: cmd.c:517
IN_LookdownDown
void IN_LookdownDown(void)
Definition: cl_input.c:159
byte
unsigned char byte
Definition: q_shared.h:62
IN_UpUp
void IN_UpUp(void)
Definition: cl_input.c:146
userinfo_modified
qboolean userinfo_modified
Definition: cvar.c:485
usercmd_s::sidemove
short sidemove
Definition: q_shared.h:522
in_lookup
kbutton_t in_lookup
Definition: cl_input.c:60
IN_Impulse
void IN_Impulse(void)
Definition: cl_input.c:177
cl_forwardspeed
cvar_t * cl_forwardspeed
Definition: cl_input.c:224
IN_BackDown
void IN_BackDown(void)
Definition: cl_input.c:155
client_static_t::demowaiting
qboolean demowaiting
Definition: client.h:238
in_left
kbutton_t in_left
Definition: cl_input.c:59
in_forward
kbutton_t in_forward
Definition: cl_input.c:59
IN_DownUp
void IN_DownUp(void)
Definition: cl_input.c:148
COM_BlockSequenceCRCByte
byte COM_BlockSequenceCRCByte(byte *base, int length, int sequence)
Definition: common.c:1338
IN_MoverightUp
void IN_MoverightUp(void)
Definition: cl_input.c:164
netchan_t::last_sent
int last_sent
Definition: qcommon.h:591
player_state_t::pmove
pmove_state_t pmove
Definition: q_shared.h:1176
Cmd_AddCommand
void Cmd_AddCommand(char *cmd_name, xcommand_t function)
Definition: cmd.c:691
kbutton_t::down
int down[2]
Definition: client.h:471
key_game
@ key_game
Definition: client.h:200
BUTTON_ANY
#define BUTTON_ANY
Definition: q_shared.h:513
IN_UseDown
void IN_UseDown(void)
Definition: cl_input.c:174
cvar_s::value
float value
Definition: q_shared.h:331
client_state_t::cmds
usercmd_t cmds[CMD_BACKUP]
Definition: client.h:105
in_moveright
kbutton_t in_moveright
Definition: cl_input.c:60
CL_FinishMove
void CL_FinishMove(usercmd_t *cmd)
Definition: cl_input.c:337
IN_KLookUp
void IN_KLookUp(void)
Definition: cl_input.c:144
frame_t::valid
qboolean valid
Definition: client.h:45
pmove_state_t::delta_angles
short delta_angles[3]
Definition: q_shared.h:503
frame_t::serverframe
int serverframe
Definition: client.h:46
IN_MoverightDown
void IN_MoverightDown(void)
Definition: cl_input.c:163
MSG_WriteString
void MSG_WriteString(sizebuf_t *sb, char *s)
Definition: common.c:356
client_state_t::frame
frame_t frame
Definition: client.h:116
CMD_BACKUP
#define CMD_BACKUP
Definition: client.h:85
MSG_WriteByte
void MSG_WriteByte(sizebuf_t *sb, int c)
Definition: common.c:303
IN_ForwardDown
void IN_ForwardDown(void)
Definition: cl_input.c:153
in_up
kbutton_t in_up
Definition: cl_input.c:62
kbutton_t::msec
unsigned msec
Definition: client.h:473
clc_userinfo
@ clc_userinfo
Definition: qcommon.h:259
usercmd_s::upmove
short upmove
Definition: q_shared.h:522
IN_DownDown
void IN_DownDown(void)
Definition: cl_input.c:147
CL_FixUpGender
void CL_FixUpGender(void)
Definition: cl_main.c:1053
frame_t::playerstate
player_state_t playerstate
Definition: client.h:50
IN_LookupDown
void IN_LookupDown(void)
Definition: cl_input.c:157
IN_ForwardUp
void IN_ForwardUp(void)
Definition: cl_input.c:154
VectorCopy
#define VectorCopy(a, b)
Definition: q_shared.h:165
IN_KLookDown
void IN_KLookDown(void)
Definition: cl_input.c:143
netchan_t::outgoing_sequence
int outgoing_sequence
Definition: qcommon.h:603
CL_CreateCmd
usercmd_t CL_CreateCmd(void)
Definition: cl_input.c:378
IN_LeftDown
void IN_LeftDown(void)
Definition: cl_input.c:149
usercmd_s
Definition: q_shared.h:517
up
static vec3_t up
Definition: p_view.c:29
IN_UseUp
void IN_UseUp(void)
Definition: cl_input.c:175
client_static_t::state
connstate_t state
Definition: client.h:204
SCR_FinishCinematic
void SCR_FinishCinematic(void)
Definition: cl_cin.c:198
IN_LookdownUp
void IN_LookdownUp(void)
Definition: cl_input.c:160
client_state_t::cmd
usercmd_t cmd
Definition: client.h:104
cl_anglespeedkey
cvar_t * cl_anglespeedkey
Definition: cl_input.c:232
SHORT2ANGLE
#define SHORT2ANGLE(x)
Definition: q_shared.h:1093
cl_pitchspeed
cvar_t * cl_pitchspeed
Definition: cl_input.c:228
usercmd_s::angles
short angles[3]
Definition: q_shared.h:521
client_static_t::frametime
float frametime
Definition: client.h:209
in_impulse
int in_impulse
Definition: cl_input.c:64
Netchan_Transmit
void Netchan_Transmit(netchan_t *chan, int length, byte *data)
Definition: net_chan.c:213
sizebuf_s::cursize
int cursize
Definition: qcommon.h:98
old_sys_frame_time
unsigned old_sys_frame_time
Definition: cl_input.c:29
KeyUp
void KeyUp(kbutton_t *b)
Definition: cl_input.c:103
usercmd_s::msec
byte msec
Definition: q_shared.h:519
usercmd_s::buttons
byte buttons
Definition: q_shared.h:520
IN_CenterView
void IN_CenterView(void)
Definition: cl_input.c:404
in_down
kbutton_t in_down
Definition: cl_input.c:62
client_static_t::key_dest
keydest_t key_dest
Definition: client.h:205
ca_connected
@ ca_connected
Definition: client.h:188
IN_Move
void IN_Move(usercmd_t *cmd)
Definition: in_win.c:444
Com_Printf
void Com_Printf(char *fmt,...)
Definition: common.c:104
ANGLE2SHORT
#define ANGLE2SHORT(x)
Definition: q_shared.h:1092
CL_BaseMove
void CL_BaseMove(usercmd_t *cmd)
Definition: cl_input.c:277
in_right
kbutton_t in_right
Definition: cl_input.c:59
in_use
kbutton_t in_use
Definition: cl_input.c:61
cls
client_static_t cls
Definition: cl_main.c:90
clc_move
@ clc_move
Definition: qcommon.h:258
IN_RightDown
void IN_RightDown(void)
Definition: cl_input.c:151
IN_LeftUp
void IN_LeftUp(void)
Definition: cl_input.c:150
cl
client_state_t cl
Definition: cl_main.c:91
kbutton_t::downtime
unsigned downtime
Definition: client.h:472
sys_frame_time
unsigned sys_frame_time
Definition: sys_win.c:49
IN_StrafeDown
void IN_StrafeDown(void)
Definition: cl_input.c:168
KeyDown
void KeyDown(kbutton_t *b)
Definition: cl_input.c:67
IN_AttackUp
void IN_AttackUp(void)
Definition: cl_input.c:172
IN_StrafeUp
void IN_StrafeUp(void)
Definition: cl_input.c:169
IN_MoveleftDown
void IN_MoveleftDown(void)
Definition: cl_input.c:161
client_static_t::netchan
netchan_t netchan
Definition: client.h:224
client_static_t::realtime
int realtime
Definition: client.h:208
in_strafe
kbutton_t in_strafe
Definition: cl_input.c:61