Quake II RTX doxygen  1.0 dev
input.c File Reference
#include "client.h"
#include "system/lirc.h"

Go to the source code of this file.

Classes

struct  in_state_t
 
struct  kbutton_s
 

Typedefs

typedef struct kbutton_s kbutton_t
 

Functions

const inputAPI_t * IN_GetAPI ()
 
static qboolean IN_GetCurrentGrab (void)
 
void IN_Activate (void)
 
static void IN_Restart_f (void)
 
void IN_Frame (void)
 
void IN_WarpMouse (int x, int y)
 
void IN_Shutdown (void)
 
static void in_changed_hard (cvar_t *self)
 
static void in_changed_soft (cvar_t *self)
 
void IN_Init (void)
 
static void KeyDown (kbutton_t *b)
 
static void KeyUp (kbutton_t *b)
 
static void KeyClear (kbutton_t *b)
 
static void IN_KLookDown (void)
 
static void IN_KLookUp (void)
 
static void IN_UpDown (void)
 
static void IN_UpUp (void)
 
static void IN_DownDown (void)
 
static void IN_DownUp (void)
 
static void IN_LeftDown (void)
 
static void IN_LeftUp (void)
 
static void IN_RightDown (void)
 
static void IN_RightUp (void)
 
static void IN_ForwardDown (void)
 
static void IN_ForwardUp (void)
 
static void IN_BackDown (void)
 
static void IN_BackUp (void)
 
static void IN_LookupDown (void)
 
static void IN_LookupUp (void)
 
static void IN_LookdownDown (void)
 
static void IN_LookdownUp (void)
 
static void IN_MoveleftDown (void)
 
static void IN_MoveleftUp (void)
 
static void IN_MoverightDown (void)
 
static void IN_MoverightUp (void)
 
static void IN_SpeedDown (void)
 
static void IN_SpeedUp (void)
 
static void IN_StrafeDown (void)
 
static void IN_StrafeUp (void)
 
static void IN_AttackDown (void)
 
static void IN_AttackUp (void)
 
static void IN_UseDown (void)
 
static void IN_UseUp (void)
 
static void IN_Impulse (void)
 
static void IN_CenterView (void)
 
static void IN_MLookDown (void)
 
static void IN_MLookUp (void)
 
static float CL_KeyState (kbutton_t *key)
 
static void CL_MouseMove (void)
 
static void CL_AdjustAngles (int msec)
 
static void CL_BaseMove (vec3_t move)
 
static void CL_ClampSpeed (vec3_t move)
 
static void CL_ClampPitch (void)
 
void CL_UpdateCmd (int msec)
 
static void m_autosens_changed (cvar_t *self)
 
void CL_RegisterInput (void)
 
void CL_FinalizeCmd (void)
 
static qboolean ready_to_send (void)
 
static qboolean ready_to_send_hacked (void)
 
static void CL_SendDefaultCmd (void)
 
static void CL_SendBatchedCmd (void)
 
static void CL_SendKeepAlive (void)
 
static void CL_SendUserinfo (void)
 
void CL_SendCmd (void)
 

Variables

static cvar_t * cl_nodelta
 
static cvar_t * cl_maxpackets
 
static cvar_t * cl_packetdup
 
static cvar_t * cl_fuzzhack
 
static cvar_t * cl_instantpacket
 
static cvar_t * cl_batchcmds
 
static cvar_t * m_filter
 
cvar_t * m_accel
 
cvar_t * m_autosens
 
static cvar_t * cl_upspeed
 
static cvar_t * cl_forwardspeed
 
static cvar_t * cl_sidespeed
 
static cvar_t * cl_yawspeed
 
static cvar_t * cl_pitchspeed
 
static cvar_t * cl_run
 
static cvar_t * cl_anglespeedkey
 
static cvar_t * freelook
 
static cvar_t * lookspring
 
static cvar_t * lookstrafe
 
cvar_t * sensitivity
 
cvar_t * m_pitch
 
cvar_t * m_invert
 
cvar_t * m_yaw
 
static cvar_t * m_forward
 
static cvar_t * m_side
 
static in_state_t input
 
static cvar_t * in_enable
 
static cvar_t * in_grab
 
static kbutton_t in_klook
 
static kbutton_t in_left
 
static kbutton_t in_right
 
static kbutton_t in_forward
 
static kbutton_t in_back
 
static kbutton_t in_lookup
 
static kbutton_t in_lookdown
 
static kbutton_t in_moveleft
 
static kbutton_t in_moveright
 
static kbutton_t in_strafe
 
static kbutton_t in_speed
 
static kbutton_t in_use
 
static kbutton_t in_attack
 
static kbutton_t in_up
 
static kbutton_t in_down
 
static int in_impulse
 
static qboolean in_mlooking
 
float autosens_x
 
float autosens_y
 

Typedef Documentation

◆ kbutton_t

typedef struct kbutton_s kbutton_t

Function Documentation

◆ CL_AdjustAngles()

static void CL_AdjustAngles ( int  msec)
static

Definition at line 566 of file input.c.

567 {
568  float speed;
569 
570  if (in_speed.state & 1)
571  speed = msec * cl_anglespeedkey->value * 0.001f;
572  else
573  speed = msec * 0.001f;
574 
575  if (!(in_strafe.state & 1)) {
576  cl.viewangles[YAW] -= speed * cl_yawspeed->value * CL_KeyState(&in_right);
577  cl.viewangles[YAW] += speed * cl_yawspeed->value * CL_KeyState(&in_left);
578  }
579  if (in_klook.state & 1) {
580  cl.viewangles[PITCH] -= speed * cl_pitchspeed->value * CL_KeyState(&in_forward);
581  cl.viewangles[PITCH] += speed * cl_pitchspeed->value * CL_KeyState(&in_back);
582  }
583 
584  cl.viewangles[PITCH] -= speed * cl_pitchspeed->value * CL_KeyState(&in_lookup);
585  cl.viewangles[PITCH] += speed * cl_pitchspeed->value * CL_KeyState(&in_lookdown);
586 }

Referenced by CL_UpdateCmd().

◆ CL_BaseMove()

static void CL_BaseMove ( vec3_t  move)
static

Definition at line 595 of file input.c.

596 {
597  if (in_strafe.state & 1) {
598  move[1] += cl_sidespeed->value * CL_KeyState(&in_right);
599  move[1] -= cl_sidespeed->value * CL_KeyState(&in_left);
600  }
601 
602  move[1] += cl_sidespeed->value * CL_KeyState(&in_moveright);
603  move[1] -= cl_sidespeed->value * CL_KeyState(&in_moveleft);
604 
605  move[2] += cl_upspeed->value * CL_KeyState(&in_up);
606  move[2] -= cl_upspeed->value * CL_KeyState(&in_down);
607 
608  if (!(in_klook.state & 1)) {
609  move[0] += cl_forwardspeed->value * CL_KeyState(&in_forward);
610  move[0] -= cl_forwardspeed->value * CL_KeyState(&in_back);
611  }
612 
613 // adjust for speed key / running
614  if ((in_speed.state & 1) ^ cl_run->integer) {
615  VectorScale(move, 2, move);
616  }
617 }

Referenced by CL_FinalizeCmd(), and CL_UpdateCmd().

◆ CL_ClampPitch()

static void CL_ClampPitch ( void  )
static

Definition at line 628 of file input.c.

629 {
630  float pitch;
631 
632  pitch = SHORT2ANGLE(cl.frame.ps.pmove.delta_angles[PITCH]);
633  if (pitch > 180)
634  pitch -= 360;
635 
636  if (cl.viewangles[PITCH] + pitch < -360)
637  cl.viewangles[PITCH] += 360; // wrapped
638  if (cl.viewangles[PITCH] + pitch > 360)
639  cl.viewangles[PITCH] -= 360; // wrapped
640 
641  if (cl.viewangles[PITCH] + pitch > 89)
642  cl.viewangles[PITCH] = 89 - pitch;
643  if (cl.viewangles[PITCH] + pitch < -89)
644  cl.viewangles[PITCH] = -89 - pitch;
645 }

Referenced by CL_UpdateCmd().

◆ CL_ClampSpeed()

static void CL_ClampSpeed ( vec3_t  move)
static

Definition at line 619 of file input.c.

620 {
621  float speed = cl.pmp.maxspeed;
622 
623  clamp(move[0], -speed, speed);
624  clamp(move[1], -speed, speed);
625  clamp(move[2], -speed, speed);
626 }

Referenced by CL_FinalizeCmd(), and CL_UpdateCmd().

◆ CL_FinalizeCmd()

void CL_FinalizeCmd ( void  )

Definition at line 790 of file input.c.

791 {
792  vec3_t move;
793 
794  // command buffer ticks in sync with cl_maxfps
795  if (cmd_buffer.waitCount > 0) {
796  cmd_buffer.waitCount--;
797  }
798  if (cl_cmdbuf.waitCount > 0) {
799  cl_cmdbuf.waitCount--;
800  }
801 
802  if (cls.state != ca_active) {
803  return; // not talking to a server
804  }
805 
806  if (sv_paused->integer) {
807  return;
808  }
809 
810 //
811 // figure button bits
812 //
813  if (in_attack.state & 3)
814  cl.cmd.buttons |= BUTTON_ATTACK;
815  if (in_use.state & 3)
816  cl.cmd.buttons |= BUTTON_USE;
817 
818  in_attack.state &= ~2;
819  in_use.state &= ~2;
820 
821  if (cls.key_dest == KEY_GAME && Key_AnyKeyDown()) {
822  cl.cmd.buttons |= BUTTON_ANY;
823  }
824 
825  if (cl.cmd.msec > 250) {
826  cl.cmd.msec = 100; // time was unreasonable
827  }
828 
829  // rebuild the movement vector
830  VectorClear(move);
831 
832  // get basic movement from keyboard
833  CL_BaseMove(move);
834 
835  // add mouse forward/side movement
836  move[0] += cl.mousemove[0];
837  move[1] += cl.mousemove[1];
838 
839  // clamp to server defined max speed
840  CL_ClampSpeed(move);
841 
842  // store the movement vector
843  cl.cmd.forwardmove = move[0];
844  cl.cmd.sidemove = move[1];
845  cl.cmd.upmove = move[2];
846 
847  // clear all states
848  cl.mousemove[0] = 0;
849  cl.mousemove[1] = 0;
850 
851  KeyClear(&in_right);
852  KeyClear(&in_left);
853 
856 
857  KeyClear(&in_up);
858  KeyClear(&in_down);
859 
861  KeyClear(&in_back);
862 
865 
866  cl.cmd.impulse = in_impulse;
867  in_impulse = 0;
868 
869  // save this command off for prediction
870  cl.cmdNumber++;
871  cl.cmds[cl.cmdNumber & CMD_MASK] = cl.cmd;
872 
873  // clear pending cmd
874  memset(&cl.cmd, 0, sizeof(cl.cmd));
875 }

Referenced by CL_Frame().

◆ CL_KeyState()

static float CL_KeyState ( kbutton_t key)
static

Definition at line 468 of file input.c.

469 {
470  unsigned msec = key->msec;
471  float val;
472 
473  if (key->state & 1) {
474  // still down
475  if (com_eventTime > key->downtime) {
476  msec += com_eventTime - key->downtime;
477  }
478  }
479 
480  // special case for instant packet
481  if (!cl.cmd.msec) {
482  return (float)(key->state & 1);
483  }
484 
485  val = (float)msec / cl.cmd.msec;
486 
487  return clamp(val, 0, 1);
488 }

Referenced by CL_AdjustAngles(), and CL_BaseMove().

◆ CL_MouseMove()

static void CL_MouseMove ( void  )
static

Definition at line 500 of file input.c.

501 {
502  int dx, dy;
503  float mx, my;
504  float speed;
505 
506  if (!input.api.GetMotion) {
507  return;
508  }
509  if (cls.key_dest & (KEY_MENU | KEY_CONSOLE)) {
510  return;
511  }
512  if (!input.api.GetMotion(&dx, &dy)) {
513  return;
514  }
515 
516  if (m_filter->integer) {
517  mx = (dx + input.old_dx) * 0.5f;
518  my = (dy + input.old_dy) * 0.5f;
519  } else {
520  mx = dx;
521  my = dy;
522  }
523 
524  input.old_dx = dx;
525  input.old_dy = dy;
526 
527  if (!mx && !my) {
528  return;
529  }
530 
531  Cvar_ClampValue(m_accel, 0, 1);
532 
533  speed = sqrt(mx * mx + my * my);
534  speed = sensitivity->value + speed * m_accel->value;
535 
536  mx *= speed;
537  my *= speed;
538 
539  if (m_autosens->integer) {
540  mx *= cl.fov_x * autosens_x;
541  my *= cl.fov_y * autosens_y;
542  }
543 
544 // add mouse X/Y movement
545  if ((in_strafe.state & 1) || (lookstrafe->integer && !in_mlooking)) {
546  cl.mousemove[1] += m_side->value * mx;
547  } else {
548  cl.viewangles[YAW] -= m_yaw->value * mx;
549  }
550 
551  if ((in_mlooking || freelook->integer) && !(in_strafe.state & 1)) {
552  cl.viewangles[PITCH] += m_pitch->value * my * (m_invert->integer ? -1.f : 1.f);
553  } else {
554  cl.mousemove[0] -= m_forward->value * my;
555  }
556 }

Referenced by CL_UpdateCmd().

◆ CL_RegisterInput()

void CL_RegisterInput ( void  )

Definition at line 707 of file input.c.

708 {
709  Cmd_AddCommand("centerview", IN_CenterView);
710 
711  Cmd_AddCommand("+moveup", IN_UpDown);
712  Cmd_AddCommand("-moveup", IN_UpUp);
713  Cmd_AddCommand("+movedown", IN_DownDown);
714  Cmd_AddCommand("-movedown", IN_DownUp);
715  Cmd_AddCommand("+left", IN_LeftDown);
716  Cmd_AddCommand("-left", IN_LeftUp);
717  Cmd_AddCommand("+right", IN_RightDown);
718  Cmd_AddCommand("-right", IN_RightUp);
719  Cmd_AddCommand("+forward", IN_ForwardDown);
720  Cmd_AddCommand("-forward", IN_ForwardUp);
721  Cmd_AddCommand("+back", IN_BackDown);
722  Cmd_AddCommand("-back", IN_BackUp);
723  Cmd_AddCommand("+lookup", IN_LookupDown);
724  Cmd_AddCommand("-lookup", IN_LookupUp);
725  Cmd_AddCommand("+lookdown", IN_LookdownDown);
726  Cmd_AddCommand("-lookdown", IN_LookdownUp);
727  Cmd_AddCommand("+strafe", IN_StrafeDown);
728  Cmd_AddCommand("-strafe", IN_StrafeUp);
729  Cmd_AddCommand("+moveleft", IN_MoveleftDown);
730  Cmd_AddCommand("-moveleft", IN_MoveleftUp);
731  Cmd_AddCommand("+moveright", IN_MoverightDown);
732  Cmd_AddCommand("-moveright", IN_MoverightUp);
733  Cmd_AddCommand("+speed", IN_SpeedDown);
734  Cmd_AddCommand("-speed", IN_SpeedUp);
735  Cmd_AddCommand("+attack", IN_AttackDown);
736  Cmd_AddCommand("-attack", IN_AttackUp);
737  Cmd_AddCommand("+use", IN_UseDown);
738  Cmd_AddCommand("-use", IN_UseUp);
739  Cmd_AddCommand("impulse", IN_Impulse);
740  Cmd_AddCommand("+klook", IN_KLookDown);
741  Cmd_AddCommand("-klook", IN_KLookUp);
742  Cmd_AddCommand("+mlook", IN_MLookDown);
743  Cmd_AddCommand("-mlook", IN_MLookUp);
744 
745  Cmd_AddCommand("in_restart", IN_Restart_f);
746 
747  cl_nodelta = Cvar_Get("cl_nodelta", "0", 0);
748  cl_maxpackets = Cvar_Get("cl_maxpackets", "30", 0);
749  cl_fuzzhack = Cvar_Get("cl_fuzzhack", "0", 0);
750  cl_packetdup = Cvar_Get("cl_packetdup", "1", 0);
751 #ifdef _DEBUG
752  cl_showpackets = Cvar_Get("cl_showpackets", "0", 0);
753 #endif
754  cl_instantpacket = Cvar_Get("cl_instantpacket", "1", 0);
755  cl_batchcmds = Cvar_Get("cl_batchcmds", "1", 0);
756 
757  cl_upspeed = Cvar_Get("cl_upspeed", "200", 0);
758  cl_forwardspeed = Cvar_Get("cl_forwardspeed", "200", 0);
759  cl_sidespeed = Cvar_Get("cl_sidespeed", "200", 0);
760  cl_yawspeed = Cvar_Get("cl_yawspeed", "140", 0);
761  cl_pitchspeed = Cvar_Get("cl_pitchspeed", "150", CVAR_CHEAT);
762  cl_anglespeedkey = Cvar_Get("cl_anglespeedkey", "1.5", CVAR_CHEAT);
763  cl_run = Cvar_Get("cl_run", "1", CVAR_ARCHIVE);
764 
765  freelook = Cvar_Get("freelook", "1", CVAR_ARCHIVE);
766  lookspring = Cvar_Get("lookspring", "0", CVAR_ARCHIVE);
767  lookstrafe = Cvar_Get("lookstrafe", "0", CVAR_ARCHIVE);
768  sensitivity = Cvar_Get("sensitivity", "3", CVAR_ARCHIVE);
769 
770  m_pitch = Cvar_Get("m_pitch", "0.022", CVAR_ARCHIVE);
771  m_invert = Cvar_Get("m_invert", "0", CVAR_ARCHIVE);
772  m_yaw = Cvar_Get("m_yaw", "0.022", 0);
773  m_forward = Cvar_Get("m_forward", "1", 0);
774  m_side = Cvar_Get("m_side", "1", 0);
775  m_filter = Cvar_Get("m_filter", "0", 0);
776  m_accel = Cvar_Get("m_accel", "0", 0);
777  m_autosens = Cvar_Get("m_autosens", "0", 0);
778  m_autosens->changed = m_autosens_changed;
780 }

Referenced by CL_InitLocal().

◆ CL_SendBatchedCmd()

static void CL_SendBatchedCmd ( void  )
static

Definition at line 1009 of file input.c.

1010 {
1011  int i, j, seq, bits q_unused;
1012  int numCmds, numDups;
1013  int totalCmds, totalMsec;
1014  size_t cursize q_unused;
1015  usercmd_t *cmd, *oldcmd;
1016  client_history_t *history, *oldest;
1017  byte *patch;
1018 
1019  // see if we are ready to send this packet
1020  if (!ready_to_send()) {
1021  return;
1022  }
1023 
1024  // archive this packet
1025  seq = cls.netchan->outgoing_sequence;
1026  history = &cl.history[seq & CMD_MASK];
1027  history->cmdNumber = cl.cmdNumber;
1028  history->sent = cls.realtime; // for ping calculation
1029  history->rcvd = 0;
1030 
1034 
1035  // begin a client move command
1036  patch = SZ_GetSpace(&msg_write, 1);
1037 
1038  // let the server know what the last frame we
1039  // got was, so the next message can be delta compressed
1040  if (cl_nodelta->integer || !cl.frame.valid /*|| cls.demowaiting*/) {
1041  *patch = clc_move_nodelta; // no compression
1042  } else {
1043  *patch = clc_move_batched;
1045  }
1046 
1047  Cvar_ClampInteger(cl_packetdup, 0, MAX_PACKET_FRAMES - 1);
1048  numDups = cl_packetdup->integer;
1049 
1050  *patch |= numDups << SVCMD_BITS;
1051 
1052  // send lightlevel
1054 
1055  // send this and the previous cmds in the message, so
1056  // if the last packet was dropped, it can be recovered
1057  oldcmd = NULL;
1058  totalCmds = 0;
1059  totalMsec = 0;
1060  for (i = seq - numDups; i <= seq; i++) {
1061  oldest = &cl.history[(i - 1) & CMD_MASK];
1062  history = &cl.history[i & CMD_MASK];
1063 
1064  numCmds = history->cmdNumber - oldest->cmdNumber;
1065  if (numCmds >= MAX_PACKET_USERCMDS) {
1066  Com_WPrintf("%s: MAX_PACKET_USERCMDS exceeded\n", __func__);
1067  SZ_Clear(&msg_write);
1068  break;
1069  }
1070  totalCmds += numCmds;
1071  MSG_WriteBits(numCmds, 5);
1072  for (j = oldest->cmdNumber + 1; j <= history->cmdNumber; j++) {
1073  cmd = &cl.cmds[j & CMD_MASK];
1074  totalMsec += cmd->msec;
1075  bits = MSG_WriteDeltaUsercmd_Enhanced(oldcmd, cmd, cls.protocolVersion);
1076 #ifdef _DEBUG
1077  if (cl_showpackets->integer == 3) {
1078  MSG_ShowDeltaUsercmdBits_Enhanced(bits);
1079  }
1080 #endif
1081  oldcmd = cmd;
1082  }
1083  }
1084 
1085  P_FRAMES++;
1086 
1087  //
1088  // deliver the message
1089  //
1090  cursize = cls.netchan->Transmit(cls.netchan, msg_write.cursize, msg_write.data, 1);
1091 #ifdef _DEBUG
1092  if (cl_showpackets->integer == 1) {
1093  Com_Printf("%"PRIz"(%i) ", cursize, totalCmds);
1094  } else if (cl_showpackets->integer == 2) {
1095  Com_Printf("%"PRIz"(%i) ", cursize, totalMsec);
1096  } else if (cl_showpackets->integer == 3) {
1097  Com_Printf(" | ");
1098  }
1099 #endif
1100 
1101  SZ_Clear(&msg_write);
1102 }

Referenced by CL_SendCmd().

◆ CL_SendCmd()

void CL_SendCmd ( void  )

Definition at line 1166 of file input.c.

1167 {
1168  if (cls.state < ca_connected) {
1169  return; // not talking to a server
1170  }
1171 
1172  // generate usercmds while playing a demo,
1173  // but do not send them
1174  if (!cls.netchan) {
1175  return;
1176  }
1177 
1178  if (cls.state != ca_active || sv_paused->integer) {
1179  // send a userinfo update if needed
1180  CL_SendUserinfo();
1181 
1182  // just keepalive or update reliable
1183  if (cls.netchan->ShouldUpdate(cls.netchan)) {
1184  CL_SendKeepAlive();
1185  }
1186 
1187  cl.sendPacketNow = qfalse;
1188  return;
1189  }
1190 
1191  // are there any new usercmds to send after all?
1193  return; // nothing to send
1194  }
1195 
1196  // send a userinfo update if needed
1197  CL_SendUserinfo();
1198 
1199  if (cls.serverProtocol == PROTOCOL_VERSION_Q2PRO && cl_batchcmds->integer) {
1201  } else {
1203  }
1204 
1205  cl.sendPacketNow = qfalse;
1206 }

Referenced by CL_Frame().

◆ CL_SendDefaultCmd()

static void CL_SendDefaultCmd ( void  )
static

Definition at line 924 of file input.c.

925 {
926  size_t cursize q_unused, checksumIndex;
927  usercmd_t *cmd, *oldcmd;
928  client_history_t *history;
929 
930  // archive this packet
931  history = &cl.history[cls.netchan->outgoing_sequence & CMD_MASK];
932  history->cmdNumber = cl.cmdNumber;
933  history->sent = cls.realtime; // for ping calculation
934  history->rcvd = 0;
935 
937 
938  // see if we are ready to send this packet
939  if (!ready_to_send_hacked()) {
940  cls.netchan->outgoing_sequence++; // just drop the packet
941  return;
942  }
943 
946 
947  // begin a client move command
948  MSG_WriteByte(clc_move);
949 
950  // save the position for a checksum byte
951  checksumIndex = 0;
952  if (cls.serverProtocol <= PROTOCOL_VERSION_DEFAULT) {
953  checksumIndex = msg_write.cursize;
954  SZ_GetSpace(&msg_write, 1);
955  }
956 
957  // let the server know what the last frame we
958  // got was, so the next message can be delta compressed
959  if (cl_nodelta->integer || !cl.frame.valid /*|| cls.demowaiting*/) {
960  MSG_WriteLong(-1); // no compression
961  } else {
963  }
964 
965  // send this and the previous cmds in the message, so
966  // if the last packet was dropped, it can be recovered
967  cmd = &cl.cmds[(cl.cmdNumber - 2) & CMD_MASK];
968  MSG_WriteDeltaUsercmd(NULL, cmd, cls.protocolVersion);
970  oldcmd = cmd;
971 
972  cmd = &cl.cmds[(cl.cmdNumber - 1) & CMD_MASK];
973  MSG_WriteDeltaUsercmd(oldcmd, cmd, cls.protocolVersion);
975  oldcmd = cmd;
976 
977  cmd = &cl.cmds[cl.cmdNumber & CMD_MASK];
978  MSG_WriteDeltaUsercmd(oldcmd, cmd, cls.protocolVersion);
980 
981  if (cls.serverProtocol <= PROTOCOL_VERSION_DEFAULT) {
982  // calculate a checksum over the move commands
983  msg_write.data[checksumIndex] = COM_BlockSequenceCRCByte(
984  msg_write.data + checksumIndex + 1,
985  msg_write.cursize - checksumIndex - 1,
986  cls.netchan->outgoing_sequence);
987  }
988 
989  P_FRAMES++;
990 
991  //
992  // deliver the message
993  //
994  cursize = cls.netchan->Transmit(cls.netchan, msg_write.cursize, msg_write.data, 1);
995 #ifdef _DEBUG
996  if (cl_showpackets->integer) {
997  Com_Printf("%"PRIz" ", cursize);
998  }
999 #endif
1000 
1001  SZ_Clear(&msg_write);
1002 }

Referenced by CL_SendCmd().

◆ CL_SendKeepAlive()

static void CL_SendKeepAlive ( void  )
static

Definition at line 1104 of file input.c.

1105 {
1106  client_history_t *history;
1107  size_t cursize q_unused;
1108 
1109  // archive this packet
1110  history = &cl.history[cls.netchan->outgoing_sequence & CMD_MASK];
1111  history->cmdNumber = cl.cmdNumber;
1112  history->sent = cls.realtime; // for ping calculation
1113  history->rcvd = 0;
1114 
1118 
1119  cursize = cls.netchan->Transmit(cls.netchan, 0, NULL, 1);
1120 #ifdef _DEBUG
1121  if (cl_showpackets->integer) {
1122  Com_Printf("%"PRIz" ", cursize);
1123  }
1124 #endif
1125 }

Referenced by CL_SendCmd().

◆ CL_SendUserinfo()

static void CL_SendUserinfo ( void  )
static

Definition at line 1127 of file input.c.

1128 {
1129  char userinfo[MAX_INFO_STRING];
1130  cvar_t *var;
1131  int i;
1132 
1133  if (!cls.userinfo_modified) {
1134  return;
1135  }
1136 
1137  if (cls.userinfo_modified == MAX_PACKET_USERINFOS) {
1138  size_t len = Cvar_BitInfo(userinfo, CVAR_USERINFO);
1139  Com_DDPrintf("%s: %u: full update\n", __func__, com_framenum);
1140  MSG_WriteByte(clc_userinfo);
1141  MSG_WriteData(userinfo, len + 1);
1142  MSG_FlushTo(&cls.netchan->message);
1143  } else if (cls.serverProtocol == PROTOCOL_VERSION_Q2PRO) {
1144  Com_DDPrintf("%s: %u: %d updates\n", __func__, com_framenum,
1146  for (i = 0; i < cls.userinfo_modified; i++) {
1147  var = cls.userinfo_updates[i];
1148  MSG_WriteByte(clc_userinfo_delta);
1149  MSG_WriteString(var->name);
1150  if (var->flags & CVAR_USERINFO) {
1151  MSG_WriteString(var->string);
1152  } else {
1153  // no longer in userinfo
1154  MSG_WriteString(NULL);
1155  }
1156  }
1157  MSG_FlushTo(&cls.netchan->message);
1158  } else {
1159  Com_WPrintf("%s: update count is %d, should never happen.\n",
1160  __func__, cls.userinfo_modified);
1161  }
1162 
1163  cls.userinfo_modified = 0;
1164 }

Referenced by CL_SendCmd().

◆ CL_UpdateCmd()

void CL_UpdateCmd ( int  msec)

Definition at line 655 of file input.c.

656 {
657  VectorClear(cl.localmove);
658 
659  if (sv_paused->integer) {
660  return;
661  }
662 
663  // add to milliseconds of time to apply the move
664  cl.cmd.msec += msec;
665 
666  // adjust viewangles
667  CL_AdjustAngles(msec);
668 
669  // get basic movement from keyboard
671 
672  // allow mice to add to the move
673  CL_MouseMove();
674 
675  // add accumulated mouse forward/side movement
676  cl.localmove[0] += cl.mousemove[0];
677  cl.localmove[1] += cl.mousemove[1];
678 
679  // clamp to server defined max speed
681 
682  CL_ClampPitch();
683 
684  cl.cmd.angles[0] = ANGLE2SHORT(cl.viewangles[0]);
685  cl.cmd.angles[1] = ANGLE2SHORT(cl.viewangles[1]);
686  cl.cmd.angles[2] = ANGLE2SHORT(cl.viewangles[2]);
687 }

Referenced by CL_Frame().

◆ IN_Activate()

void IN_Activate ( void  )

Definition at line 117 of file input.c.

118 {
119  if (input.api.Grab) {
120  input.api.Grab(IN_GetCurrentGrab());
121  }
122 }

Referenced by check_paused(), CL_Activate(), CL_CheckForPause(), CL_DeltaFrame(), in_changed_soft(), IN_Init(), Key_Event(), Key_SetDest(), and SCR_ModeChanged().

◆ IN_AttackDown()

static void IN_AttackDown ( void  )
static

Definition at line 410 of file input.c.

411 {
412  KeyDown(&in_attack);
413 
414  if (cl_instantpacket->integer && cls.state == ca_active && cls.netchan) {
415  cl.sendPacketNow = qtrue;
416  }
417 }

Referenced by CL_RegisterInput().

◆ IN_AttackUp()

static void IN_AttackUp ( void  )
static

Definition at line 419 of file input.c.

420 {
421  KeyUp(&in_attack);
422 }

Referenced by CL_RegisterInput().

◆ IN_BackDown()

static void IN_BackDown ( void  )
static

Definition at line 395 of file input.c.

395 { KeyDown(&in_back); }

Referenced by CL_RegisterInput().

◆ IN_BackUp()

static void IN_BackUp ( void  )
static

Definition at line 396 of file input.c.

396 { KeyUp(&in_back); }

Referenced by CL_RegisterInput().

◆ IN_CenterView()

static void IN_CenterView ( void  )
static

Definition at line 443 of file input.c.

444 {
445  cl.viewangles[PITCH] = -SHORT2ANGLE(cl.frame.ps.pmove.delta_angles[PITCH]);
446 }

Referenced by CL_RegisterInput(), and IN_MLookUp().

◆ in_changed_hard()

static void in_changed_hard ( cvar_t *  self)
static

Definition at line 195 of file input.c.

196 {
197  input.modified = qtrue;
198 }

Referenced by IN_Init().

◆ in_changed_soft()

static void in_changed_soft ( cvar_t *  self)
static

Definition at line 200 of file input.c.

201 {
202  IN_Activate();
203 }

Referenced by IN_Init().

◆ IN_DownDown()

static void IN_DownDown ( void  )
static

Definition at line 387 of file input.c.

387 { KeyDown(&in_down); }

Referenced by CL_RegisterInput().

◆ IN_DownUp()

static void IN_DownUp ( void  )
static

Definition at line 388 of file input.c.

388 { KeyUp(&in_down); }

Referenced by CL_RegisterInput().

◆ IN_ForwardDown()

static void IN_ForwardDown ( void  )
static

Definition at line 393 of file input.c.

393 { KeyDown(&in_forward); }

Referenced by CL_RegisterInput().

◆ IN_ForwardUp()

static void IN_ForwardUp ( void  )
static

Definition at line 394 of file input.c.

394 { KeyUp(&in_forward); }

Referenced by CL_RegisterInput().

◆ IN_Frame()

void IN_Frame ( void  )

Definition at line 140 of file input.c.

141 {
142  if (input.modified) {
143  IN_Restart_f();
144  return;
145  }
146 
147  if (input.api.GetEvents) {
148  input.api.GetEvents();
149  }
150 
151 #if USE_LIRC
152  Lirc_GetEvents();
153 #endif
154 }

Referenced by CL_ProcessEvents().

◆ IN_GetAPI()

const inputAPI_t* IN_GetAPI ( )

Definition at line 79 of file input.c.

80 {
81  return &input.api;
82 }

Referenced by vkpt_freecam_mousemove().

◆ IN_GetCurrentGrab()

static qboolean IN_GetCurrentGrab ( void  )
static

Definition at line 84 of file input.c.

85 {
86  if (cls.active != ACT_ACTIVATED)
87  return qfalse; // main window doesn't have focus
88 
89  if (r_config.flags & QVF_FULLSCREEN)
90  return qtrue; // full screen
91 
92  if (cls.key_dest & (KEY_MENU | KEY_CONSOLE))
93  return qfalse; // menu or console is up
94 
95  if (cls.state != ca_active && cls.state != ca_cinematic)
96  return qfalse; // not connected
97 
98  if (in_grab->integer >= 2) {
99  if (cls.demo.playback && !Key_IsDown(K_SHIFT))
100  return qfalse; // playing a demo (and not using freelook)
101 
102  if (cl.frame.ps.pmove.pm_type == PM_FREEZE)
103  return qfalse; // spectator mode
104  }
105 
106  if (in_grab->integer >= 1)
107  return qtrue; // regular playing mode
108 
109  return qfalse;
110 }

Referenced by IN_Activate().

◆ IN_Impulse()

static void IN_Impulse ( void  )
static

Definition at line 438 of file input.c.

439 {
440  in_impulse = atoi(Cmd_Argv(1));
441 }

Referenced by CL_RegisterInput().

◆ IN_Init()

void IN_Init ( void  )

Definition at line 210 of file input.c.

211 {
212  qboolean ret = qfalse;
213 
214 #if USE_LIRC
215  Lirc_Init();
216 #endif
217 
218  in_enable = Cvar_Get("in_enable", "1", 0);
219  in_enable->changed = in_changed_hard;
220  if (!in_enable->integer) {
221  Com_Printf("Mouse input disabled.\n");
222  return;
223  }
224 
225 #if USE_DINPUT
226  in_direct = Cvar_Get("in_direct", "1", 0);
227  if (in_direct->integer) {
228  DI_FillAPI(&input.api);
229  ret = input.api.Init();
230  if (!ret) {
231  Cvar_Set("in_direct", "0");
232  }
233  }
234 #endif
235 
236  if (!ret) {
238  ret = input.api.Init();
239  if (!ret) {
240  Cvar_Set("in_enable", "0");
241  return;
242  }
243  }
244 
245 #if USE_DINPUT
246  in_direct->changed = in_changed_hard;
247 #endif
248 
249  in_grab = Cvar_Get("in_grab", "1", 0);
250  in_grab->changed = in_changed_soft;
251 
252  IN_Activate();
253 }

Referenced by CL_Init(), CL_RestartRefresh(), and IN_Restart_f().

◆ IN_KLookDown()

static void IN_KLookDown ( void  )
static

Definition at line 383 of file input.c.

383 { KeyDown(&in_klook); }

Referenced by CL_RegisterInput().

◆ IN_KLookUp()

static void IN_KLookUp ( void  )
static

Definition at line 384 of file input.c.

384 { KeyUp(&in_klook); }

Referenced by CL_RegisterInput().

◆ IN_LeftDown()

static void IN_LeftDown ( void  )
static

Definition at line 389 of file input.c.

389 { KeyDown(&in_left); }

Referenced by CL_RegisterInput().

◆ IN_LeftUp()

static void IN_LeftUp ( void  )
static

Definition at line 390 of file input.c.

390 { KeyUp(&in_left); }

Referenced by CL_RegisterInput().

◆ IN_LookdownDown()

static void IN_LookdownDown ( void  )
static

Definition at line 399 of file input.c.

399 { KeyDown(&in_lookdown); }

Referenced by CL_RegisterInput().

◆ IN_LookdownUp()

static void IN_LookdownUp ( void  )
static

Definition at line 400 of file input.c.

400 { KeyUp(&in_lookdown); }

Referenced by CL_RegisterInput().

◆ IN_LookupDown()

static void IN_LookupDown ( void  )
static

Definition at line 397 of file input.c.

397 { KeyDown(&in_lookup); }

Referenced by CL_RegisterInput().

◆ IN_LookupUp()

static void IN_LookupUp ( void  )
static

Definition at line 398 of file input.c.

398 { KeyUp(&in_lookup); }

Referenced by CL_RegisterInput().

◆ IN_MLookDown()

static void IN_MLookDown ( void  )
static

Definition at line 448 of file input.c.

449 {
450  in_mlooking = qtrue;
451 }

Referenced by CL_RegisterInput().

◆ IN_MLookUp()

static void IN_MLookUp ( void  )
static

Definition at line 453 of file input.c.

454 {
455  in_mlooking = qfalse;
456 
457  if (!freelook->integer && lookspring->integer)
458  IN_CenterView();
459 }

Referenced by CL_RegisterInput().

◆ IN_MoveleftDown()

static void IN_MoveleftDown ( void  )
static

Definition at line 401 of file input.c.

401 { KeyDown(&in_moveleft); }

Referenced by CL_RegisterInput().

◆ IN_MoveleftUp()

static void IN_MoveleftUp ( void  )
static

Definition at line 402 of file input.c.

402 { KeyUp(&in_moveleft); }

Referenced by CL_RegisterInput().

◆ IN_MoverightDown()

static void IN_MoverightDown ( void  )
static

Definition at line 403 of file input.c.

403 { KeyDown(&in_moveright); }

Referenced by CL_RegisterInput().

◆ IN_MoverightUp()

static void IN_MoverightUp ( void  )
static

Definition at line 404 of file input.c.

404 { KeyUp(&in_moveright); }

Referenced by CL_RegisterInput().

◆ IN_Restart_f()

static void IN_Restart_f ( void  )
static

Definition at line 129 of file input.c.

130 {
131  IN_Shutdown();
132  IN_Init();
133 }

Referenced by CL_RegisterInput(), and IN_Frame().

◆ IN_RightDown()

static void IN_RightDown ( void  )
static

Definition at line 391 of file input.c.

391 { KeyDown(&in_right); }

Referenced by CL_RegisterInput().

◆ IN_RightUp()

static void IN_RightUp ( void  )
static

Definition at line 392 of file input.c.

392 { KeyUp(&in_right); }

Referenced by CL_RegisterInput().

◆ IN_Shutdown()

void IN_Shutdown ( void  )

Definition at line 173 of file input.c.

174 {
175 #if USE_DINPUT
176  if (in_direct) {
177  in_direct->changed = NULL;
178  }
179 #endif
180  if (in_grab) {
181  in_grab->changed = NULL;
182  }
183 
184  if (input.api.Shutdown) {
185  input.api.Shutdown();
186  }
187 
188 #if USE_LIRC
189  Lirc_Shutdown();
190 #endif
191 
192  memset(&input, 0, sizeof(input));
193 }

Referenced by CL_RestartRefresh(), CL_Shutdown(), and IN_Restart_f().

◆ IN_SpeedDown()

static void IN_SpeedDown ( void  )
static

Definition at line 405 of file input.c.

405 { KeyDown(&in_speed); }

Referenced by CL_RegisterInput().

◆ IN_SpeedUp()

static void IN_SpeedUp ( void  )
static

Definition at line 406 of file input.c.

406 { KeyUp(&in_speed); }

Referenced by CL_RegisterInput().

◆ IN_StrafeDown()

static void IN_StrafeDown ( void  )
static

Definition at line 407 of file input.c.

407 { KeyDown(&in_strafe); }

Referenced by CL_RegisterInput().

◆ IN_StrafeUp()

static void IN_StrafeUp ( void  )
static

Definition at line 408 of file input.c.

408 { KeyUp(&in_strafe); }

Referenced by CL_RegisterInput().

◆ IN_UpDown()

static void IN_UpDown ( void  )
static

Definition at line 385 of file input.c.

385 { KeyDown(&in_up); }

Referenced by CL_RegisterInput().

◆ IN_UpUp()

static void IN_UpUp ( void  )
static

Definition at line 386 of file input.c.

386 { KeyUp(&in_up); }

Referenced by CL_RegisterInput().

◆ IN_UseDown()

static void IN_UseDown ( void  )
static

Definition at line 424 of file input.c.

425 {
426  KeyDown(&in_use);
427 
428  if (cl_instantpacket->integer && cls.state == ca_active && cls.netchan) {
429  cl.sendPacketNow = qtrue;
430  }
431 }

Referenced by CL_RegisterInput().

◆ IN_UseUp()

static void IN_UseUp ( void  )
static

Definition at line 433 of file input.c.

434 {
435  KeyUp(&in_use);
436 }

Referenced by CL_RegisterInput().

◆ IN_WarpMouse()

void IN_WarpMouse ( int  x,
int  y 
)

Definition at line 161 of file input.c.

162 {
163  if (input.api.Warp) {
164  input.api.Warp(x, y);
165  }
166 }

Referenced by UI_PushMenu().

◆ KeyClear()

static void KeyClear ( kbutton_t b)
static

Definition at line 374 of file input.c.

375 {
376  b->msec = 0;
377  b->state &= ~2; // clear impulses
378  if (b->state & 1) {
379  b->downtime = com_eventTime; // still down
380  }
381 }

Referenced by CL_FinalizeCmd().

◆ KeyDown()

static void KeyDown ( kbutton_t b)
static

Definition at line 298 of file input.c.

299 {
300  int k;
301  char *c;
302 
303  c = Cmd_Argv(1);
304  if (c[0])
305  k = atoi(c);
306  else
307  k = -1; // typed manually at the console for continuous down
308 
309  if (k == b->down[0] || k == b->down[1])
310  return; // repeating key
311 
312  if (!b->down[0])
313  b->down[0] = k;
314  else if (!b->down[1])
315  b->down[1] = k;
316  else {
317  Com_WPrintf("Three keys down for a button!\n");
318  return;
319  }
320 
321  if (b->state & 1)
322  return; // still down
323 
324  // save timestamp
325  c = Cmd_Argv(2);
326  b->downtime = atoi(c);
327  if (!b->downtime) {
328  b->downtime = com_eventTime - 100;
329  }
330 
331  b->state |= 1 + 2; // down + impulse down
332 }

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()

static void KeyUp ( kbutton_t b)
static

Definition at line 334 of file input.c.

335 {
336  int k;
337  char *c;
338  unsigned uptime;
339 
340  c = Cmd_Argv(1);
341  if (c[0])
342  k = atoi(c);
343  else {
344  // typed manually at the console, assume for unsticking, so clear all
345  b->down[0] = b->down[1] = 0;
346  b->state = 0; // impulse up
347  return;
348  }
349 
350  if (b->down[0] == k)
351  b->down[0] = 0;
352  else if (b->down[1] == k)
353  b->down[1] = 0;
354  else
355  return; // key up without coresponding down (menu pass through)
356  if (b->down[0] || b->down[1])
357  return; // some other key is still holding it down
358 
359  if (!(b->state & 1))
360  return; // still up (this should not happen)
361 
362  // save timestamp
363  c = Cmd_Argv(2);
364  uptime = atoi(c);
365  if (!uptime) {
366  b->msec += 10;
367  } else if (uptime > b->downtime) {
368  b->msec += uptime - b->downtime;
369  }
370 
371  b->state &= ~1; // now up
372 }

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().

◆ m_autosens_changed()

static void m_autosens_changed ( cvar_t *  self)
static

Definition at line 689 of file input.c.

690 {
691  float fov;
692 
693  if (self->value > 90.0f && self->value <= 179.0f)
694  fov = self->value;
695  else
696  fov = 90.0f;
697 
698  autosens_x = 1.0f / fov;
699  autosens_y = 1.0f / V_CalcFov(fov, 4, 3);
700 }

Referenced by CL_RegisterInput().

◆ ready_to_send()

static qboolean ready_to_send ( void  )
inlinestatic

Definition at line 877 of file input.c.

878 {
879  unsigned msec;
880 
881  if (cl.sendPacketNow) {
882  return qtrue;
883  }
884  if (cls.netchan->message.cursize || cls.netchan->reliable_ack_pending) {
885  return qtrue;
886  }
887  if (!cl_maxpackets->integer) {
888  return qtrue;
889  }
890 
891  if (cl_maxpackets->integer < 10) {
892  Cvar_Set("cl_maxpackets", "10");
893  }
894 
895  msec = 1000 / cl_maxpackets->integer;
896  if (msec) {
897  msec = 100 / (100 / msec);
898  }
899  if (cls.realtime - cl.lastTransmitTime < msec) {
900  return qfalse;
901  }
902 
903  return qtrue;
904 }

Referenced by CL_SendBatchedCmd(), and ready_to_send_hacked().

◆ ready_to_send_hacked()

static qboolean ready_to_send_hacked ( void  )
inlinestatic

Definition at line 906 of file input.c.

907 {
908  if (!cl_fuzzhack->integer) {
909  return qtrue; // packet drop hack disabled
910  }
911 
913  return qtrue; // can't drop more than 2 cmds
914  }
915 
916  return ready_to_send();
917 }

Referenced by CL_SendDefaultCmd().

Variable Documentation

◆ autosens_x

float autosens_x

Definition at line 492 of file input.c.

Referenced by CL_MouseMove(), m_autosens_changed(), and vkpt_freecam_mousemove().

◆ autosens_y

float autosens_y

Definition at line 493 of file input.c.

Referenced by CL_MouseMove(), m_autosens_changed(), and vkpt_freecam_mousemove().

◆ cl_anglespeedkey

cvar_t* cl_anglespeedkey
static

Definition at line 43 of file input.c.

Referenced by CL_AdjustAngles(), and CL_RegisterInput().

◆ cl_batchcmds

cvar_t* cl_batchcmds
static

Definition at line 31 of file input.c.

Referenced by CL_RegisterInput(), and CL_SendCmd().

◆ cl_forwardspeed

cvar_t* cl_forwardspeed
static

Definition at line 38 of file input.c.

Referenced by CL_BaseMove(), and CL_RegisterInput().

◆ cl_fuzzhack

cvar_t* cl_fuzzhack
static

Definition at line 26 of file input.c.

Referenced by CL_RegisterInput(), and ready_to_send_hacked().

◆ cl_instantpacket

cvar_t* cl_instantpacket
static

Definition at line 30 of file input.c.

Referenced by CL_RegisterInput(), IN_AttackDown(), and IN_UseDown().

◆ cl_maxpackets

cvar_t* cl_maxpackets
static

Definition at line 24 of file input.c.

Referenced by CL_RegisterInput(), and ready_to_send().

◆ cl_nodelta

cvar_t* cl_nodelta
static

Definition at line 23 of file input.c.

Referenced by CL_RegisterInput(), CL_SendBatchedCmd(), and CL_SendDefaultCmd().

◆ cl_packetdup

cvar_t* cl_packetdup
static

Definition at line 25 of file input.c.

Referenced by CL_RegisterInput(), and CL_SendBatchedCmd().

◆ cl_pitchspeed

cvar_t* cl_pitchspeed
static

Definition at line 41 of file input.c.

Referenced by CL_AdjustAngles(), and CL_RegisterInput().

◆ cl_run

cvar_t* cl_run
static

Definition at line 42 of file input.c.

Referenced by CL_BaseMove(), and CL_RegisterInput().

◆ cl_sidespeed

cvar_t* cl_sidespeed
static

Definition at line 39 of file input.c.

Referenced by CL_BaseMove(), and CL_RegisterInput().

◆ cl_upspeed

cvar_t* cl_upspeed
static

Definition at line 37 of file input.c.

Referenced by CL_BaseMove(), and CL_RegisterInput().

◆ cl_yawspeed

cvar_t* cl_yawspeed
static

Definition at line 40 of file input.c.

Referenced by CL_AdjustAngles(), and CL_RegisterInput().

◆ freelook

cvar_t* freelook
static

Definition at line 45 of file input.c.

Referenced by CL_MouseMove(), CL_RegisterInput(), and IN_MLookUp().

◆ in_attack

kbutton_t in_attack
static

Definition at line 292 of file input.c.

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

◆ in_back

kbutton_t in_back
static

Definition at line 290 of file input.c.

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

◆ in_down

kbutton_t in_down
static

Definition at line 293 of file input.c.

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

◆ in_enable

cvar_t* in_enable
static

Definition at line 73 of file input.c.

Referenced by IN_Init().

◆ in_forward

kbutton_t in_forward
static

Definition at line 290 of file input.c.

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

◆ in_grab

cvar_t* in_grab
static

Definition at line 77 of file input.c.

Referenced by IN_GetCurrentGrab(), IN_Init(), and IN_Shutdown().

◆ in_impulse

int in_impulse
static

Definition at line 295 of file input.c.

Referenced by CL_FinalizeCmd(), and IN_Impulse().

◆ in_klook

kbutton_t in_klook
static

Definition at line 289 of file input.c.

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

◆ in_left

kbutton_t in_left
static

Definition at line 290 of file input.c.

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

◆ in_lookdown

kbutton_t in_lookdown
static

Definition at line 291 of file input.c.

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

◆ in_lookup

kbutton_t in_lookup
static

Definition at line 291 of file input.c.

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

◆ in_mlooking

qboolean in_mlooking
static

Definition at line 296 of file input.c.

Referenced by CL_MouseMove(), IN_MLookDown(), and IN_MLookUp().

◆ in_moveleft

kbutton_t in_moveleft
static

Definition at line 291 of file input.c.

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

◆ in_moveright

kbutton_t in_moveright
static

Definition at line 291 of file input.c.

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

◆ in_right

kbutton_t in_right
static

Definition at line 290 of file input.c.

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

◆ in_speed

kbutton_t in_speed
static

Definition at line 292 of file input.c.

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

◆ in_strafe

kbutton_t in_strafe
static

Definition at line 292 of file input.c.

Referenced by CL_AdjustAngles(), CL_BaseMove(), CL_MouseMove(), IN_StrafeDown(), and IN_StrafeUp().

◆ in_up

kbutton_t in_up
static

Definition at line 293 of file input.c.

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

◆ in_use

kbutton_t in_use
static

Definition at line 292 of file input.c.

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

◆ input

◆ lookspring

cvar_t* lookspring
static

Definition at line 46 of file input.c.

Referenced by CL_RegisterInput(), and IN_MLookUp().

◆ lookstrafe

cvar_t* lookstrafe
static

Definition at line 47 of file input.c.

Referenced by CL_MouseMove(), and CL_RegisterInput().

◆ m_accel

cvar_t* m_accel

Definition at line 34 of file input.c.

Referenced by CL_MouseMove(), CL_RegisterInput(), and vkpt_freecam_mousemove().

◆ m_autosens

cvar_t* m_autosens

Definition at line 35 of file input.c.

Referenced by CL_MouseMove(), CL_RegisterInput(), and vkpt_freecam_mousemove().

◆ m_filter

cvar_t* m_filter
static

Definition at line 33 of file input.c.

Referenced by CL_MouseMove(), and CL_RegisterInput().

◆ m_forward

cvar_t* m_forward
static

Definition at line 53 of file input.c.

Referenced by CL_MouseMove(), and CL_RegisterInput().

◆ m_invert

cvar_t* m_invert

Definition at line 51 of file input.c.

Referenced by CL_MouseMove(), CL_RegisterInput(), and vkpt_freecam_mousemove().

◆ m_pitch

cvar_t* m_pitch

Definition at line 50 of file input.c.

Referenced by CL_MouseMove(), CL_RegisterInput(), and vkpt_freecam_mousemove().

◆ m_side

cvar_t* m_side
static

Definition at line 54 of file input.c.

Referenced by CL_MouseMove(), and CL_RegisterInput().

◆ m_yaw

cvar_t* m_yaw

Definition at line 52 of file input.c.

Referenced by CL_MouseMove(), CL_RegisterInput(), and vkpt_freecam_mousemove().

◆ sensitivity

cvar_t* sensitivity

Definition at line 48 of file input.c.

Referenced by CL_MouseMove(), CL_RegisterInput(), and vkpt_freecam_mousemove().

IN_BackUp
static void IN_BackUp(void)
Definition: input.c:396
client_state_s::frame
server_frame_t frame
Definition: client.h:212
in_right
static kbutton_t in_right
Definition: input.c:290
VID_FillInputAPI
void VID_FillInputAPI(inputAPI_t *api)
Definition: client.c:1388
server_frame_t::valid
qboolean valid
Definition: client.h:129
autosens_x
float autosens_x
Definition: input.c:492
client_state_s::mousemove
vec2_t mousemove
Definition: client.h:238
KeyUp
static void KeyUp(kbutton_t *b)
Definition: input.c:334
Cvar_Set
cvar_t * Cvar_Set(const char *var_name, const char *value)
Definition: cvar.c:466
CL_SendBatchedCmd
static void CL_SendBatchedCmd(void)
Definition: input.c:1009
m_filter
static cvar_t * m_filter
Definition: input.c:33
IN_LeftDown
static void IN_LeftDown(void)
Definition: input.c:389
IN_KLookUp
static void IN_KLookUp(void)
Definition: input.c:384
client_static_s::playback
qhandle_t playback
Definition: client.h:453
IN_LeftUp
static void IN_LeftUp(void)
Definition: input.c:390
Cvar_BitInfo
size_t Cvar_BitInfo(char *info, int bit)
Definition: cvar.c:1109
m_accel
cvar_t * m_accel
Definition: input.c:34
IN_UseDown
static void IN_UseDown(void)
Definition: input.c:424
client_state_s::cmdNumber
unsigned cmdNumber
Definition: client.h:184
cl_run
static cvar_t * cl_run
Definition: input.c:42
client_static_s::demo
struct client_static_s::@3 demo
in_moveright
static kbutton_t in_moveright
Definition: input.c:291
Cmd_AddCommand
void Cmd_AddCommand(const char *name, xcommand_t function)
Definition: cmd.c:1562
input
static in_state_t input
Definition: input.c:71
IN_BackDown
static void IN_BackDown(void)
Definition: input.c:395
IN_DownDown
static void IN_DownDown(void)
Definition: input.c:387
autosens_y
float autosens_y
Definition: input.c:493
IN_MLookDown
static void IN_MLookDown(void)
Definition: input.c:448
KeyClear
static void KeyClear(kbutton_t *b)
Definition: input.c:374
Cvar_Get
cvar_t * Cvar_Get(const char *var_name, const char *var_value, int flags)
Definition: cvar.c:257
client_static_s::key_dest
keydest_t key_dest
Definition: client.h:376
IN_KLookDown
static void IN_KLookDown(void)
Definition: input.c:383
cl_cmdbuf
cmdbuf_t cl_cmdbuf
Definition: main.c:104
in_up
static kbutton_t in_up
Definition: input.c:293
cl_upspeed
static cvar_t * cl_upspeed
Definition: input.c:37
cl_instantpacket
static cvar_t * cl_instantpacket
Definition: input.c:30
IN_MoverightUp
static void IN_MoverightUp(void)
Definition: input.c:404
cl_packetdup
static cvar_t * cl_packetdup
Definition: input.c:25
sensitivity
cvar_t * sensitivity
Definition: input.c:48
IN_Shutdown
void IN_Shutdown(void)
Definition: input.c:173
IN_RightUp
static void IN_RightUp(void)
Definition: input.c:392
ca_active
@ ca_active
Definition: client.h:340
IN_GetCurrentGrab
static qboolean IN_GetCurrentGrab(void)
Definition: input.c:84
CL_MouseMove
static void CL_MouseMove(void)
Definition: input.c:500
client_static_s::state
connstate_t state
Definition: client.h:375
in_lookup
static kbutton_t in_lookup
Definition: input.c:291
ca_connected
@ ca_connected
Definition: client.h:337
sv_paused
cvar_t * sv_paused
Definition: common.c:96
IN_StrafeDown
static void IN_StrafeDown(void)
Definition: input.c:407
client_static_s::active
active_t active
Definition: client.h:378
in_left
static kbutton_t in_left
Definition: input.c:290
in_speed
static kbutton_t in_speed
Definition: input.c:292
client_state_s::viewangles
vec3_t viewangles
Definition: client.h:230
kbutton_s::msec
unsigned msec
Definition: input.c:285
in_klook
static kbutton_t in_klook
Definition: input.c:289
cl_yawspeed
static cvar_t * cl_yawspeed
Definition: input.c:40
MSG_WriteByte
void MSG_WriteByte(int c)
Definition: msg.c:107
IN_MLookUp
static void IN_MLookUp(void)
Definition: input.c:453
IN_ForwardDown
static void IN_ForwardDown(void)
Definition: input.c:393
Cmd_Argv
char * Cmd_Argv(int arg)
Definition: cmd.c:899
IN_UpUp
static void IN_UpUp(void)
Definition: input.c:386
in_grab
static cvar_t * in_grab
Definition: input.c:77
in_down
static kbutton_t in_down
Definition: input.c:293
in_strafe
static kbutton_t in_strafe
Definition: input.c:292
P_FRAMES
#define P_FRAMES
Definition: client.h:400
CL_SendDefaultCmd
static void CL_SendDefaultCmd(void)
Definition: input.c:924
IN_UseUp
static void IN_UseUp(void)
Definition: input.c:433
client_static_s::userinfo_updates
cvar_t * userinfo_updates[MAX_PACKET_USERINFOS]
Definition: client.h:384
cmd_buffer
cmdbuf_t cmd_buffer
Definition: cmd.c:49
CL_AdjustAngles
static void CL_AdjustAngles(int msec)
Definition: input.c:566
client_state_s::sendPacketNow
qboolean sendPacketNow
Definition: client.h:180
in_enable
static cvar_t * in_enable
Definition: input.c:73
cl_maxpackets
static cvar_t * cl_maxpackets
Definition: input.c:24
ready_to_send
static qboolean ready_to_send(void)
Definition: input.c:877
IN_UpDown
static void IN_UpDown(void)
Definition: input.c:385
IN_RightDown
static void IN_RightDown(void)
Definition: input.c:391
SZ_GetSpace
void * SZ_GetSpace(sizebuf_t *buf, size_t len)
Definition: sizebuf.c:48
client_state_s::localmove
vec3_t localmove
Definition: client.h:234
m_forward
static cvar_t * m_forward
Definition: input.c:53
CL_ClampSpeed
static void CL_ClampSpeed(vec3_t move)
Definition: input.c:619
msg_write
sizebuf_t msg_write
Definition: msg.c:34
client_static_s::userinfo_modified
int userinfo_modified
Definition: client.h:383
Cvar_ClampValue
float Cvar_ClampValue(cvar_t *var, float min, float max)
Definition: cvar.c:571
in_moveleft
static kbutton_t in_moveleft
Definition: input.c:291
CL_BaseMove
static void CL_BaseMove(vec3_t move)
Definition: input.c:595
kbutton_s::downtime
unsigned downtime
Definition: input.c:284
client_static_s::serverProtocol
int serverProtocol
Definition: client.h:422
in_impulse
static int in_impulse
Definition: input.c:295
IN_StrafeUp
static void IN_StrafeUp(void)
Definition: input.c:408
Key_IsDown
int Key_IsDown(int key)
Definition: keys.c:204
IN_Init
void IN_Init(void)
Definition: input.c:210
client_state_s::cmds
usercmd_t cmds[CMD_BACKUP]
Definition: client.h:183
client_history_t::sent
unsigned sent
Definition: client.h:123
CL_ClampPitch
static void CL_ClampPitch(void)
Definition: input.c:628
IN_LookdownUp
static void IN_LookdownUp(void)
Definition: input.c:400
ready_to_send_hacked
static qboolean ready_to_send_hacked(void)
Definition: input.c:906
in_use
static kbutton_t in_use
Definition: input.c:292
client_state_s::lightlevel
int lightlevel
Definition: client.h:256
client_state_s::lastTransmitCmdNumber
unsigned lastTransmitCmdNumber
Definition: client.h:178
cl_sidespeed
static cvar_t * cl_sidespeed
Definition: input.c:39
IN_MoveleftDown
static void IN_MoveleftDown(void)
Definition: input.c:401
IN_Activate
void IN_Activate(void)
Definition: input.c:117
in_state_t::api
inputAPI_t api
Definition: input.c:66
m_invert
cvar_t * m_invert
Definition: input.c:51
m_yaw
cvar_t * m_yaw
Definition: input.c:52
in_state_t::old_dy
int old_dy
Definition: input.c:68
client_history_t::cmdNumber
unsigned cmdNumber
Definition: client.h:125
IN_LookdownDown
static void IN_LookdownDown(void)
Definition: input.c:399
cl
client_state_t cl
Definition: main.c:99
in_forward
static kbutton_t in_forward
Definition: input.c:290
cl_batchcmds
static cvar_t * cl_batchcmds
Definition: input.c:31
cls
client_static_t cls
Definition: main.c:98
ca_cinematic
@ ca_cinematic
Definition: client.h:341
MSG_WriteString
void MSG_WriteString(const char *string)
Definition: msg.c:160
c
statCounters_t c
Definition: main.c:30
V_CalcFov
float V_CalcFov(float fov_x, float width, float height)
Definition: view.c:379
IN_AttackDown
static void IN_AttackDown(void)
Definition: input.c:410
in_attack
static kbutton_t in_attack
Definition: input.c:292
MSG_WriteLong
void MSG_WriteLong(int c)
Definition: msg.c:144
client_state_s::cmd
usercmd_t cmd
Definition: client.h:182
CL_SendKeepAlive
static void CL_SendKeepAlive(void)
Definition: input.c:1104
kbutton_s::state
int state
Definition: input.c:286
cl_fuzzhack
static cvar_t * cl_fuzzhack
Definition: input.c:26
client_state_s::fov_x
float fov_x
Definition: client.h:254
Cvar_ClampInteger
int Cvar_ClampInteger(cvar_t *var, int min, int max)
Definition: cvar.c:549
client_history_t::rcvd
unsigned rcvd
Definition: client.h:124
lookspring
static cvar_t * lookspring
Definition: input.c:46
m_side
static cvar_t * m_side
Definition: input.c:54
in_mlooking
static qboolean in_mlooking
Definition: input.c:296
m_autosens
cvar_t * m_autosens
Definition: input.c:35
server_frame_t::ps
player_state_t ps
Definition: client.h:137
in_lookdown
static kbutton_t in_lookdown
Definition: input.c:291
client_history_t
Definition: client.h:122
IN_AttackUp
static void IN_AttackUp(void)
Definition: input.c:419
CL_KeyState
static float CL_KeyState(kbutton_t *key)
Definition: input.c:468
IN_Restart_f
static void IN_Restart_f(void)
Definition: input.c:129
IN_ForwardUp
static void IN_ForwardUp(void)
Definition: input.c:394
server_frame_t::number
int number
Definition: client.h:131
DI_FillAPI
void DI_FillAPI(inputAPI_t *api)
Definition: dinput.c:316
m_autosens_changed
static void m_autosens_changed(cvar_t *self)
Definition: input.c:689
in_state_t::old_dx
int old_dx
Definition: input.c:67
freelook
static cvar_t * freelook
Definition: input.c:45
client_static_s::realtime
unsigned realtime
Definition: client.h:389
CL_SendUserinfo
static void CL_SendUserinfo(void)
Definition: input.c:1127
IN_LookupUp
static void IN_LookupUp(void)
Definition: input.c:398
cl_pitchspeed
static cvar_t * cl_pitchspeed
Definition: input.c:41
in_back
static kbutton_t in_back
Definition: input.c:290
client_state_s::lastTransmitTime
unsigned lastTransmitTime
Definition: client.h:177
cl_nodelta
static cvar_t * cl_nodelta
Definition: input.c:23
cl_forwardspeed
static cvar_t * cl_forwardspeed
Definition: input.c:38
client_state_s::history
client_history_t history[CMD_BACKUP]
Definition: client.h:186
COM_BlockSequenceCRCByte
byte COM_BlockSequenceCRCByte(byte *base, size_t length, int sequence)
Definition: crc.c:148
client_state_s::fov_y
float fov_y
Definition: client.h:255
IN_MoverightDown
static void IN_MoverightDown(void)
Definition: input.c:403
IN_LookupDown
static void IN_LookupDown(void)
Definition: input.c:397
IN_DownUp
static void IN_DownUp(void)
Definition: input.c:388
IN_MoveleftUp
static void IN_MoveleftUp(void)
Definition: input.c:402
lookstrafe
static cvar_t * lookstrafe
Definition: input.c:47
client_static_s::protocolVersion
int protocolVersion
Definition: client.h:423
IN_SpeedDown
static void IN_SpeedDown(void)
Definition: input.c:405
Key_AnyKeyDown
int Key_AnyKeyDown(void)
Definition: keys.c:220
in_changed_hard
static void in_changed_hard(cvar_t *self)
Definition: input.c:195
com_framenum
unsigned com_framenum
Definition: common.c:121
client_static_s::netchan
netchan_t * netchan
Definition: client.h:421
IN_Impulse
static void IN_Impulse(void)
Definition: input.c:438
kbutton_s::down
int down[2]
Definition: input.c:283
IN_CenterView
static void IN_CenterView(void)
Definition: input.c:443
cl_anglespeedkey
static cvar_t * cl_anglespeedkey
Definition: input.c:43
in_state_t::modified
qboolean modified
Definition: input.c:65
in_changed_soft
static void in_changed_soft(cvar_t *self)
Definition: input.c:200
KeyDown
static void KeyDown(kbutton_t *b)
Definition: input.c:298
IN_SpeedUp
static void IN_SpeedUp(void)
Definition: input.c:406
r_config
refcfg_t r_config
Definition: refresh.c:401
SZ_Clear
void SZ_Clear(sizebuf_t *buf)
Definition: sizebuf.c:40
client_state_s::lastTransmitCmdNumberReal
unsigned lastTransmitCmdNumberReal
Definition: client.h:179
com_eventTime
unsigned com_eventTime
Definition: common.c:122
m_pitch
cvar_t * m_pitch
Definition: input.c:50
client_state_s::pmp
pmoveParams_t pmp
Definition: client.h:280